/* Elegant Mini Hero */
.mini-hero {
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(201, 160, 220, 0.2);
    box-shadow: 0 8px 32px rgba(155, 127, 165, 0.1);
    position: relative;
    overflow: hidden;
}

.mini-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 181, 232, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, -20px);
    }
}

.mini-hero h3 {
    font-family: 'Times New Roman', serif;
    font-size: 2rem;
    margin-bottom: 12px;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    position: relative;
    z-index: 1;
    font-style: italic;
}

.mini-hero p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.mini-hero .promo-text {
    color: #888;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Main Grid Container */
#fair-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Sophisticated Region Section */
.region-section {
    margin-bottom: 35px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 25px;
    box-shadow: 0 8px 40px rgba(155, 127, 165, 0.1);
    border: 1px solid rgba(201, 160, 220, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.region-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0.7;
}

.region-section:last-child {
    margin-bottom: 0;
}

.region-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(201, 160, 220, 0.15);
}

.region-header h4 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.region-badge {
    display: inline-block;
    background: var(--primary-gradient);
    color: var(--text-dark);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 15px;
    box-shadow: 0 4px 12px rgba(155, 127, 165, 0.25);
}

/* Grid System */
.fair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

/* Premium Glassmorphism Cards */
.fair-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    overflow: visible;
    /* Changed to visible for badge */
    box-shadow: 0 8px 28px rgba(155, 127, 165, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(201, 160, 220, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 350px;
}

.fair-card-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: inherit;
}

.fair-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.fair-card-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--shimmer-gradient);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.fair-card:hover .fair-card-inner::before {
    opacity: 1;
}

.fair-card:hover .fair-card-inner::after {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.fair-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 16px 48px rgba(155, 127, 165, 0.2);
    border-color: rgba(201, 160, 220, 0.6);
    background: rgba(255, 255, 255, 0.8);
}

.card-image {
    height: 170px;
    min-height: 170px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    flex-shrink: 0;
    position: relative;
}

.fair-card:hover .card-image {
    transform: scale(1.1);
}

.card-content {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    height: 180px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-dark);
    line-height: 1.35;
    letter-spacing: -0.3px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.45;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    font-size: 0.88rem;
    color: var(--text-dark);
    border-top: 1px solid rgba(201, 160, 220, 0.15);
    padding-top: 10px;
    font-weight: 600;
    margin-top: auto;
}

.card-meta i {
    color: var(--accent-color);
    margin-right: 5px;
    width: 13px;
}

.card-date {
    display: block;
    margin-bottom: 5px;
}

.card-location {
    display: block;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.78rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(155, 127, 165, 0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(155, 127, 165, 0.5);
    background: var(--secondary-gradient);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .mini-hero {
        padding: 20px;
    }

    .mini-hero h3 {
        font-size: 1.5rem;
    }

    .region-section {
        padding: 20px;
        margin-bottom: 30px;
    }

    .fair-grid {
        grid-template-columns: 1fr;
    }

    .fair-card {
        height: auto;
        min-height: 340px;
    }
}

/* MD Pick Badge */
.md-pick-badge {
    position: absolute;
    top: -15px;
    left: -15px;
    z-index: 20;
    width: 100px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    animation: floatBadge 3s ease-in-out infinite;
}

.md-pick-badge img {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes floatBadge {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

/* User Actions Button */
.btn-icon {
    background: rgba(168, 216, 234, 0.15);
    border: none;
    font-size: 1.2rem;
    margin-left: 18px;
    cursor: pointer;
    color: var(--accent-color);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--accent-gradient);
    color: white;
    transform: scale(1.1);
}

/* ===================================
   Compatibility Page Styles
   =================================== */

.compatibility-container {
    max-width: 900px;
    margin: 0 auto;
}

.compatibility-card {
    padding: 40px;
    margin-bottom: 30px;
}

.compatibility-card h4 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-align: center;
}

.compatibility-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 35px;
    font-size: 0.95rem;
}

.compatibility-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    background: rgba(255, 255, 255, 0.5);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(201, 160, 220, 0.2);
}

.form-section h5 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input[type="date"] {
    padding: 14px 18px;
    border: 2px solid rgba(201, 160, 220, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-body);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 127, 165, 0.1);
}

.form-divider {
    text-align: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 10px 0;
}

.btn-submit {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(155, 127, 165, 0.3);
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 127, 165, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Compatibility Result */
.compatibility-result {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid rgba(201, 160, 220, 0.2);
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-header h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-score {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    background: var(--primary-gradient);
    padding: 15px 35px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(155, 127, 165, 0.3);
}

.score-number {
    font-size: 3rem;
    font-weight: 900;
    color: white;
}

.score-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.result-content {
    background: rgba(255, 255, 255, 0.5);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(201, 160, 220, 0.2);
}

.result-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    text-align: center;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-card {
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(155, 127, 165, 0.15);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: block;
}

.info-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .compatibility-card {
        padding: 25px 20px;
    }

    .tab-navigation {
        padding: 0 20px;
    }

    .tab-item {
        padding: 0 10px;
        font-size: 0.85rem;
    }

    .tab-item span {
        display: inline;
    }

    .tab-item i {
        font-size: 1.3rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .mini-hero .promo-text {
        font-weight: 400;
    }
}

/* FAQ Section Styles */
.faq-section {
    margin-top: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 1px solid rgba(201, 160, 220, 0.2);
    box-shadow: 0 8px 32px rgba(155, 127, 165, 0.1);
}

.faq-section h3 {
    font-size: 1.5rem;
    font-family: 'Times New Roman', serif;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-section h3::before {
    content: 'Q&A';
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--accent-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 800;
}

.faq-item {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(201, 160, 220, 0.15);
    padding-bottom: 15px;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--accent-color);
}

.faq-question i {
    color: var(--accent-subtle);
    transition: transform 0.3s;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    display: none;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    margin-top: 5px;
}

.faq-item.active .faq-answer {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.faq-toggle-container {
    margin-top: 20px;
    text-align: center;
}

.btn-faq-toggle {
    background: white;
    border: 1px solid rgba(201, 160, 220, 0.4);
    padding: 10px 25px;
    border-radius: 50px;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-faq-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 127, 165, 0.15);
}