:root {
    --primary-color: #383bd6;
    --secondary-color: #F5A623;
    --background-color: #1e2024;
    --text-color: #f0f0f0;
    --text-color-muted: #ccc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --modal-bg: #282a2e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 80px 0 20px;
    background-image: linear-gradient(160deg, #1e2024 0%, #32353a 100%);
}

#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 999;
    max-width: 100%;
    border-radius: 0;
    margin-bottom: 0;
    text-align: left;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

#site-header .logo {
    height: 36px;
    width: auto;
    margin-bottom: 0;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.login-btn {
    padding: 8px 24px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.login-btn:hover {
    background-color: #4a4eff;
    box-shadow: 0 0 10px var(--primary-color);
}

#main-header {
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

header {
    text-align: center;
    padding: 30px 40px;
    max-width: 800px;
    width: 100%;
    position: relative;
    background: var(--card-bg);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

header .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

h1 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--primary-color);
    font-size: 2.5rem;
    margin: 0;
}

header .subtitle {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0.25em 0 0.5em;
}

header p {
    font-size: 1.1rem;
    color: var(--text-color-muted);
}

#settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

#settings-btn:hover {
    opacity: 1;
}

#settings-btn img {
    width: 32px;
    height: 32px;
    filter: invert(1) drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

main {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-color-muted);
    pointer-events: none;
}

#audit-form {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    gap: 10px;
}

#url-input {
    width: 100%;
    padding: 20px 160px 20px 50px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
#url-input::placeholder {
    color: var(--text-color-muted);
    opacity: 0.7;
}

#audit-form button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: black;
    background-color: #58f0b1;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: none;
}

#audit-form button:hover {
    background-color: #4edbae;
    box-shadow: 0 0 15px #58f0b1;
}
#audit-form button:disabled {
    cursor: not-allowed;
    background-color: #58f0b1;
    opacity: 0.6;
}

.hidden {
    display: none !important;
}

/* Skeleton Loading Styles */
.skeleton {
    animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: transparent !important;
    user-select: none;
    display: block;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#report {
    width: 100%;
    background: var(--card-bg);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    overflow: hidden;
}

.report-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.report-title-group h2 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    word-break: break-all;
}

.report-title-group .cache-notice {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-color-muted);
    font-style: italic;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

#refresh-audit-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    background-color: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    order: 1;
}

#refresh-audit-btn:hover {
    background-color: rgba(255,255,255,0.2);
}
#refresh-audit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    background-color: rgba(255,255,255,0.1);
}

#share-report-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    order: 0;
}

#share-report-btn:hover {
    background-color: #4a4eff;
    box-shadow: 0 0 8px var(--primary-color);
}

.overall-grade {
    font-size: 4rem;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    order: 2;
}

.grade-A { color: #2ECC71; }
.grade-B { color: #F1C40F; }
.grade-C { color: #E67E22; }
.grade-D { color: #E74C3C; }
.grade-F { color: #C0392B; }

.report-section {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}
.report-section:last-child {
    border-bottom: none;
}

.report-section h3 {
    font-family: 'Poppins', sans-serif;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--primary-color);
}

/* Benchmark Table */
.benchmark-section {
    text-align: center;
}
.benchmark-section p {
    color: var(--text-color-muted);
}
.benchmark-section table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    text-align: center;
    background-color: rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}
.benchmark-section th, .benchmark-section td {
    padding: 12px;
    border: 1px solid var(--border-color);
}
.benchmark-section th {
    background-color: rgba(56, 59, 214, 0.3);
    font-family: 'Poppins', sans-serif;
}
.benchmark-section td:nth-child(2) { /* Your Score column */
    font-weight: bold;
    font-size: 1.2em;
}

.device-previews {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    text-align: center;
    flex-wrap: wrap;
}

.device-preview {
    flex: 1;
    min-width: 200px;
}

.device-preview h4 {
    margin-bottom: 10px;
}

.device-preview img {
    width: 100%;
    max-width: 200px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.1);
}

.tech-stack-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.tech-item {
    background-color: rgba(0,0,0,0.2);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.tech-item:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background-color: rgba(0,0,0,0.15);
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid;
    transition: transform 0.3s, background-color 0.3s;
}
.metric-card:hover {
    transform: translateY(-5px);
    background-color: rgba(0,0,0,0.25);
}

.metric-card h4 {
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.metric-card .score {
    font-weight: bold;
    font-size: 1.2rem;
}

.metric-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color-muted);
    line-height: 1.5;
}

.quick-wins {
    margin-top: 15px;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-color-muted);
    text-align: left;
}

.quick-wins h5 {
    margin: 0 0 8px -20px;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    font-size: 1rem;
}

.quick-wins ul {
    margin: 0;
    padding-left: 20px;
}

.quick-wins li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.ai-clarity-section {
    background-color: rgba(56, 59, 214, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 20px 30px !important; /* Override report-section padding */
}

.ai-clarity-section h3 {
    margin-top: 0;
}

.ai-clarity-section h4 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.ai-clarity-section h4:first-of-type {
    margin-top: 0;
}

.ai-clarity-section p {
    line-height: 1.6;
    color: var(--text-color-muted);
}
.ai-clarity-section a {
    color: var(--secondary-color);
}
.ai-clarity-section .error-text {
    color: #E74C3C;
}

.ai-clarity-section ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 10px;
}

.ai-clarity-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.priority {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.priority-high {
    background-color: #E74C3C; /* Red */
}

.priority-medium {
    background-color: #f39c12; /* Orange */
}

.priority-low {
    background-color: #3498db; /* Blue */
}

/* Sitemap styles */
#sitemap-container {
    width: 100%;
    overflow: hidden; /* Changed from auto to hidden as SVG will handle pan/zoom */
    background-color: rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: height 0.3s ease-in-out;
}
#sitemap-svg {
    display: block;
    margin: auto;
    cursor: grab;
}
#sitemap-svg:active {
    cursor: grabbing;
}
#sitemap-svg path {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1.5px;
}
#sitemap-svg circle {
    stroke: var(--background-color);
    stroke-width: 1.5px;
    cursor: pointer;
}
#sitemap-svg text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    fill: var(--text-color);
    paint-order: stroke;
}

.upsell-section {
    background: linear-gradient(135deg, rgba(88, 240, 177, 0.1), rgba(88, 240, 177, 0.05));
    border-top: 1px solid var(--border-color);
    margin-top: -1px; /* To avoid double border with section above */
    padding: 30px !important; /* Override report-section padding */
    text-align: center;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.upsell-section h3 {
    color: #58f0b1;
    text-shadow: 0 0 10px rgba(88, 240, 177, 0.7);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.upsell-section p {
    max-width: 600px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.upsell-section .consultation-btn,
.upsell-section .consultation-btn:hover,
.upsell-section .consultation-btn:disabled {
    background-color: #58f0b1;
    color: #121212;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 59, 214, 0.4);
    text-shadow: none;
    width: 100%;
}

.upsell-section .consultation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(56, 59, 214, 0.6);
}

#promo-code-container {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
#promo-code-container p {
    font-size: 0.9rem;
    color: var(--text-color-muted);
    margin-bottom: 10px;
}
#promo-code-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}
#promo-code-input {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    width: 160px;
    font-size: 0.95rem;
}
#apply-promo-btn {
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    background: var(--secondary-color);
    color: var(--background-color);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
#apply-promo-btn:hover {
    background-color: #f5b94b;
}

#error-message {
    background-color: #fbeae5;
    color: #c0392b;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e74c3c;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: rgba(192, 57, 43, 0.3);
}

/* Recent Audits Grid */
#recent-audits-grid {
    width: 100%;
    margin-top: 40px;
    overflow: hidden; /* Prevent cards from showing outside bounds during animation */
}

#recent-audits-grid h2 {
    font-family: 'Poppins', sans-serif;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--text-color);
    text-shadow: 0 0 8px rgba(56, 59, 214, 0.5);
}

.recent-audits-container {
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 40vh;
    max-height: 450px;
    perspective: 1500px;
    transform-style: preserve-3d;
    margin-top: 20px;
    padding: 20px 0;
}

.recent-audit-card {
    position: absolute;
    bottom: 20px;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s, filter 0.6s;
    cursor: pointer;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px var(--shadow-color);
    will-change: transform, opacity, filter;
    filter: brightness(0.7) blur(2px);
}

.recent-audit-card.active {
    filter: brightness(1) blur(0px);
    cursor: default;
}

.recent-audit-card:not(.active):hover {
    filter: brightness(1) blur(0px);
    z-index: 11; /* Bring to front on hover */
    transform: var(--transform-original) scale(1.05) !important;
}

.recent-audit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.recent-audit-card:hover .recent-audit-overlay,
.recent-audit-card.active .recent-audit-overlay {
    opacity: 1;
}

.recent-audit-overlay h4 {
    margin: 0 0 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    word-break: break-all;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s 0.1s, opacity 0.4s 0.1s;
}

.recent-audit-card:hover .recent-audit-overlay h4,
.recent-audit-card.active .recent-audit-overlay h4 {
    transform: translateY(0);
    opacity: 1;
}

.view-report-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s 0.2s, transform 0.4s 0.2s;
    text-decoration: none;
    display: inline-block;
}

.recent-audit-card.active .view-report-btn {
    opacity: 1;
    transform: translateY(0);
}

.view-report-btn:hover {
    background-color: #4a4eff;
    transform: translateY(-2px) !important;
}

/* --- Modal Styles --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Black overlay at 50% opacity */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--modal-bg);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    position: relative;
    text-align: center;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
}

.modal-content p {
    color: var(--text-color-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-content .close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-content .close-button:hover {
    opacity: 1;
}

.modal-content .price {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.modal-content .consultation-btn,
.modal-content #checkout-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 59, 214, 0.4);
    text-shadow: none;
    width: 100%;
}

.modal-content .consultation-btn:hover,
.modal-content #checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(56, 59, 214, 0.6);
}

/* Admin Nav Bar */
#admin-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #111;
    border-bottom: 1px solid #333;
    z-index: 1000; /* Higher than site-header */
    display: flex;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.admin-nav-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav-content span {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.admin-nav-content a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.admin-nav-content a:hover {
    color: var(--text-color-muted);
}

.version-selector-wrapper {
    margin-top: 15px;
}
.version-selector-wrapper label {
    font-size: 0.9rem;
    color: var(--text-color-muted);
    margin-right: 10px;
}
.version-selector-wrapper select {
    padding: 5px 10px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.api-key-link {
    font-size: 0.9em;
    margin: 2px 0 10px 0;
    text-align: right;
}

#api-key-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
    text-align: left;
}

#api-key-form input[type="password"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    color: var(--text-color);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    body {
        padding-top: 70px; /* Adjust for site header */
        padding-left: 0;
        padding-right: 0;
    }

    #site-header {
        padding: 0 20px;
    }

    .logo-text {
        display: none;
    }
    
    header, #report, #recent-audits-grid, .auth-container, #report-list-container, #user-list-container, .setup-container {
        margin-left: 15px;
        margin-right: 15px;
        width: auto; /* Let it shrink */
        max-width: none;
        box-sizing: border-box;
    }

    header {
        padding: 25px 20px;
    }

    h1, header .subtitle {
        font-size: 2rem;
    }

    main {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    #audit-form {
        padding: 0 15px;
    }

    #url-input {
        width: 100%;
        padding: 18px 20px 18px 50px;
        margin-bottom: 15px;
    }

    #audit-form button {
        position: static;
        transform: none;
        width: 100%;
        padding: 15px 20px;
    }

    .search-icon {
        top: 20px;
        transform: none;
    }

    #settings-btn {
        top: 15px;
        right: 15px;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .report-actions {
        width: 100%;
        justify-content: space-between;
    }

    .report-section {
        padding: 20px;
    }
    
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .device-previews {
        flex-direction: column;
        align-items: center;
    }

    .recent-audits-container {
        min-height: 35vh;
        perspective: 1000px;
    }
    
    .recent-audit-card {
        max-width: 85vw;
    }
    
    #admin-nav-bar {
        padding: 0 15px;
        justify-content: center;
    }
    
    .admin-nav-content {
        gap: 15px;
        overflow-x: auto;
    }

    .modal-content {
        padding: 20px;
        margin: 15px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px;
    }
}


/* --- Light Mode --- */
@media (prefers-color-scheme: light) {
    :root {
        --background-color: #f4f6f8;
        --text-color: #121212;
        --text-color-muted: #555555;
        --card-bg: rgba(255, 255, 255, 0.75);
        --border-color: rgba(0, 0, 0, 0.1);
        --shadow-color: rgba(0, 0, 0, 0.1);
        --modal-bg: #ffffff;
    }

    body {
        background-image: linear-gradient(160deg, #f9f9f9 0%, #e8eaf6 100%);
    }

    h1,
    .report-section h3 {
        color: var(--text-color);
        text-shadow: none;
    }

    #admin-nav-bar {
        background-color: #e8eaf6;
        border-bottom-color: var(--primary-color);
    }
    
    .admin-nav-content a {
        color: var(--text-color-muted);
    }

    .admin-nav-content a:hover {
        color: var(--text-color);
    }
    
    #url-input {
        background: #fff;
        border-color: #ccc;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    }
    #url-input::placeholder {
        color: #999;
        opacity: 1;
    }
    
    .spinner {
        border: 8px solid #e0e0e0;
        border-top: 8px solid var(--primary-color);
    }

    #report {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    #error-message {
        background-color: rgba(192, 57, 43, 0.1);
    }
    
    .benchmark-section table {
        background-color: rgba(0,0,0,0.02);
    }
    .benchmark-section th {
        background-color: rgba(56, 59, 214, 0.1);
    }

    .device-preview img {
        background-color: #fff;
    }

    .metric-card {
        background-color: rgba(0,0,0,0.03);
    }
    .metric-card:hover {
        background-color: rgba(0,0,0,0.06);
    }

    .ai-clarity-section {
        background-color: rgba(56, 59, 214, 0.05) !important;
    }
    
    .upsell-section {
        background: linear-gradient(135deg, rgba(88, 240, 177, 0.2), rgba(88, 240, 177, 0.1));
    }

    .upsell-section h3 {
        color: #2b7a78; /* A darker teal/green for light mode */
        text-shadow: none;
    }
    
    .upsell-section .consultation-btn:hover {
        box-shadow: 0 6px 20px rgba(88, 240, 177, 0.7);
    }

    #settings-form input {
        background: rgba(255,255,255,0.8);
        border-color: #ccc;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
    }

    #settings-form input::placeholder {
        color: var(--text-color-muted);
        opacity: 0.7;
    }
}