/**
 * Public-facing styles for the plugin.
 */

.longevity-test-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.longevity-test-header {
    text-align: center;
    margin-bottom: 2rem;
}

.longevity-test-header h2 {
    color: #003497;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.longevity-test-header h2:after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background: #003497;
    bottom: -10px;
    left: 25%;
    border-radius: 2px;
}

.longevity-test-header p {
    color: #666;
    font-size: 1rem;
}

.longevity-progress {
    margin-bottom: 1.5rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    height: 8px;
    overflow: hidden;
}

.longevity-progress-bar {
    background-color: #003497;
    height: 100%;
    transition: width 0.3s ease;
}

.longevity-progress-text {
    text-align: right;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.longevity-question {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.longevity-question.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.longevity-question-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #003497;
    margin-bottom: 1rem;
}

.longevity-question-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: flex !important;
    margin: 0 auto !important; 
}

.longevity-options {
    margin-top: 1rem;
}

.longevity-option {
    position: relative;
    padding: 15px 15px 15px 50px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.longevity-option:hover {
    border-color: #003497;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.longevity-option.selected {
    border-color: #003497;
    background-color: #e6f2ff;
}

.longevity-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.longevity-option .checkmark {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.longevity-option input[type="checkbox"]+.checkmark {
    border-radius: 4px;
}

.longevity-option:hover .checkmark {
    border-color: #003497;
}

.longevity-option.selected .checkmark {
    background-color: #003497;
    border-color: #003497;
}

.longevity-option.selected .checkmark:after {
    content: '';
    position: absolute;
    display: block;
}

.longevity-option.selected input[type="checkbox"]+.checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.longevity-option.selected input[type="radio"]+.checkmark:after {
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.longevity-option label {
    display: block;
    margin: 0;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

.longevity-buttons {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
}

.longevity-btn {
    padding: 0.75rem 1.5rem;
    background: #003497;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.longevity-btn:hover {
    background: #003d7a;
}

.longevity-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.longevity-btn-prev {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #ddd;
}

.longevity-btn-prev:hover {
    background: #e2e6ea;
}

.longevity-user-info {
    margin-top: 1rem;
}

.longevity-user-info label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.longevity-user-info input[type="text"],
.longevity-user-info input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.longevity-payment {
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.longevity-payment-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.longevity-payment-header h3 {
    color: #0056b3;
}

.longevity-payment-amount {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}

.longevity-card-element {
    display: none;
}

.longevity-card-errors {
    color: #dc3545;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: none;
}

.longevity-submit {
    text-align: center;
    margin-top: 2rem;
}

.longevity-submit-btn {
    padding: 0.75rem 2rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.longevity-submit-btn:hover {
    background: #218838;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.longevity-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.longevity-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    display: none;
}

.longevity-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #003497;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.longevity-results {
    display: none;
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 5px solid #003497;
}

.longevity-results.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.score-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #e6f2ff;
    border-radius: 8px;
}

.score-section h2 {
    color: #0056b3;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.score-interpretation {
    margin-top: 1rem;
}

.score-interpretation p {
    margin-bottom: 0.5rem;
}

.life-expectancy-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f0f8f0;
    border-radius: 8px;
    border-left: 5px solid #28a745;
}

.life-expectancy-section h3 {
    color: #28a745;
    margin-bottom: 1rem;
}

.recommendations-section {
    margin-top: 2rem;
}

.recommendations-section h3 {
    color: #003497;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.recommendations-list {
    padding-left: 1.25rem;
}

.recommendations-list li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.longevity-email-sent {
    margin-top: 2rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
    .longevity-test-container {
        padding: 1rem;
        margin: 1rem;
    }

    .longevity-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .longevity-btn,
    .longevity-submit-btn {
        width: 100%;
    }

    .score-section,
    .life-expectancy-section {
        padding: 1rem;
    }
}