/* Numerology Calculator Styles - Matching Theme Design */

.numerology-calculator {
    max-width: 900px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    margin-bottom: 3rem;
}

.calculator-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.calculator-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

.calculator-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.75rem;
}

.calculator-description {
    font-size: 1.125rem;
    color: #4a5568; /* FIXED: Better contrast (7.5:1) */
    margin: 0;
}

/* Form Styling */
.numerology-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        padding: 2rem 1.5rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748; /* FIXED: Better contrast (8.6:1) */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1.0625rem;
    color: #2d3748;
    background-color: white;
    transition: all 0.2s ease;
}

.form-group input:hover {
    border-color: #cbd5e0;
}

.form-group input:focus {
    outline: none;
    border-color: #805ad5;
    box-shadow: 0 0 0 3px rgba(128, 90, 213, 0.1);
}

/* Calculate Button */
.calculate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(128, 90, 213, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(128, 90, 213, 0.4);
}

.calculate-button:active {
    transform: translateY(0);
}

.button-icon {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 2.5;
}

/* Results Section */
.numerology-result {
    margin-top: 2rem;
}

.result-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    margin-bottom: 2rem;
}

.result-card h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin-bottom: 2.5rem;
}

.number-result {
    background: none;
    border-radius: 0;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border: none;
}

.number-result:last-of-type {
    margin-bottom: 0;
}

/* Result Title (without number) */
.result-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
}

/* Large Number Display */
.number-display {
    text-align: center;
    margin: 1.5rem 0;
}

.number-large {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .number-large {
        font-size: 4.5rem;
    }

    .result-title {
        font-size: 1.5rem;
    }
}

/* Result Subtitle & Intro */
.result-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    margin-bottom: 1rem;
}

.result-intro {
    font-size: 1.0625rem;
    color: #4a5568;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    text-align: center;
}

/* Legacy support for old h4 and p tags */
.number-result h4 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.number-result p {
    font-size: 1.0625rem;
    color: #4a5568;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.result-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white !important; /* FIXED: White text for better contrast */
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    margin-top: 1.5rem !important;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6b46c1 0%, #553c9a 100%); /* FIXED: Darker gradient */
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.result-link:hover {
    color: white !important;
    gap: 0.75rem;
    background: linear-gradient(135deg, #553c9a 0%, #44337a 100%); /* IMPROVED: Even darker on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

/* Browse All CTA */
.browse-all-cta {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid #e2e8f0;
    text-align: center;
}

.browse-all-cta p {
    font-size: 1.125rem;
    color: #4a5568;
    margin-bottom: 1.25rem;
}

.browse-all-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 9999px;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.3);
    transition: all 0.3s ease;
}

.browse-all-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
    text-decoration: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.numerology-result .result-card,
.numerology-result .number-result {
    animation: fadeIn 0.5s ease-out;
}

/* Dramatic Result Fade-In Animation */
@keyframes dramaticFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.state-result-container .number-result {
    animation: dramaticFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.state-result-container .calculate-another-button {
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

/* ========================================================================
   IN-CARD STATE TRANSITIONS (Form → Loading → Results)
   ======================================================================== */

/* Utility: Hide elements */
.hidden {
    display: none !important;
}

/* State containers with fade transitions */
.calculator-state-fade {
    opacity: 1;
    transition: opacity 300ms ease-in-out;
}

.calculator-state-fade.fading-out {
    opacity: 0;
}

/* Loading State Container - Compact to fit in viewport */
.loading-state {
    padding: 2rem 2rem;
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Spinner Animation */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #805ad5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite, fadeInScale 0.4s ease-out;
    margin-bottom: 1.25rem;
}

/* Loading Message */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-message {
    font-size: 1.125rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

/* Benefits Grid During Loading - Compact Single Lines */
.loading-benefits-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

/* Slower, More Elegant Slide-in with Fade */
@keyframes slowSlideAndFade {
    0% {
        opacity: 0;
        transform: translateX(80px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.loading-benefit-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    opacity: 0;
    animation: slowSlideAndFade 1.2s ease-out forwards;
    line-height: 1.4;
}

/* FIXED: Faster, more engaging animation timing - 0.5s between items */
.loading-benefit-item:nth-child(1) {
    animation-delay: 0.3s;
}

.loading-benefit-item:nth-child(2) {
    animation-delay: 0.8s;
}

.loading-benefit-item:nth-child(3) {
    animation-delay: 1.3s;
}

.loading-benefit-item:nth-child(4) {
    animation-delay: 1.8s;
}

.loading-benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Single line with inline title and description */
.loading-benefit-content {
    font-size: 0.9375rem;
    color: #2d3748; /* FIXED: Better readability (8.6:1) */
    line-height: 1.4;
}

.loading-benefit-content h4 {
    display: inline;
    font-size: inherit;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.loading-benefit-content p {
    display: inline;
    font-size: inherit;
    font-weight: 400;
    color: inherit;
    margin: 0;
}

/* Add spacing after title */
.loading-benefit-content h4::after {
    content: ': ';
    font-weight: 400;
}

/* Calculate Another Button */
.calculate-another-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: white;
    color: #805ad5;
    border: 2px solid #805ad5;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.calculate-another-button:hover {
    background: #805ad5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 90, 213, 0.3);
}

.calculate-another-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile Responsiveness for Loading State */
@media (max-width: 640px) {
    .loading-state {
        padding: 1.5rem 1rem;
        min-height: 280px;
    }

    .loading-message {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .loading-benefits-grid {
        gap: 0.875rem;
    }

    .loading-benefit-content {
        font-size: 0.875rem;
    }

    .loading-benefit-icon {
        font-size: 1.25rem;
    }
}

/* ========================================================================
   TOOLTIP COMPONENT
   ======================================================================== */

.help-tooltip {
    display: inline-block;
    cursor: help;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.help-icon {
    display: inline-block;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.help-tooltip:hover .help-icon {
    opacity: 1;
}

.tooltip-bubble {
    position: absolute;
    background: #1a202c;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a202c;
}

/* ========================================================================
   CALCULATOR HUB / GRID LAYOUT
   ======================================================================== */

.calculator-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.calculator-hub-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.calculator-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.calculator-hub-card:hover::before {
    transform: scaleX(1);
}

.calculator-hub-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.calculator-hub-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.calculator-hub-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.75rem;
}

.calculator-hub-description {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.calculator-hub-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.calculator-hub-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calculator-hub-button svg {
    width: 16px;
    height: 16px;
}

/* ========================================================================
   FAQ ACCORDION COMPONENT
   ======================================================================== */

.faq-section {
    margin: 4rem 0;
}

.faq-section-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 2rem;
    text-align: center;
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #f7fafc;
}

.faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.faq-item.active .faq-icon {
    background: #667eea;
    color: white;
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
    color: #374151; /* FIXED: Better contrast (gray-700) */
    line-height: 1.7;
    margin: 0;
}

.faq-answer ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.faq-answer strong {
    color: #1a202c;
}

/* Mobile Responsiveness for FAQ */
@media (max-width: 640px) {
    .faq-question {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }

    .faq-section-title {
        font-size: 1.5rem;
    }
}

/* ========================================================================
   FORM HELP TEXT
   ======================================================================== */

.form-help {
    display: block;
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Mobile Responsiveness for Hub Grid */
@media (max-width: 640px) {
    .calculator-hub-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calculator-hub-card {
        padding: 1.5rem;
    }

    .calculator-hub-icon {
        font-size: 2.5rem;
    }

    .calculator-hub-title {
        font-size: 1.25rem;
    }
}

/* ========================================================================
   YEAR TOGGLE PILLS (Personal Year Calculator)
   ======================================================================== */

.year-toggle-group {
    display: flex;
    gap: 0;
    background: #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.year-toggle-btn {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.year-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.year-toggle-btn.active {
    background: white;
    color: #805ad5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.year-toggle-btn .year-label {
    font-weight: 400;
    font-size: 0.875rem;
    opacity: 0.8;
}

@media (max-width: 640px) {
    .year-toggle-btn {
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
    }

    .year-toggle-btn .year-label {
        font-size: 0.75rem;
    }
}
