/* Bright Warm Theme Variables */
:root {
    --primary-color: #ff7b54;
    --secondary-color: #ffb347;
    --accent-color: #ffd93d;
    --background: #fff8f0;
    --background-subtle: rgba(255, 248, 240, 0.95);
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255, 123, 84, 0.2);
    --text-primary: #2d1b0d;
    --text-secondary: #5d4037;
    --text-muted: #8d6e63;
    --shadow-sm: 0 4px 12px rgba(255, 123, 84, 0.15);
    --shadow-md: 0 8px 25px rgba(255, 123, 84, 0.2);
    --shadow-lg: 0 15px 35px rgba(255, 123, 84, 0.25);
    --shadow-xl: 0 25px 50px rgba(255, 123, 84, 0.3);
    --warm-glow: 0 0 20px rgba(255, 179, 71, 0.4);
    --sunny-glow: 0 0 15px rgba(255, 217, 61, 0.5);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    background: var(--background) !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background) !important;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Ensure all containers match theme */
.container-fluid,
.container {
    background: transparent !important;
}

/* Warm sunny animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 123, 84, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 179, 71, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 217, 61, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #fff8f0 0%, #ffeaa7 50%, #fff8f0 100%);
    z-index: -2;
    animation: sunnyMove 20s ease-in-out infinite;
}

/* Floating warm bubbles effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(3px 3px at 20px 30px, rgba(255, 123, 84, 0.6), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 179, 71, 0.7), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255, 217, 61, 0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 123, 84, 0.4), transparent),
        radial-gradient(3px 3px at 160px 30px, rgba(255, 179, 71, 0.6), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    z-index: -1;
    animation: floatWarm 6s ease-in-out infinite;
}

@keyframes sunnyMove {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-8px) rotate(0.5deg); }
    66% { transform: translateY(-4px) rotate(-0.5deg); }
}

@keyframes floatWarm {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Mystical Background */
.clean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    z-index: -3;
}

/* Mystical Glass Card Effect */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 123, 84, 0.1), transparent);
    transition: left 0.6s;
}

.glass-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--warm-glow), var(--shadow-xl);
    border-color: rgba(255, 123, 84, 0.6);
}

.glass-card:hover::before {
    left: 100%;
}
}

/* Mystical Navigation */
.navbar {
    background: rgba(255, 248, 240, 0.9);
    backdrop-filter: blur(20px);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 123, 84, 0.2);
    box-shadow: 0 4px 20px rgba(255, 123, 84, 0.1);
}

.navbar-brand {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    text-decoration: none;
    text-align: center;
    width: 100%;
    display: block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 179, 71, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        filter: brightness(1) drop-shadow(0 0 10px rgba(255, 179, 71, 0.3));
    }
    100% { 
        filter: brightness(1.1) drop-shadow(0 0 20px rgba(255, 179, 71, 0.6));
    }
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Mystical Form Styles */
.form-control {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 14px 18px;
    font-size: 16px;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: var(--warm-glow), 0 0 0 3px rgba(255, 123, 84, 0.15);
    outline: none;
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Section Headers */
.section-header {
    position: relative;
}

.section-header h3 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

/* Heart Divider */
.heart-divider {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Mystical Buttons */
.btn-romantic {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    color: white;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 16px;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn-romantic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn-romantic:hover {
    background: linear-gradient(135deg, #ff6b42, #ff9933);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--sunny-glow), var(--shadow-lg);
    border-color: rgba(255, 123, 84, 0.8);
}

.btn-romantic:hover::before {
    left: 100%;
}

.btn-romantic:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: var(--shadow-md);
}

/* Secondary button */
.btn-mystical {
    background: rgba(255, 248, 240, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-weight: 600;
    padding: 14px 28px;
    font-size: 16px;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.btn-mystical:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--warm-glow);
}

/* Hearts Display */
.hearts-display {
    margin: 2.5rem 0;
    filter: drop-shadow(0 5px 15px rgba(233, 30, 99, 0.3));
}

.heart-icon {
    font-size: 3.5rem;
    margin: 0 0.6rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
}

.heart-icon.filled {
    color: var(--secondary-color) !important;
    text-shadow: 
        0 0 25px rgba(255, 179, 71, 0.8),
        0 0 35px rgba(255, 179, 71, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.2);
    animation: heartGlow 2s ease-in-out infinite alternate;
}

.heart-icon:hover {
    transform: scale(1.2) rotate(5deg);
}

@keyframes heartGlow {
    0% { 
        text-shadow: 
            0 0 25px rgba(255, 179, 71, 0.8),
            0 0 35px rgba(255, 179, 71, 0.6),
            0 2px 4px rgba(0, 0, 0, 0.2);
    }
    100% { 
        text-shadow: 
            0 0 35px rgba(255, 179, 71, 1),
            0 0 45px rgba(255, 179, 71, 0.8),
            0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Score Badge */
.score-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
}

.score-badge:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Mystical Message */
.romantic-message {
    background: var(--background-subtle);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    position: relative;
}

.romantic-message::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Mystical Zodiac Cards */
.zodiac-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.zodiac-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 179, 71, 0.15), transparent);
    animation: zodiacRotate 8s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.zodiac-card:hover::before {
    opacity: 1;
}

.zodiac-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--warm-glow), var(--shadow-lg);
    border-color: rgba(255, 179, 71, 0.5);
}

@keyframes zodiacRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Compatibility Breakdown */
.compatibility-breakdown {
    background: var(--background-subtle);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.breakdown-item {
    margin-bottom: 1rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 235, 215, 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 1.5s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 123, 84, 0.4);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Numerology Section */
.numerology-section {
    background: var(--background-subtle);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.number-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.number-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Footer */
footer {
    background: var(--background-subtle) !important;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color) !important;
    margin-top: auto;
}

/* Ensure footer styling is applied */
footer.text-center {
    background: var(--background-subtle) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Override any conflicting styles */
.container-fluid footer,
.container footer {
    background: var(--background-subtle) !important;
}

/* Additional footer overrides */
footer small {
    color: var(--text-secondary) !important;
    line-height: 1.4 !important;
    word-wrap: break-word;
}

/* Mobile footer adjustments */
@media (max-width: 576px) {
    footer {
        padding: 15px 0 !important;
    }
    
    footer small {
        font-size: 11px !important;
        line-height: 1.3 !important;
        padding: 0 10px;
    }
    
    footer .container {
        padding: 0 15px !important;
    }
}

/* Main content wrapper background fix */
main {
    background: transparent !important;
}

/* Bootstrap override for footer */
footer.py-3,
footer.text-center.py-3,
.container-fluid footer,
footer[style] {
    background: var(--background-subtle) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Force footer background on all browsers */
footer,
footer *,
footer .container,
footer .container * {
    background-color: rgba(255, 248, 240, 0.8) !important;
}

/* Very specific override */
.container-fluid > footer.text-center.py-3[style] {
    background: var(--background-subtle) !important;
}

/* Mobile-specific footer styling */
@media (max-width: 768px) {
    footer,
    footer.text-center,
    footer.py-3,
    footer.footer-warm {
        background: rgba(255, 248, 240, 0.9) !important;
        border-top: 1px solid rgba(255, 179, 71, 0.3) !important;
        padding: 12px 0 !important;
    }
}

/* Additional specific footer class */
.footer-warm {
    background: rgba(255, 248, 240, 0.9) !important;
    border-top: 1px solid rgba(255, 179, 71, 0.3) !important;
    backdrop-filter: blur(10px) !important;
}

/* Top Ad Section Styling */
.container-fluid[style*="background: rgba(255, 248, 240, 0.5)"] {
    border-bottom: 1px solid rgba(255, 179, 71, 0.2);
    backdrop-filter: blur(5px);
}

/* Mobile responsive top ad */
@media (max-width: 768px) {
    .container-fluid[style*="background: rgba(255, 248, 240, 0.5)"] {
        padding: 8px 0 !important;
    }
    
    .container-fluid .adsbygoogle {
        min-height: 50px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .heart-icon {
        font-size: 2rem;
        margin: 0 0.3rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .glass-card {
        margin: 1rem;
    }
    
    .btn-romantic {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .glass-card .card-body {
        padding: 2rem 1.5rem;
    }
    
    .heart-icon {
        font-size: 1.5rem;
    }
    
    .score-badge {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Custom Alert Styles */
.alert {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* Loading States */
.btn-romantic:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Hover Effects */
.form-control:hover,
.form-select:hover {
    background: var(--card-bg) !important;
    border-color: var(--primary-color) !important;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Focus States */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

/* Global Form Styling Override */
.form-control,
.form-select,
.form-control-lg,
.form-select-lg {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
.form-control-lg:focus,
.form-select-lg:focus {
    background: var(--card-bg) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 123, 84, 0.25) !important;
    outline: none !important;
}

.form-select option,
.form-control option {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    padding: 8px 12px !important;
}

.form-select optgroup {
    background: var(--background-subtle) !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-style: normal !important;
}

/* AdSense Integration Styles */
.adsbygoogle {
    border-radius: 12px;
    background: var(--background-subtle);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.adsbygoogle:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 123, 84, 0.3);
}

/* Ad container wrapper */
.ad-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ad labels */
.ad-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
    opacity: 0.7;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First Approach */
@media (max-width: 576px) {
    /* Container and spacing adjustments */
    .container {
        padding: 0 15px;
    }
    
    /* Card adjustments for mobile */
    .glass-card {
        margin: 10px;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 20px !important;
    }
    
    /* Typography adjustments */
    h1.h2 {
        font-size: 1.5rem !important;
    }
    
    h3.h5 {
        font-size: 1.1rem !important;
    }
    
    /* Form controls for mobile */
    .form-control-lg,
    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .form-select-lg {
        font-size: 16px !important;
        padding: 12px 16px;
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    /* Form select option styling */
    .form-select option,
    .form-control option {
        background: var(--card-bg) !important;
        color: var(--text-primary) !important;
        padding: 8px 12px;
    }
    
    .form-select optgroup {
        background: var(--background-subtle) !important;
        color: var(--text-secondary) !important;
        font-weight: 600;
        font-style: normal;
    }
    
    /* Button adjustments */
    .btn-lg {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    /* Section spacing */
    .mb-4 {
        margin-bottom: 20px !important;
    }
    
    .mb-5 {
        margin-bottom: 24px !important;
    }
    
    /* Info cards */
    .col-md-4 {
        margin-bottom: 20px;
    }
    
    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.2rem;
        padding: 8px 0;
    }
    
    /* Results page adjustments */
    .compatibility-score {
        font-size: 2rem !important;
    }
    
    .zodiac-card {
        margin-bottom: 20px;
        padding: 20px;
    }
    
    /* Progress bars */
    .progress {
        height: 8px;
    }
    
    /* AdSense mobile optimization */
    .adsbygoogle {
        margin: 15px 0 !important;
        max-width: 100%;
    }
    
    /* MBTI section mobile specific */
    .breakdown-item {
        margin-bottom: 15px;
        padding: 15px;
        background: var(--card-bg);
        border-radius: 10px;
        box-shadow: var(--shadow-sm);
    }
    
    .breakdown-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    .breakdown-item .d-flex span:first-child {
        font-size: 14px;
    }
    
    .breakdown-item .d-flex span:last-child {
        font-size: 18px;
        align-self: flex-end;
    }
    
    /* Mobile MBTI cards */
    .col-md-6 div[style*="border-radius: 12px"] {
        margin-bottom: 15px;
        padding: 15px !important;
    }
    
    /* Mobile zodiac cards */
    .zodiac-card {
        padding: 15px !important;
        margin-bottom: 15px;
    }
    
    /* Action buttons mobile optimization */
    .text-center .btn {
        margin-bottom: 10px;
        width: 100%;
        max-width: 300px;
    }
    
    .btn-group {
        width: 100%;
        max-width: 300px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Mobile dropdown menu */
    .dropdown-menu {
        width: 100%;
        font-size: 16px;
    }
    
    /* MBTI form mobile improvements */
    .form-label {
        font-size: 14px !important;
        font-weight: 600 !important;
        margin-bottom: 8px;
    }
    
    /* Mobile specific MBTI analysis section */
    div[style*="background: var(--background-subtle)"] {
        padding: 15px !important;
        margin-bottom: 20px !important;
        border-radius: 12px !important;
    }
    
    /* MBTI detailed analysis box mobile */
    div[style*="border-left: 4px solid var(--primary-color)"] {
        padding: 12px !important;
        margin-top: 12px !important;
        border-radius: 8px !important;
    }
    
    /* MBTI section titles mobile */
    .mb-5 h4.text-center {
        font-size: 1.3rem !important;
        margin-bottom: 16px !important;
    }
    
    /* Mobile message text size */
    p[style*="font-size: 14px"] {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
    
    /* Mobile detailed analysis */
    div[style*="background: linear-gradient(135deg, #e8f0ff"] {
        padding: 12px !important;
    }
    
    div[style*="background: linear-gradient(135deg, #e8f0ff"] p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .glass-card {
        margin: 20px 10px;
    }
    
    .card-body {
        padding: 30px !important;
    }
    
    .form-control-lg {
        font-size: 16px;
    }
    
    /* Results layout for tablet */
    .col-md-6 {
        margin-bottom: 20px;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced hover effects for desktop */
    .glass-card:hover {
        transform: translateY(-8px) scale(1.02);
    }
    
    .btn:hover {
        transform: translateY(-3px);
    }
    
    /* Better spacing for desktop */
    .card-body {
        padding: 40px !important;
    }
}

/* Large desktop screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    /* Enhanced glass effects for large screens */
    .glass-card {
        border-radius: 20px;
    }
    
    .compatibility-score {
        font-size: 3.5rem;
    }
}

/* Ultra-wide screen optimizations */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Maintain reasonable content width */
    .col-lg-6 {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Height-based responsive adjustments */
@media (max-height: 600px) {
    .mb-5 {
        margin-bottom: 15px !important;
    }
    
    .mb-4 {
        margin-bottom: 12px !important;
    }
    
    .card-body {
        padding: 20px !important;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .min-vh-100 {
        min-height: auto;
    }
    
    .card-body {
        padding: 20px !important;
    }
    
    .mb-5 {
        margin-bottom: 15px !important;
    }
}

/* Desktop form improvements */
@media (min-width: 769px) {
    .form-control,
    .form-select {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        transition: all 0.3s ease;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: var(--card-bg);
        border-color: var(--primary-color);
        color: var(--text-primary);
        box-shadow: 0 0 0 0.2rem rgba(255, 123, 84, 0.25);
    }
    
    .form-select option {
        background: var(--card-bg);
        color: var(--text-primary);
    }
    
    .form-select optgroup {
        background: var(--background-subtle);
        color: var(--text-secondary);
        font-weight: 600;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: 12px 24px;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
        padding: 12px 16px;
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: var(--card-bg) !important;
        border-color: var(--primary-color) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 0 0 0.2rem rgba(255, 123, 84, 0.25) !important;
    }
    
    /* Remove hover effects on touch devices */
    .glass-card:hover {
        transform: none;
        box-shadow: var(--shadow-lg);
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .adsbygoogle {
        display: none !important;
    }
    
    .glass-card {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white;
    }
    
    body::before,
    body::after {
        display: none;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .glass-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a1a;
        --background-subtle: rgba(26, 26, 26, 0.95);
        --card-bg: rgba(30, 30, 30, 0.9);
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-muted: #999999;
        --border-color: rgba(255, 123, 84, 0.3);
    }
}
