/* Base Styles */
:root {
    --primary-bg: #080814;
    --accent-blue: #4361ee;
    --accent-purple: #7209b7;
    --accent-pink: #f72585;
    --accent-teal: #4cc9f0;
    --space-blue: #1a1b4b;
    --nebula-pink: #c41e8e;
    --cosmic-purple: #3d0066;
    --star-color: #fbfbff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(15, 15, 35, 0.25);
    --glass-bg-dark: rgba(10, 10, 30, 0.40);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.07);
    --button-gradient: linear-gradient(135deg, #4361ee, #7209b7);
    --button-hover: linear-gradient(135deg, #7209b7, #3a0ca3);
    --cosmic-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --card-glow: 0 0 15px rgba(76, 201, 240, 0.3);
    --transition-speed: 0.5s;
    --transition-ease: cubic-bezier(0.33, 1, 0.68, 1);
    --error-color: #f72585;
    --card-bg: rgba(20, 25, 50, 0.2);
    --card-border: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fix for page shifting - always show scrollbar */
html {
    overflow-y: scroll;
    min-height: 100%;
    scroll-behavior: smooth;
}

html, body {
    min-height: 100vh;
    position: relative;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--primary-bg);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Use min-height instead of height */
    position: relative;
    perspective: 1000px;
    padding-bottom: 0; /* Remove padding-bottom that causes extra space */
}

/* Star field background - creates a starry night effect */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

#stars, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

#stars {
    background-image: radial-gradient(2px 2px at 20px 30px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(2px 2px at 40px 70px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 90px 40px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(2px 2px at 160px 120px, var(--star-color), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.3;
    animation: twinkle 5s ease-in-out infinite alternate;
}

#stars2 {
    background-image: radial-gradient(1px 1px at 25px 5px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 50px 80px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 125px 20px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1.5px 1.5px at 150px 60px, var(--star-color), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 150px 150px;
    opacity: 0.2;
    animation: twinkle 4s ease-in-out infinite alternate;
    animation-delay: 1s;
}

#stars3 {
    background-image: radial-gradient(1px 1px at 10px 10px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 150px 150px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1.5px 1.5px at 60px 170px, var(--star-color), rgba(0,0,0,0)),
                      radial-gradient(1.5px 1.5px at 175px 180px, var(--star-color), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.1;
    animation: twinkle 7s ease-in-out infinite alternate;
    animation-delay: 2s;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
    }
    100% {
        opacity: 0.5;
    }
}

/* Animated background gradients - redesigned for cosmic feel */
.bg-gradient-1, 
.bg-gradient-2, 
.bg-gradient-3 {
    position: fixed;
    filter: blur(120px);
    opacity: 0.4;
    z-index: -1;
    border-radius: 40%;
}

.bg-gradient-1 {
    background: radial-gradient(circle, var(--cosmic-purple) 0%, transparent 75%);
    width: 70vmax;
    height: 70vmax;
    top: -20vmax;
    left: -15vmax;
    animation: float 40s ease-in-out infinite alternate;
}

.bg-gradient-2 {
    background: radial-gradient(circle, var(--space-blue) 0%, transparent 75%);
    width: 60vmax;
    height: 60vmax;
    bottom: -20vmax;
    right: -15vmax;
    animation: float 35s ease-in-out 5s infinite alternate-reverse;
}

.bg-gradient-3 {
    background: radial-gradient(circle, var(--nebula-pink) 0%, transparent 75%);
    width: 50vmax;
    height: 50vmax;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.25;
    animation: pulse 30s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(3%, 3%) rotate(5deg);
    }
    100% {
        transform: translate(-3%, -3%) rotate(-5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.35;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Header Styles - With enhanced animation and styling */
header {
    text-align: center;
    padding: 40px 0;
    transition: opacity var(--transition-speed) var(--transition-ease),
                transform var(--transition-speed) var(--transition-ease);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.header-hidden {
    opacity: 0;
    transform: translateY(-60px) rotateX(10deg);
    pointer-events: none;
}

h1 {
    position: relative;
    z-index: 0;
    width: 100%;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    line-height: 1.1;
    display: inline-block;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1),
                 0 0 30px rgba(67, 97, 238, 0.2);
    animation: textFloat 6s ease-in-out infinite alternate;
}

@keyframes textFloat {
    0% {
        transform: translateY(0);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.1),
                     0 0 30px rgba(67, 97, 238, 0.2);
    }
    100% {
        transform: translateY(-10px);
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.15),
                     0 0 40px rgba(67, 97, 238, 0.3);
    }
}

.title-highlight {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: gradientFlow 8s ease infinite;
    position: relative;
}

.title-highlight::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    border-radius: 4px;
    background-size: 200% 100%;
    animation: gradientFlow 8s ease infinite, pulseWidth 4s ease-in-out infinite;
    filter: blur(1px);
    opacity: 0.8;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseWidth {
    0%, 100% { transform: scaleX(1); opacity: 0.8; }
    50% { transform: scaleX(1.05); opacity: 1; }
}

.subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 600px;
    margin: 25px auto 0;
    letter-spacing: 0.2px;
    text-shadow: 0 0 20px rgba(76, 201, 240, 0.3);
    opacity: 0.9;
    animation: subtitleGlow 5s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(76, 201, 240, 0.2);
    }
    100% {
        opacity: 0.95;
        text-shadow: 0 0 25px rgba(76, 201, 240, 0.4);
    }
}

/* Fixed logo at top right - enhanced with glow */
.fixed-logo {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 100;
}

.logo {
    width: 80px;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(76, 201, 240, 0.3));
}

.fixed-logo a:hover .logo {
    transform: scale(1.08) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(76, 201, 240, 0.5));
}

/* Main Content Styles */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Fixed search box styles - enhanced glass effect */
#fixed-search {
    position: fixed;
    bottom: 80px;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    transition: all var(--transition-speed) var(--transition-ease);
    z-index: 10;
}

#fixed-search .search-container {
    max-width: 700px;
    margin: 0 auto;
}

#fixed-search-input, #search-input {
    width: 100%;
    padding: 20px 65px 20px 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 1.15rem;
    outline: none;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 
                inset 0 2px 5px rgba(255, 255, 255, 0.05);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#fixed-search-input:focus, #search-input:focus {
    border-color: rgba(76, 201, 240, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25), 
                0 0 15px rgba(76, 201, 240, 0.3), 
                inset 0 2px 5px rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

#fixed-search-input::placeholder, #search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

#fixed-search-button, #search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--button-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3),
                0 0 10px rgba(76, 201, 240, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#fixed-search-button:before, #search-button: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: all 0.4s ease;
}

#fixed-search-button:hover:before, #search-button:hover:before {
    left: 100%;
}

#fixed-search-button i, #search-button i {
    font-size: 1.2rem;
}

#fixed-search-button:hover, #search-button:hover {
    background: var(--button-hover);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(114, 9, 183, 0.4);
}

/* Footer Styles - fixed positioning to eliminate gap */
#page-footer {
    width: 100%;
    background: rgba(8, 8, 20, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-highlight);
    padding: 20px 0;
    margin-top: auto; /* Push footer to bottom using flexbox */
    position: relative; /* Change from absolute to relative */
    left: 0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.3);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 30px;
    position: relative;
}

#page-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    text-align: center;
    flex: 1;
    opacity: 0.8;
}

.footer-left, .footer-right {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 30px;
    position: relative;
}

.footer-left:after, .footer-right:after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -3px;
    left: 30px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
    transition: width 0.3s ease;
}

.footer-right:after {
    left: auto;
    right: 30px;
    background: linear-gradient(90deg, transparent, var(--accent-teal));
}

.footer-left:hover:after, .footer-right:hover:after {
    width: calc(100% - 60px);
}

.footer-left:hover, .footer-right:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.4);
}

/* Content area with scrolling effects */
#content-area {
    width: 100%;
    max-width: 800px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) var(--transition-ease);
    padding-bottom: 100px;
    perspective: 1000px;
}

/* Search Section - Enhanced with subtle animations */
#search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all var(--transition-speed) var(--transition-ease);
    transform-style: preserve-3d;
    animation: fadeIn 1s ease-out;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin-bottom: 15px;
    transition: all var(--transition-speed) var(--transition-ease);
}

.search-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 700px;
    text-align: center;
    margin-top: 15px;
    opacity: 0.7;
    font-weight: 300;
    transition: opacity 0.5s ease;
    animation: hintPulse 5s ease-in-out infinite alternate;
}

@keyframes hintPulse {
    0% { opacity: 0.5; }
    100% { opacity: 0.8; }
}

/* Loading Section - Cosmic themed loader */
#loading-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    position: relative;
    perspective: 800px;
}

.spinner:before, 
.spinner:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: spin 3s ease infinite;
    opacity: 0.8;
}

.spinner:before {
    border: 3px solid transparent;
    border-top-color: var(--accent-blue);
    border-bottom-color: var(--accent-pink);
    animation-duration: 2s;
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.4);
}

.spinner:after {
    border: 3px solid transparent;
    border-left-color: var(--accent-purple);
    border-right-color: var(--accent-teal);
    animation-duration: 3s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    box-shadow: 0 0 20px rgba(114, 9, 183, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg) rotateY(0deg); }
    50% { transform: rotate(180deg) rotateY(180deg); }
    100% { transform: rotate(360deg) rotateY(360deg); }
}

.loader p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 300;
    text-align: center;
    letter-spacing: 0.5px;
    max-width: 300px;
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.3);
    animation: textPulse 2s ease-in-out infinite alternate;
}

@keyframes textPulse {
    0% { opacity: 0.7; text-shadow: 0 0 10px rgba(76, 201, 240, 0.2); }
    100% { opacity: 1; text-shadow: 0 0 20px rgba(76, 201, 240, 0.4); }
}

/* Results Section - Cosmic card design */
#recommendation-display {
    width: 100%;
    padding: 20px;
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(20px) rotateX(5deg);
    transform-origin: center bottom;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.result-visible {
    opacity: 1 !important;
    transform: translateY(0) rotateX(0deg) !important;
}

#recommendation-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    padding: 30px;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2),
                0 0 15px var(--card-glow);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

#recommendation-text:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(76, 201, 240, 0.1), transparent 70%);
    pointer-events: none;
}

#recommendation-text h3 {
    color: var(--accent-teal);
    margin-top: 25px;
    margin-bottom: 20px;
    font-size: 1.6rem;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(76, 201, 240, 0.3);
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.4);
    position: relative;
}

#recommendation-text h3:first-child {
    margin-top: 0;
}

#recommendation-text h3:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-teal);
    box-shadow: 0 0 10px rgba(76, 201, 240, 0.7);
    animation: glowLine 3s ease-in-out infinite alternate;
}

@keyframes glowLine {
    0% { width: 50px; box-shadow: 0 0 10px rgba(76, 201, 240, 0.5); }
    100% { width: 100px; box-shadow: 0 0 20px rgba(76, 201, 240, 0.8); }
}

#recommendation-text h4 {
    color: var(--accent-blue);
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-shadow: 0 0 8px rgba(67, 97, 238, 0.3);
}

#recommendation-text p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.1);
}

#recommendation-text strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.book-title {
    color: var(--accent-pink);
    font-style: italic;
    position: relative;
    padding: 0 2px;
    transition: all 0.3s ease;
}

.book-title:hover {
    text-shadow: 0 0 8px rgba(247, 37, 133, 0.5);
}

/* Error Display - Enhanced design */
#error-display {
    width: 100%;
    padding: 20px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.error-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.error-message {
    position: relative;
    color: var(--error-color);
    text-align: left;
    padding: 25px;
    border-radius: 16px;
    background: rgba(247, 37, 133, 0.1);
    border: 1px solid rgba(247, 37, 133, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
                0 0 15px rgba(247, 37, 133, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.error-message:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(247, 37, 133, 0.15), transparent 70%);
    pointer-events: none;
}

.error-message h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(247, 37, 133, 0.3);
}

.error-details {
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    font-family: monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text-secondary);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

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

.visually-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Animation Classes */
.slide-to-bottom {
    transform: translateY(calc(100vh - 90px));
}

.zoom-out {
    transform: scale(0.95);
    opacity: 0.9;
}

.zoom-in {
    transform: scale(1);
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.error {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: var(--error-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 
                0 0 0 4px rgba(247, 37, 133, 0.15) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 3.2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .search-container {
        max-width: 90%;
    }
    
    #search-input, #fixed-search-input {
        padding: 18px 60px 18px 25px;
        font-size: 1.1rem;
    }
    
    #fixed-search {
        bottom: 85px;
        padding: 10px 15px;
    }
    
    #recommendation-text {
        padding: 25px;
    }
    
    .logo {
        width: 70px;
    }
    
    .fixed-logo {
        top: 10px;
        right: 15px;
    }
    
    .spinner {
        width: 80px;
        height: 80px;
    }
    
    .footer-content {
        padding: 0 20px;
    }
    
    .footer-left, .footer-right {
        padding: 0 20px;
    }
    
    /* Ensure content has enough bottom padding to prevent footer overlap */
    #content-area {
        padding-bottom: 120px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.4rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    #search-input, #fixed-search-input {
        padding: 16px 55px 16px 20px;
        font-size: 1rem;
        border-radius: 25px;
    }
    
    #search-button, #fixed-search-button {
        width: 42px;
        height: 42px;
        min-width: 40px; /* Ensure minimum touch target size */
        min-height: 40px;
    }
    
    #recommendation-text {
        padding: 20px;
        font-size: 1rem;
    }
    
    #recommendation-text h3 {
        font-size: 1.3rem;
    }
    
    #recommendation-text h4 {
        font-size: 1.15rem;
    }
    
    .logo {
        width: 50px;
    }
    
    .fixed-logo {
        top: 10px;
        right: 10px;
    }
    
    #fixed-search {
        bottom: 75px;
    }
    
    .spinner {
        width: 70px;
        height: 70px;
    }
    
    .loader p {
        font-size: 1rem;
    }
    
    .footer-left, .footer-right {
        padding: 0 15px;
        font-size: 0.8rem;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    /* Better spacing for very small screens */
    #content-area {
        padding-bottom: 100px;
    }
}

/* Fix for small height screens */
@media (max-height: 600px) {
    h1 {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }
    
    .subtitle {
        margin-top: 10px;
    }
    
    #content-area {
        min-height: auto;
        padding-bottom: 100px;
    }
}
