/* /assets/css/style.css */

/* Custom styles */
:root {
    --primary-color: #6366f1; /* indigo-600 */
    --secondary-color: #8b5cf6; /* purple-500 */
    --accent-color: #d946ef; /* fuchsia-500 */

    /* Light Mode */
    --bg-primary: #f9fafb; /* gray-50 */
    --bg-secondary: #ffffff; /* white */
    --text-primary: #1f2937; /* gray-800 */
    --text-secondary: #6b7280; /* gray-500 */
    --border-color: #e5e7eb; /* gray-200 */
    --shadow-color: rgba(0, 0, 0, 0.05); /* light shadow */
    --input-bg: #f3f4f6; /* gray-100 for inputs */
    --input-border: #d1d5db; /* gray-300 for input borders */
    /* RGB values for overlay */
    --bg-primary-rgb: 249, 250, 251;
}

/* Dark Mode */
.dark {
    --bg-primary: #111827; /* gray-900 - Applied to body */
    --bg-secondary: #1f2937; /* gray-800 - Applied to cards/containers */
    --text-primary: #f3f4f6; /* gray-100 - Main text */
    --text-secondary: #9ca3af; /* gray-400 - Muted text */
    --border-color: #374151; /* gray-700 - Borders */
    --shadow-color: rgba(0, 0, 0, 0.3); /* Dark shadow */
    --input-bg: #374151; /* gray-700 for inputs */
    --input-border: #4b5563; /* gray-600 for input borders */
    /* RGB values for overlay */
    --bg-primary-rgb: 17, 24, 39; /* gray-900 RGB */
}

/* Ensure body background uses the correct variable */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Ensure containers explicitly use secondary background and border */
.main-container, .tool-card, .info-card, .test-card, .social-share-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color); /* Add border for consistency */
    color: var(--text-primary);
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
/* Remove border from header/footer main containers if not desired */
header.main-container, footer.main-container {
    border: none; /* Remove border added above specifically for header/footer */
}
/* Ensure social buttons look distinct */
.social-share-btn {
     border: none; /* Social buttons shouldn't have the standard border */
}

.text-muted {
    color: var(--text-secondary);
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    animation: gradient-animation 10s ease infinite;
}

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

.question-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px var(--shadow-color), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-answer {
    transition: all 0.3s;
    border: 1px solid var(--border-color); /* Use 1px border for consistency */
    background-color: var(--bg-secondary);
    color: var(--text-secondary); /* Muted color for non-selected */
}

.btn-answer:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--text-primary); /* Less muted on hover */
}

.btn-answer.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1s ease-in-out;
}

.category-item {
    transition: all 0.3s;
}

.category-item:hover {
    transform: translateX(5px);
}

/* ==========================================
   HEADER / NAVIGATION / UTILITY STYLES
   ========================================== */

header.main-container {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color); /* Add border to header bottom */
}

/* Ensure header actions container is always flex */
header .flex.items-center.space-x-2,
header .flex.items-center.space-x-3 {
    display: flex !important;
    align-items: center;
    gap: 0.5rem; /* Use gap for consistent spacing */
}
@media (min-width: 640px) { /* sm breakpoint */
    header .flex.items-center.space-x-3 {
        gap: 0.75rem;
    }
}

/* Theme toggle and mobile menu button visibility */
#theme-toggle, #mobile-menu-btn, #desktop-search-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 9999px; /* Fully rounded */
    cursor: pointer;
    background-color: transparent;
    color: var(--text-secondary); /* Muted color by default */
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid transparent; /* Placeholder border */
}
#theme-toggle:hover, #mobile-menu-btn:hover, #desktop-search-trigger:hover {
    background-color: var(--border-color); /* Lighter hover background */
    color: var(--text-primary); /* Less muted on hover */
    transform: scale(1.05);
}
#theme-toggle svg, #mobile-menu-btn svg, #desktop-search-trigger svg {
    width: 1.25rem; /* 20px */
    height: 1.25rem;
}

/* Hide mobile menu button on desktop */
@media (min-width: 768px) { /* md breakpoint */
    #mobile-menu-btn {
        display: none !important;
    }
    #desktop-search-trigger {
        display: inline-flex !important; /* Ensure desktop search trigger is visible */
    }
}


/* ==========================================
   MOBILE MENU STYLES
   ========================================== */
/* Mobile menu container - slide in from left */
#mobile-menu {
    position: fixed;
    top: 0;
    left: -100%; /* Start hidden off-screen */
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--bg-secondary);
    transition: left 0.3s ease-in-out;
    z-index: 1000; /* Above overlay */
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    display: flex; /* Use flex for structure */
    flex-direction: column;
}

#mobile-menu.show {
    left: 0; /* Slide in */
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999; /* Below menu */
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile menu navigation links styling */
#mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* Space between links */
}

#mobile-menu nav a {
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: block;
    font-weight: 500;
}

#mobile-menu nav a:hover,
#mobile-menu nav a:active {
    background-color: var(--primary-color);
    color: white !important; /* Ensure text is white on hover */
    transform: translateX(5px);
}

/* Mobile menu header (Title + Close Button) */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-menu-close-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.mobile-menu-close-btn:hover {
    background-color: var(--border-color);
}

/* Search bar within mobile menu */
#mobile-menu #content-search-mobile {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}
#mobile-menu #content-search-mobile::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
#mobile-menu #search-results-mobile {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}
#mobile-menu #search-results-mobile a {
    color: var(--text-primary);
}
#mobile-menu #search-results-mobile a:hover {
    background-color: var(--border-color); /* Match general hover state */
}

/* ==========================================
   DESKTOP FULL-SCREEN SEARCH OVERLAY STYLES
   ========================================== */
.desktop-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use RGB variables for transparency */
    background-color: rgba(var(--bg-primary-rgb), 0.95);
    backdrop-filter: blur(5px);
    z-index: 2000; /* Higher than other overlays */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Add padding-top to push content down slightly */
    padding-top: 10vh;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden; /* Use visibility instead of pointer-events */
}

.desktop-search-overlay.active {
    opacity: 1;
    visibility: visible; /* Show when active */
}

.search-overlay-content {
    width: 100%;
    padding: 1rem;
    max-width: 600px; /* Adjust max width as needed */
    transition: transform 0.3s ease;
    transform: translateY(-20px); /* Start slightly up */
}
.desktop-search-overlay.active .search-overlay-content {
    transform: translateY(0); /* Slide down when active */
}

#content-search-desktop-overlay {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 4px 15px var(--shadow-color);
}

#content-search-desktop-overlay::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

#search-results-desktop-overlay {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 15px var(--shadow-color);
}

#search-results-desktop-overlay a {
    color: var(--text-primary);
}
#search-results-desktop-overlay a:hover {
    background-color: var(--border-color);
}

/* Clear button inside search input */
#clear-desktop-search {
     /* Position adjusted by Tailwind classes */
     color: var(--text-secondary);
}
#clear-desktop-search:hover {
     color: var(--text-primary);
}

/* Removed the separate .close-search-overlay-btn styling */

/* ==========================================
   OTHER COMPONENT STYLES
   ========================================== */

/* Buttons like 100 Questions, 100% Privacy */
/* Let Tailwind handle this directly in the HTML for better control */
/* Example class to add in HTML: status-tag */
.status-tag {
    /* Base styles if needed, but primarily use Tailwind */
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem; /* Adjust padding as needed */
    border-radius: 0.5rem; /* Tailwind: rounded-lg */
    font-weight: 500; /* Tailwind: font-medium */
}

/* Homepage Test Grid */
.all-tests-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .all-tests-grid { grid-template-columns: repeat(2, 1fr); } }
.test-card { display: block; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 0.5rem; background-color: var(--bg-secondary); transition: all 0.3s; }
.test-card:hover { transform: translateY(-4px); box-shadow: 0 4px 10px var(--shadow-color); border-color: var(--primary-color); }
.test-card h3 { font-size: 1.125rem; font-weight: 600; color: var(--primary-color); margin-bottom: 0.5rem; }
.test-card p { font-size: 0.875rem; color: var(--text-secondary); }

/* Static Content Page */
.static-content h1, .static-content h2, .static-content h3 { font-weight: 600; margin-top: 1.5em; margin-bottom: 0.5em; color: var(--text-primary); }
.static-content h1 { font-size: 1.875rem; } /* Reduced h1 size slightly */
.static-content h2 { font-size: 1.5rem; }
.static-content h3 { font-size: 1.25rem; }
@media (min-width: 640px) { /* sm */
    .static-content h1 { font-size: 2.25rem; }
    .static-content h2 { font-size: 1.875rem; }
    .static-content h3 { font-size: 1.5rem; }
}
.static-content p, .static-content ul, .static-content li { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.static-content ul { list-style-type: disc; margin-left: 1.5rem; }
.static-content a { color: var(--primary-color); text-decoration: underline; }

/* New styles for Score Tag and Quote */
.gradient-border-animated { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color)); background-size: 200% 200%; animation: gradient-animation 5s ease infinite; }
figure blockquote { position: relative; padding-left: 1.5rem; padding-right: 1.5rem; }
figure blockquote::before { content: '“'; position: absolute; left: -0.25rem; top: -0.5rem; font-size: 3rem; line-height: 1; color: var(--border-color); z-index: 1; }
figure blockquote::after { content: '”'; position: absolute; right: -0.25rem; bottom: -1rem; font-size: 3rem; line-height: 1; color: var(--border-color); z-index: 1; }
figure figcaption { position: relative; z-index: 2; text-align: right; color: var(--text-secondary); opacity: 0.3; font-size: 0.875rem; margin-top: 0.5rem; }

/* New Special Animated CTA Button */
.cta-special-animated { text-decoration: none; transition: all 0.3s ease; animation: gradient-animation 4s ease infinite, pulse-animation 2s infinite ease-in-out; }
.cta-special-animated:hover { transform: scale(1.03); box-shadow: 0 10px 25px -5px var(--shadow-color), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.cta-inner-bg { background-color: var(--bg-secondary); transition: all 0.3s ease; }
.cta-special-animated:hover .cta-inner-bg { background-color: var(--bg-primary); }
@keyframes pulse-animation { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }


/* ==========================================
   UTILITY & PRINT STYLES
   ========================================== */

/* Print styles */
@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    body { background-color: white; color: black; }
    .max-w-7xl, main { width: 100%; max-width: 100%; padding: 0; }
    .shadow, .shadow-lg, .shadow-md { box-shadow: none !important; }
    .results-grid > div { break-inside: avoid; }
}

.print-only { display: none; }
.print-html-only { display: none; }

/* Styles for forcing light-mode PDF render */
.force-light-render { background-color: #ffffff !important; color: #1f2937 !important; }
.force-light-render * { color: #1f2937 !important; border-color: #e5e7eb !important; }
.force-light-render .text-indigo-600 { color: #6366f1 !important; }
.force-light-render .text-gray-600 { color: #6b7280 !important; }

/* Animation for results reveal */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out forwards; }

/* Customized animated progress bar */
.progress-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color)); background-size: 200% 100%; animation: progress-bar-animation 2s linear infinite; transition: width 0.3s ease-in-out; }
@keyframes progress-bar-animation { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Responsive adjustments */
.results-grid { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }

.social-share-btn { padding: 0.5rem; border-radius: 9999px; transition: all 0.3s; }
.social-share-btn:hover { transform: scale(1.1); }