/* --- 1. Style Guide & Variables --- */
:root {
    --primary-blue: #2B6CB0;
    --primary-blue-darker: #2C5282;
    --background-white: #FFFFFF;
    --background-light: #F7FAFC;
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --border-color: #E2E8F0;
    --status-success: #38A169;
    --status-error: #E53E3E;
    --status-warning: #DD6B20;
    --font-family: 'Inter', sans-serif;
}
/* --- 2. General Body & Reset --- */
body { margin: 0; font-family: var(--font-family); background-color: var(--background-light); color: var(--text-primary); }
a { text-decoration: none; color: inherit; transition: color 0.2s ease-in-out; }
button { font-family: inherit; cursor: pointer; }


/* --- 4. Main Content & Analysis Form --- */
.page-content { max-width: 1320px; margin: 2rem auto; padding: 0 1.5rem; }
.analysis-form-container { background-color: var(--background-white); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; margin-bottom: 2rem; }
.analysis-form-container h1 { margin-top: 0; }
.analysis-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.form-inputs { display: flex; gap: 1rem; }
.form-inputs input { width: 100%; }
.analysis-form input { flex-grow: 1; padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 1rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.analysis-form input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2); }
.analysis-form button { padding: 0.8rem 1.5rem; background-color: var(--primary-blue); color: var(--background-white); border: none; border-radius: 6px; font-weight: 500; font-size: 1rem; transition: background-color 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.analysis-form button:hover { background-color: var(--primary-blue-darker); }
.analysis-form button:disabled { background-color: var(--primary-blue-darker); cursor: not-allowed; }
.progress-container { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.progress-bar-wrapper { width: 100%; background-color: var(--border-color); border-radius: 10px; overflow: hidden; height: 12px; }
.progress-bar { height: 100%; width: 0%; border-radius: 10px; transition: width 0.5s ease-in-out; background: linear-gradient(90deg, var(--primary-blue), #63b3ed); }
.progress-text-wrapper { display: flex; align-items: center; justify-content: center; gap: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.progress-icon { animation: spin 2s linear infinite; }

/* --- 5. Results Styling --- */
.results-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;}
.results-header h2 { margin: 0; flex-grow: 1; font-size: 1.5rem; }
.results-container h2 a { color: var(--primary-blue); text-decoration: none; word-break: break-all; }
.results-container h2 a:hover { text-decoration: underline; }
.btn-download-pdf { display: inline-flex; align-items: center; gap: 0.5rem; background-color: var(--primary-blue); color: var(--background-white); padding: 0.6rem 1.2rem; border-radius: 6px; font-weight: 500; text-decoration: none; transition: background-color 0.2s; white-space: nowrap; }
.btn-download-pdf:hover { background-color: var(--primary-blue-darker); }
.btn-download-pdf svg { width: 18px; height: 18px; }
.result-card.error { background-color: #FFF5F5; border-left: 4px solid var(--status-error); padding: 1.5rem; border-radius: 8px; }
.result-card.error h3 { color: #C53030; margin-top: 0;}

/* --- 5a. Score Bar, Checklist, and Mobile Snapshot --- */
.summary-grid-3col { display: grid; grid-template-columns: 300px 1fr 220px; gap: 2rem; margin-bottom: 2rem; background-color: var(--background-white); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.seo-score-container h3, .checklist-container h3, .mobile-snapshot-container h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 1rem; color: var(--text-primary); }
.score-bar-wrapper { width: 100%; height: 12px; background-color: var(--border-color); border-radius: 6px; overflow: hidden; margin-bottom: 0.5rem; }
.score-bar-progress { width: 0%; height: 100%; border-radius: 6px; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); background-size: 200% 100%; animation: gradient-flow 3s ease infinite; }
.score-bar-progress.score-good { background: linear-gradient(90deg, #2d8a5f, var(--status-success)); }
.score-bar-progress.score-average { background: linear-gradient(90deg, #c55a1b, var(--status-warning)); }
.score-bar-progress.score-bad { background: linear-gradient(90deg, #c03232, var(--status-error)); }
@keyframes gradient-flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.score-text { display: flex; align-items: baseline; gap: 0.25rem; }
.score-value { font-size: 2.2rem; font-weight: 700; color: var(--text-primary); }
.score-label { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.checklist-container { display: flex; gap: 2rem; }
.checklist-column { flex: 1; }
.checklist-container ul { margin: 0; padding: 0; list-style: none; }
.checklist-container li { margin-bottom: 0.5rem; color: var(--text-secondary); }
.checklist-container h3 { border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.mobile-snapshot-container .snapshot-image-wrapper { border: 4px solid #333; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.mobile-snapshot-container img { display: block; width: 100%; height: auto; }
.mobile-snapshot-container .snapshot-error { font-size: 0.9rem; color: var(--text-secondary); }

/* --- 5b. Results Table Styling --- */
.results-table-container { background-color: var(--background-white); padding: 0; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); overflow-x: auto; margin-top: 1.5rem;}
.results-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.results-table th, .results-table td { text-align: left; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); vertical-align: middle;}
.results-table thead th { color: var(--text-secondary); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.results-table tbody tr:last-child td { border-bottom: none; }
.validator-link { display: inline-block; margin-left: 0.5rem; font-weight: 700; color: var(--primary-blue); text-decoration: none; font-size: 0.9em; }
.validator-link:hover { text-decoration: underline; }

/* IMPROVED Status Pills with Icons */
.status-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.75rem; border-radius: 16px; font-weight: 700; font-size: 0.85rem; }
.status-pill::before { content: ''; display: inline-block; width: 14px; height: 14px; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; background-color: currentColor; }
.status-pill.good { background-color: #e6f6eb; color: #2a6f44; }
.status-pill.good::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E"); }
.status-pill.bad { background-color: #fdeaea; color: #a52828; }
.status-pill.bad::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E"); }
.status-pill.info { background-color: #eef2f7; color: #516273; }
.status-pill.info::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3C/svg%3E"); }
.status-pill.average {
    background-color: #fffaf0; /* A light orange background */
    color: #b45309; /* A darker orange text */
}

.status-pill.average::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2V7h2v7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2V7h2v7z'/%3E%3C/svg%3E");
}


/* Mobile Snapshot Container Fix */
.mobile-snapshot-container {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 1.5rem;
}
.mobile-snapshot-container h3 {
    margin-top: 0;
    text-align: center;
}
.snapshot-image-wrapper {
    max-width: 175px; /* Set a max width for the container */
    margin: 0 auto; /* Center it */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Hide anything that spills out */
}
.snapshot-image-wrapper img {
    width: 100%;
    display: block; /* Remove bottom space under image */
}
.snapshot-error {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Checklist Icon Styling */
.checklist-container h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}
.checklist-icon {
    width: 20px;
    height: 20px;
}
.checklist-icon.passed {
    color: var(--status-success);
}
.checklist-icon.failed {
    color: var(--status-error);
}

/* --- 9. NEW History Page Styling --- */

.history-page-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--background-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.history-page-container h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.history-page-container p {
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background-color: var(--background-light);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.history-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody td a {
    font-weight: 500;
    color: var(--primary-blue);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s;
}

.history-table tbody td a:hover {
    text-decoration-color: var(--primary-blue);
}

.history-score-pill {
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
    color: #fff;
    display: inline-block;
}
.history-score-pill.score-good { background-color: var(--status-success); }
.history-score-pill.score-average { background-color: var(--status-warning); }
.history-score-pill.score-bad { background-color: var(--status-error); }

.alert.alert-info {
    background-color: #EBF8FF;
    border-color: #90CDF4;
    color: #2C5282;
}
.alert.alert-info a {
    color: #2B6CB0;
    font-weight: 700;
}

/* --- 10. NEW & IMPROVED History Panel Design --- */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.history-item {
    border-bottom: 1px solid var(--border-color);
}
.history-item:last-child {
    border-bottom: none;
}
.history-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0.5rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
}
.history-item a:hover {
    background-color: var(--background-light);
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* This is important to prevent the left side from growing too large */
    min-width: 0;
}

.history-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0; /* Prevents the icon from shrinking */
}

.history-url-wrapper {
    min-width: 0;
}

.history-url {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if the URL is too long */
}

.history-score {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.3rem 0.75rem;
    border-radius: 16px; /* Pill shape */
    color: #fff;
    flex-shrink: 0; /* Prevents the score from shrinking */
    margin-left: 1rem;
}

.history-score.score-good { background-color: var(--status-success); }
.history-score.score-average { background-color: var(--status-warning); }
.history-score.score-bad { background-color: var(--status-error); }

/* This is the prompt for guest users */
.guest-history-prompt {
    margin-top: 1rem;
    padding: 0.75rem;
    text-align: center;
    background-color: #ebf8ff;
    border-radius: 6px;
}
.guest-history-prompt a {
    color: var(--primary-blue);
    font-weight: 700;
    text-decoration: none;
}
.guest-history-prompt a:hover {
    text-decoration: underline;
}
/* --- 11. NEW & IMPROVED Dashboard Layout Styling --- */

/* Main Dashboard Page Layout */
.dashboard-page {
    display: flex;
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    gap: 2rem;
}
.dashboard-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 1rem;
    align-self: flex-start;
}
.dashboard-content {
    flex-grow: 1;
}

/* Sidebar Header & User Avatar */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: var(--background-white);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 700;
}
.user-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.user-info span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Sidebar Navigation */
.dashboard-nav {
    margin-top: 1rem;
}
.nav-section-title {
    display: block;
    padding: 1rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dashboard-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    margin: 0.25rem 0;
    border-radius: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.2s, color 0.2s;
}
.dashboard-nav li a:hover {
    background-color: var(--background-light);
    color: var(--text-primary);
}
.dashboard-nav li a.active {
    background-color: var(--primary-blue);
    color: var(--background-white);
}
.dashboard-nav li a .feather {
    width: 20px;
    height: 20px;
}

/* Dashboard Content Area */
.content-header { margin-bottom: 2rem; }
.content-header h1 { margin-bottom: 0.25rem; }
.content-header p { margin-top: 0; color: var(--text-secondary); font-size: 1.1rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card { background-color: var(--background-white); padding: 1.5rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 1.5rem; }
.stat-card .feather { width: 32px; height: 32px; color: var(--primary-blue); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); display: block; }
.stat-label { font-size: 0.9rem; color: var(--text-secondary); }

/* Recent Activity & History Table */
.recent-activity { background-color: var(--background-white); padding: 1.5rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.recent-activity h3 { margin-top: 0; }
.view-all-history { text-align: right; margin-top: 1rem; }
.view-all-history a { font-weight: 700; color: var(--primary-blue); }

/* Responsive for Dashboard */
@media (max-width: 900px) {
    .dashboard-page {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        box-sizing: border-box;
    }
}

/* --- 12. Profile Settings Enhancements --- */
.settings-container {
    background-color: var(--background-white);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem; /* Space between cards */
}
.settings-container h3 {
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.settings-form {
    max-width: 500px;
    margin-top: 1.5rem;
}
.delete-zone {
    border: 2px solid var(--status-error);
}
.delete-zone h3 {
    color: var(--status-error);
}
.delete-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.btn-danger {
    background-color: var(--status-error);
}
.btn-danger:hover {
    background-color: #c53030; /* Darker red */
}

/* --- 12. NEW Password Reset & Profile Settings --- */

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.auth-form .form-footer {
    text-align: right;
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
}

.auth-form .form-footer a {
    font-size: 0.9rem;
    color: var(--primary-blue);
    text-decoration: underline;
}

.settings-container {
    background-color: var(--background-white);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.settings-container h3 {
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-form {
    max-width: 500px;
    margin-top: 1.5rem;
}

/* --- NEW IMPROVED & CORRECTED Status Pills with Icons --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap; /* Prevents text wrapping */
}

/* This ::before pseudo-element creates the icon */
.status-pill::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor; /* The icon takes the color of the text */
}

/* Good Status (Checkmark) */
.status-pill.good, .status-pill.score-good {
    background-color: #e6f6eb;
    color: #2a6f44;
}
.status-pill.good::before, .status-pill.score-good::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
}

/* Bad Status (Cross) */
.status-pill.bad, .status-pill.score-bad {
    background-color: #fdeaea;
    color: #a52828;
}
.status-pill.bad::before, .status-pill.score-bad::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E");
}

/* Info / Average Status (Info icon) */
.status-pill.info, .status-pill.score-average {
    background-color: #eef2f7;
    color: #516273;
}
.status-pill.info::before, .status-pill.score-average::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3C/svg%3E");
}

    /* --- 13. NEW Comparison Feature Styling --- */
.history-form {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.history-table .select-col {
    width: 80px;
    text-align: center;
}
.history-table input[type="checkbox"] {
    transform: scale(1.4);
    accent-color: var(--primary-blue);
}

.history-actions {
    margin-top: 1.5rem;
    text-align: right;
}

/* Comparison Table */
.comparison-table-container {
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}
.comparison-table th, .comparison-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}
.comparison-table thead th {
    background-color: var(--background-light);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comparison-table thead th a {
    color: var(--primary-blue);
    text-decoration: underline;
}
.comparison-table tbody td:first-child {
    font-weight: 500;
    width: 25%;
}
.comparison-table tbody td {
    line-height: 1.6;
    color: var(--text-secondary);
}
.comparison-table .score-row td {
    font-size: 1.2rem;
    font-weight: 700;
}


/* --- 14. NEW Integrated Admin Dashboard Styling --- */

/* Link in header */
.main-nav .admin-link a {
    color: var(--status-warning);
    font-weight: 700;
}
.main-nav .admin-link a:hover,
.main-nav .admin-link a.active {
    border-bottom-color: var(--status-warning);
}

/* Main container for the admin page */
.admin-dashboard-container {
    background-color: var(--background-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.admin-table-container {
    margin-top: 2.5rem;
}
.admin-table-container h3 {
    margin-bottom: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th,
.admin-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.admin-table thead th {
    background-color: var(--background-light);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- 15. NEW Site Audit Crawler Styling --- */

.crawl-status {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 2rem;
}
.crawl-status h3 {
    margin-top: 0;
}
.crawl-status p {
    line-height: 1.6;
    color: var(--text-secondary);
}
.status-pill.status-pending,
.status-pill.status-running {
    background-color: var(--status-warning);
    color: #fff;
}
.status-pill.status-completed {
    background-color: var(--status-success);
    color: #fff;
}
.history-table td ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--status-error);
}

/* --- 17. NEW Crawler History List Styling --- */

.crawl-history-section {
    margin-top: 2.5rem;
}

.crawl-history-section h2 {
    margin-bottom: 1.5rem;
}

.crawl-status {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem; /* Space between each crawl job card */
}

/* Toggle for viewing results */
.crawl-results-toggle {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.crawl-results-toggle summary {
    font-weight: 700;
    color: var(--primary-blue);
    cursor: pointer;
    list-style: revert; /* Use default triangle marker */
}

.crawl-results-toggle .history-table-container {
    margin-top: 1rem;
}

/* --- 16. NEW Crawler Page Enhancements --- */

.crawl-form {
    max-width: none; /* Override default settings-form width */
}
.bulk-title {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.crawl-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

.crawl-status-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}
.crawl-actions {
    display: flex;
    gap: 0.75rem;
}
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s;
}
.btn-action:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}
.btn-action.delete:hover {
    color: var(--status-error);
    border-color: var(--status-error);
    background-color: #fdeaea;
}
.btn-action .feather {
    width: 20px;
    height: 20px;
}

.history-table .issues-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--status-error);
    font-size: 0.85rem;
}
.status-pill.status-failed {
    background-color: var(--status-error);
    color: #fff;
}

/* --- 17. NEW Crawler Dashboard & Info Styling --- */
.crawl-dashboard {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.crawl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
/* We can reuse the .stat-card styles from the main dashboard */
.crawl-dashboard .stat-card {
    padding: 1.25rem;
    gap: 1rem;
}
.crawl-dashboard .stat-card .feather {
    width: 28px;
    height: 28px;
}
.crawl-dashboard .stat-value { font-size: 1.8rem; }

.issue-summary-card {
    background-color: var(--background-light);
    border-radius: 6px;
    padding: 1.5rem;
}
.issue-summary-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.no-issues-found {
    color: var(--status-success);
    font-weight: 500;
}
.issue-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.issue-summary-list > li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}
.issue-summary-list > li:last-child {
    border-bottom: none;
}
.issue-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.issue-text {
    font-weight: 500;
}
.issue-count {
    background-color: var(--status-error);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

/* --- 18. NEW Issue Accordion Styling --- */

.issue-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.accordion-item {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: box-shadow 0.2s;
}
.accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}
.accordion-header .issue-text {
    flex-grow: 1;
    font-weight: 700;
    color: var(--text-primary);
}
.accordion-header .issue-count {
    background-color: var(--status-error);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}
.accordion-header .accordion-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease-in-out;
}
.accordion-item.active .accordion-header .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding: 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.accordion-item.active .accordion-content {
    /* Set a large max-height to allow content to expand fully */
    max-height: 1000px;
    padding: 0 1.5rem 1.5rem;
}
.accordion-content h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}
.accordion-content p {
    margin-top: 0;
}
.affected-urls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}
.affected-urls ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}
.affected-urls a {
    color: var(--primary-blue);
    word-break: break-all;
}

/* --- 19. NEW Crawler Full Report Spacing --- */

.full-report-container {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.full-report-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}


/* --- 5a. NEW, PROFESSIONAL Score Bar Design --- */
.seo-score-container {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}
.score-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.score-text {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}
.score-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}
.score-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.score-bar-wrapper {
    width: 100%;
    height: 12px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.score-bar-progress {
    width: 0%; /* JS will animate this from the style attribute */
    height: 100%;
    border-radius: 6px;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
}
.score-bar-progress.score-good { background: linear-gradient(90deg, #2d8a5f, var(--status-success)); }
.score-bar-progress.score-average { background: linear-gradient(90deg, #c55a1b, var(--status-warning)); }
.score-bar-progress.score-bad { background: linear-gradient(90deg, #c03232, var(--status-error)); }
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Rank Tracker Styling --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.project-card { display: block; background-color: var(--background-white); padding: 1.5rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 8px}

/* --- 6. STUNNING & MODERN Footer Design --- */

.stunning-footer {
    background-color: #1a202c; /* Charcoal background */
    color: #a0aec0; /* Light gray text */
    padding: 5rem 1.5rem 2rem;
    margin-top: 4rem;
}
.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Main Footer Section (Brand + Links) */
.footer-main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid #2d3748; /* Subtle separator */
}

.footer-brand .footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--background-white);
    margin: 0 0 1rem;
}
.footer-brand p {
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 350px;
}
.footer-newsletter label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--background-white);
}
.newsletter-input-group {
    display: flex;
    position: relative;
}
.newsletter-input-group input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem;
    border: 1px solid #4a5568;
    background-color: #2d3748;
    color: var(--background-white);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.newsletter-input-group input:focus {
    border-color: var(--primary-blue);
}
.newsletter-input-group button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background-image: linear-gradient(45deg, var(--primary-blue), #63b3ed);
    color: var(--background-white);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.newsletter-input-group button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.4);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.footer-column h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--background-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-column a {
    transition: color 0.2s;
}
.footer-column a:hover {
    color: var(--background-white);
}

/* Bottom Bar (Copyright + Social) */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-copyright {
    font-size: 0.9rem;
}
.footer-legal-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}
.footer-legal-links a:hover {
    color: var(--background-white);
    text-decoration: underline;
}
.footer-social-links {
    display: flex;
    gap: 0.5rem;
}
.footer-social-links a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2d3748;
    color: #a0aec0;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.footer-social-links a:hover {
    background-color: var(--primary-blue);
    color: var(--background-white);
    transform: translateY(-3px);
}

/* Footer Responsive Adjustments */
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .footer-brand {
        text-align: center;
    }
    .footer-brand p {
        margin-left: auto;
        margin-right: auto;
    }
    .newsletter-input-group {
        max-width: 400px;
        margin: 0 auto;
    }
}
@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: 1fr 1fr;
        text-align: center;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
    }
}
/* --- NEW Instant URL Feedback Styling --- */
.url-feedback {
    min-height: 24px; /* Prevents layout shift */
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.url-feedback.checking {
    color: var(--text-secondary);
}
.url-feedback.success {
    color: var(--status-success);
}
.url-feedback.error {
    color: var(--status-error);
}


/* --- NEW Collapsible Report Section Styling --- */

.collapsible-report-section {
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.collapsible-report-section summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    list-style: none; /* Hide default triangle */
}
/* This removes the annoying focus outline in Chrome */
.collapsible-report-section summary:focus {
    outline: none;
}
.collapsible-report-section summary::-webkit-details-marker {
    display: none; /* Hide default triangle in Safari */
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.summary-title h3 {
    margin: 0;
    font-size: 1.2rem;
}
.summary-title .feather {
    color: var(--primary-blue);
}

.summary-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.summary-arrow {
    transition: transform 0.3s ease;
}
/* When the <details> element is open, rotate the arrow */
.collapsible-report-section details[open] > summary .summary-arrow {
    transform: rotate(180deg);
}

/* The link inspector now lives inside the collapsible section */
.collapsible-report-section .link-inspector-container {
    box-shadow: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
}

/* --- NEW "LINK INSPECTOR" Accordion Design --- */

.link-inspector-container {
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Tab Styles (Unchanged but included for completeness) */
.link-inspector-tabs { display: flex; background-color: var(--background-light); border-bottom: 1px solid var(--border-color); }
.tab-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 1rem 1.5rem; font-size: 1rem; font-weight: 600; color: var(--text-secondary); background: none; border: none; cursor: pointer; border-bottom: 3px solid transparent; transition: color 0.2s, border-color 0.2s; }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); }
.tab-btn .feather { width: 18px; height: 18px; }

/* Tab Content */
.tab-content { display: none; padding: 1.5rem; }
.tab-content.active { display: block; }

/* Link Accordion Styles */
.link-accordion { display: flex; flex-direction: column; gap: 0.75rem; }
.link-accordion-item {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: box-shadow 0.2s;
}
.link-accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.link-card-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.link-summary { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.link-icon { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }
.link-anchor { font-weight: 600; font-size: 1rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.link-summary-status { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.follow-status { font-weight: 600; padding: 0.3rem 0.6rem; font-size: 0.8rem; border-radius: 4px; }
.follow-status.dofollow { color: var(--status-success); background-color: #e6f6eb; }
.follow-status.nofollow { color: var(--status-warning); background-color: #fffaf0; }
.accordion-icon { width: 20px; height: 20px; color: var(--text-secondary); transition: transform 0.3s ease; }
.link-accordion-item.active .accordion-icon { transform: rotate(180deg); }

.link-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 1rem;
    color: var(--text-secondary);
}
.link-accordion-item.active .link-card-details {
    max-height: 200px; /* Large enough to fit content */
    padding: 0 1rem 1rem;
}
.detail-row {
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.detail-row strong { color: var(--text-primary); font-size: 0.85rem; }
.detail-row a { color: var(--primary-blue); word-break: break-all; font-size: 0.9rem; }

.no-links-found {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* --- NEW Link Stat Cards Styling --- */
.link-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}
.link-stat-card {
    background-color: var(--background-white);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border-color);
}
.link-stat-card .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}
.link-stat-card .stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.link-stat-card .stat-label.dofollow {
    color: var(--status-success);
}
.link-stat-card .stat-label.nofollow {
    color: var(--status-warning);
}

/* --- NEW Static Page Styling (Pricing, Features, About) --- */

.static-page .page-header {
    text-align: center;
    max-width: 700px;
    margin: 2rem auto 4rem;
}
.static-page .page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.static-page .page-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.price { font-size: 2.5rem; font-weight: 700; margin: 1rem 0; color: var(--text-primary); }
.price span:first-child { font-size: 1.5rem; vertical-align: super; color: var(--text-secondary); margin-right: 4px; }
.price span:last-child { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.desc { color: var(--text-secondary); font-size: 0.9rem; }
.features-list { list-style: none; padding: 2rem; margin: 0; flex-grow: 1; display: flex; flex-direction: column; gap: 1rem; }
.features-list li { display: flex; align-items: center; gap: 0.75rem; }
.features-list .feather-check { color: var(--status-success); }
.features-list .feather-x { color: var(--status-error); }


/* Features Page */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.feature-card {
    background-color: var(--background-white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}
.feature-icon {
    display: inline-flex;
    width: 60px; height: 60px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(45deg, #ebf8ff, #dbeafe);
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}
.feature-icon .feather { width: 28px; height: 28px; }
.feature-card h3 { margin-top: 0; font-size: 1.25rem; }
.feature-card p { color: var(--text-secondary); line-height: 1.6; }

/* About Page */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--background-white);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    line-height: 1.7;
}
.about-content h3 { margin-top: 2rem; }
.about-content ul { padding-left: 1.5rem; }

/* --- NEW "Live Analysis" Loading Screen Design --- */

.analysis-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}
.loading-card {
    width: 100%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.loading-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.loading-spinner-wrapper {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    position: relative;
}
.loading-spinner-arc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-blue);
    animation: spin 1s linear infinite;
}
.loading-title-group h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}
.loading-title-group p {
    margin: 0;
    color: var(--text-secondary);
}
.progress-bar-wrapper {
    margin-bottom: 1.5rem; /* Space between bar and checklist */
}
.progress-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.checklist-icon {
    width: 20px;
    height: 20px;
    transition: color 0.3s;
}
.checklist-icon.pending {
    color: var(--text-secondary);
}
.checklist-icon.complete {
    color: var(--status-success);
}
.checklist-text {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
}
.checklist-text.complete {
    color: var(--text-primary);
}

/* --- NEW, PROFESSIONAL Homepage Design --- */

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

/* Hero Section */
.hero-section { padding: 4rem 1.5rem; text-align: center; }
.hero-content { max-width: 1100px; margin: 0 auto; }
.hero-content h1 { font-size: 3rem; line-height: 1.2; }
.hero-content p { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }

.analysis-form-wrapper {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px; padding: 1.5rem; box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.analysis-form { display: flex; align-items: center; gap: 1rem; }
.form-inputs { display: flex; flex-grow: 1; gap: 1rem; }
.input-group { position: relative; flex: 1 1 50%; }
.input-group .feather { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); width: 20px; }
.analysis-form input { width: 100%; padding: 1rem 1rem 1rem 3.25rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; box-sizing: border-box; }

/* How It Works Section */
.how-it-works { padding: 4rem 0; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step-card { text-align: center; }
.step-number { font-size: 0.9rem; font-weight: 700; color: var(--primary-blue); margin-bottom: 1rem; }
.step-icon { display: inline-flex; width: 60px; height: 60px; border-radius: 50%; align-items: center; justify-content: center; background-image: linear-gradient(45deg, #ebf8ff, #dbeafe); color: var(--primary-blue); margin-bottom: 1.5rem; }
.step-icon .feather { width: 28px; height: 28px; }
.step-card h3 { margin-top: 0; }
.step-card p { color: var(--text-secondary); line-height: 1.6; }

/* Testimonials Section */
.testimonials-section { padding: 4rem 0; background-color: #f8fafc; }
.testimonials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.testimonial-card {
    background-color: var(--background-white); padding: 2rem;
    border-radius: 12px; border: 1px solid var(--border-color);
}
.testimonial-card p { font-size: 1.1rem; line-height: 1.7; margin: 0 0 1.5rem 0; font-style: italic; }
.author-info { display: flex; align-items: center; gap: 1rem; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background-color: var(--border-color); color: var(--text-primary); display: grid; place-items: center; font-weight: 600; }
.author-details strong { display: block; color: var(--text-primary); }
.author-details span { color: var(--text-secondary); font-size: 0.9rem; }

/* Features Section */
.features-section { padding: 4rem 0; }
.features-grid { /* Unchanged */ }

/* Index History Widget */
.index-history {
    background-color: rgba(255, 255, 255, 0.7); backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 12px;
    padding: 1.5rem; box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.index-history h3 { margin-top: 0; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }

/* Final CTA */
.final-cta-card {
    text-align: center; padding: 4rem 2rem;
    border-radius: 12px;
    background-image: linear-gradient(125deg, var(--primary-blue), #8040f2);
    color: #fff;
}
.final-cta-card h2 { font-size: 2rem; margin: 0 0 1.5rem 0; }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }
.final-cta-card .btn-primary { background: #fff; color: var(--primary-blue); }

/* Mobile Responsive Fixes */
@media (max-width: 900px) {
    .steps-grid, .testimonials-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.2rem; }
    .analysis-form { flex-direction: column; }
    .form-inputs { flex-direction: column; }
}

/* --- NEW, STUNNING "COMMAND DECK" History Widget --- */

.history-deck {
    max-width: 1100px;
    margin: 4rem auto 0;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.deck-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.deck-list {
    padding: 0.5rem;
}

.deck-list-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.col-url {
    flex: 3; /* URL column takes more space */
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.col-date {
    flex: 1;
    text-align: center;
}
.col-score {
    flex: 0.5;
    text-align: right;
}

.deck-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}
/* This pseudo-element creates the colored hover glow */
.deck-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: transparent;
    box-shadow: none;
    transition: background-color 0.3s, box-shadow 0.3s;
    z-index: 0;
}
.deck-item:hover {
    transform: translateY(-2px);
}
.deck-item.score-good:hover::before {
    background-color: rgba(56, 161, 105, 0.05);
    box-shadow: inset 3px 0 0 var(--status-success);
}
.deck-item.score-average:hover::before {
    background-color: rgba(221, 107, 32, 0.05);
    box-shadow: inset 3px 0 0 var(--status-warning);
}
.deck-item.score-bad:hover::before {
    background-color: rgba(229, 62, 62, 0.05);
    box-shadow: inset 3px 0 0 var(--status-error);
}

.deck-item .col-url,
.deck-item .col-date,
.deck-item .col-score {
    position: relative;
    z-index: 1;
}

.col-url span {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.col-url .feather {
    width: 18px;
    color: var(--text-secondary);
}
.col-date {
    font-weight: 500;
    color: var(--text-secondary);
}
.col-score span {
    font-size: 1.1rem;
    font-weight: 700;
}
.deck-item.score-good .col-score span { color: var(--status-success); }
.deck-item.score-average .col-score span { color: var(--status-warning); }
.deck-item.score-bad .col-score span { color: var(--status-error); }

.deck-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-light);
    border-radius: 0 0 12px 12px;
}
.deck-footer a {
    font-weight: 600;
    color: var(--primary-blue);
}

/* --- NEW, PROFESSIONAL & RESPONSIVE Hero & Form --- */

.hero-section {
    padding: 5rem 1.5rem;
    text-align: center;
}
.hero-content h1 {
    font-size: 3.2rem;
    line-height: 1.2;
    background: linear-gradient(90deg, #1e40af, #6b21a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 3rem;
    max-width: 650px; margin-left: auto; margin-right: auto;
}

.analysis-form-wrapper {
    background: none;
    max-width: 700px;
    margin: 0 auto;
}

.analysis-form { display: flex; flex-direction: column; }
.form-main-group { display: flex; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1); }

/* This is the key to robust icon positioning */
.input-with-icon {
    position: relative;
    flex-grow: 1; /* Allows the input to take up available space */
}
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    color: var(--text-secondary);
    display: grid;
    place-items: center;
}
.input-icon.loading .feather-loader { animation: spin 1s linear infinite; }
.input-icon.success .feather-check { color: var(--status-success); }
.input-icon.error .feather-x { color: var(--status-error); }

/* Consistent input styling */
.analysis-form input[type="text"], .analysis-form input[type="url"] {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem; /* Left padding for icon */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.analysis-form input[name="domain"] {
    border-right: none;
    border-radius: 12px 0 0 12px;
}
.analysis-form input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    z-index: 2; /* Bring to front on focus */
    position: relative;
}
.analysis-form #analyse-button {
    flex-shrink: 0;
    border-radius: 0 12px 12px 0;
    font-size: 1.1rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Advanced Keyword Options */
.advanced-options { margin-top: 1rem; }
.keyword-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.keyword-toggle:hover { color: var(--primary-blue); }
.keyword-toggle .feather { width: 16px; height: 16px; }
.keyword-input-wrapper {
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto; margin-right: auto;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 1; transform: translateY(0);
}
.keyword-input-wrapper.hidden {
    opacity: 0; transform: translateY(-10px); height: 0;
    overflow: hidden; margin-top: 0;
}
.keyword-input-wrapper .input-with-icon input {
    font-size: 1rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
.keyword-input-wrapper .input-icon .feather { width: 18px; }

/* URL Feedback (unchanged) */
.url-feedback { min-height: 24px; margin-top: 1rem; font-weight: 500; font-size: 0.9rem; transition: color 0.3s; }
.url-feedback.checking { color: var(--text-secondary); }
.url-feedback.success { color: var(--status-success); }
.url-feedback.error { color: var(--status-error); }

/* --- THIS IS THE KEY MOBILE FIX --- */
@media (max-width: 768px) {
    .form-main-group {
        flex-direction: column;
        box-shadow: none; /* Remove shadow on stacked group */
    }
    .analysis-form input[name="domain"] {
        border-radius: 12px; /* Full radius on mobile */
        border-right: 1px solid var(--border-color);
        box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    }
    .analysis-form #analyse-button {
        margin-top: 1rem;
        border-radius: 12px; /* Full radius on mobile */
        width: 100%;
    }
}

/* --- NEW SEO Tools Pages Styling --- */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.tool-card {
    display: block;
    background-color: var(--background-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.tool-icon {
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center;
    background-image: linear-gradient(45deg, #ebf8ff, #dbeafe);
    color: var(--primary-blue); margin-bottom: 1.5rem;
}
.tool-icon .feather { width: 24px; height: 24px; }
.tool-card h3 { margin: 0 0 0.5rem; color: var(--text-primary); }
.tool-card p { margin: 0; color: var(--text-secondary); }

.tool-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
}
.tool-form-section, .tool-output-section {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
}
.tool-output-section h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.tool-output-section pre {
    background-color: #1a202c;
    color: #a0aec0;
    padding: 1rem;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 200px;
}

/* --- NEW Social Media Preview Styling --- */

.social-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.preview-card {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.preview-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}
.preview-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background-color: var(--background-light);
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    padding: 1rem;
    border-radius: 6px;
}

/* Open Graph Preview */
.og-preview {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.og-image {
    width: 100%;
    height: 180px; /* Aspect ratio for social cards */
    background-color: var(--background-light);
}
.og-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.og-content {
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
}
.og-url {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}
.og-title {
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}
.og-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Twitter Card Preview */
.twitter-preview {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.twitter-image {
    width: 100%;
    height: 180px;
    background-color: var(--background-light);
}
.twitter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.twitter-content {
    padding: 0.75rem 1rem;
}
.twitter-title {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}
.twitter-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.twitter-url {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.twitter-url .feather {
    width: 14px;
    height: 14px;
}

@media (max-width: 900px) {
    .social-preview-grid {
        grid-template-columns: 1fr;
    }
}
/* --- NEW Social Preview Error & Recommendation Styling --- */

/* Error state for missing images */
.og-image.missing, .twitter-image.missing {
    position: relative;
}
.missing-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(253, 234, 234, 0.8);
}
.missing-overlay span {
    color: #a52828;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Error state for missing text */
.missing-text {
    color: var(--status-error) !important;
    font-style: italic;
    font-weight: 500 !important;
}

/* New Recommendation Card */
.recommendation-card {
    background-color: var(--background-white);
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.recommendation-card h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
}
.recommendation-card .feather {
    color: var(--primary-blue);
}
.recommendation-block {
    margin-bottom: 1.5rem;
}
.recommendation-block:last-child {
    margin-bottom: 0;
}
.recommendation-block p {
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.recommendation-block pre {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.85rem;
}

/* Styling for the broken link message inside the preview */
.missing-overlay.broken-link {
    flex-direction: column; /* Stack the message and URL */
    gap: 0.5rem;
}
.missing-overlay code {
    font-family: monospace;
    font-size: 0.8rem;
    background-color: rgba(0,0,0,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Add "..." if URL is too long */
}

/* --- NEW, STUNNING Report Page Header & Domain History --- */

/* New Results Header v2 */
.results-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-white);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.url-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 500;
    min-width: 0; /* Important for truncation */
}
.url-display .feather {
    color: var(--text-secondary);
    flex-shrink: 0;
}
.url-display a {
    color: var(--primary-blue);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.url-display a:hover {
    text-decoration: underline;
}
.header-actions-v2 {
    display: flex;
    gap: 0.5rem;
}
.action-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
}
.action-btn:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
    transform: translateY(-2px);
}
.action-btn .feather {
    width: 20px;
    height: 20px;
}

/* New "Glass" Domain History Widget */
.domain-history-widget {
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.domain-history-widget h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-align: center;
}
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.history-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
.history-card-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.history-card-score {
    font-size: 2rem;
    font-weight: 700;
}
.history-card-path {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}
.history-card-footer {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Color coding for history cards */
.history-card.score-good { border-left: 4px solid var(--status-success); }
.history-card.score-good .history-card-score { color: var(--status-success); }
.history-card.score-average { border-left: 4px solid var(--status-warning); }
.history-card.score-average .history-card-score { color: var(--status-warning); }
.history-card.score-bad { border-left: 4px solid var(--status-error); }
.history-card.score-bad .history-card-score { color: var(--status-error); }

/* --- 5a. NEW, FINAL & CORRECTED Circular Score Gauge --- */

.seo-score-container {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}
.seo-score-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.score-circle-gauge {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}
.score-circle-svg {
    transform: rotate(-90deg); /* Start the circle from the top */
    width: 100%;
    height: 100%;
}

/* THIS IS THE CRITICAL FIX */
/* We target the circle elements directly and specifically */
.score-circle-svg .score-circle-base,
.score-circle-svg .score-circle-progress {
    fill: none;
    stroke-width: 14;
}

.score-circle-base {
    stroke: var(--border-color);
}
.score-circle-progress {
    stroke-linecap: round;
    /* This transition animates the arc drawing */
    transition: stroke-dashoffset 1.5s cubic-bezier(0.6, 0, 0.1, 1);
}

/* Color classes for the progress arc */
.score-circle-progress.score-good { stroke: var(--status-success); }
.score-circle-progress.score-average { stroke: var(--status-warning); }
.score-circle-progress.score-bad { stroke: var(--status-error); }

.score-circle-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-circle-text .score-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.5s;
}

/* Color classes for the score number */
.score-circle-text .score-value.score-good { color: var(--status-success); }
.score-circle-text .score-value.score-average { color: var(--status-warning); }
.score-circle-text .score-value.score-bad { color: var(--status-error); }

/* --- NEW, "LIVE DIAGNOSTIC HUB" Styling --- */

.diagnostic-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.main-score-card { /* This is now just a container for the gauge */
    grid-row: 1 / 3;
    text-align: center;
}
.main-score-card h3 { display: none; } /* Title is implied */
.score-circle-text .embed-btn {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    width: 60px; height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.score-circle-text .embed-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
.score-circle-text .embed-btn .feather { width: 28px; height: 28px; }

.sub-score-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.sub-score-card {
    background-color: var(--background-white);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.sub-score-card h4 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.sub-score-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sub-score-bar-container { flex-grow: 1; height: 8px; background-color: var(--border-color); border-radius: 4px; overflow: hidden; }
.sub-score-bar {
    width: 0%; /* Animated by JS */
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.sub-score-value {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}
.sub-score-value.score-good { color: var(--status-success); }
.sub-score-value.score-average { color: var(--status-warning); }
.sub-score-value.score-bad { color: var(--status-error); }
.sub-score-bar.score-good { background-color: var(--status-success); }
.sub-score-bar.score-average { background-color: var(--status-warning); }
.sub-score-bar.score-bad { background-color: var(--status-error); }

.checklist-container.full-width { grid-column: 2 / 3; }

/* Modal Styling */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background-color: var(--background-white); border-radius: 12px; width: 90%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); transform: scale(0.95); transition: transform 0.3s; }
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.close-modal-btn { background: none; border: none; cursor: pointer; padding: 0.5rem; }
.modal-content { padding: 1.5rem; }
.modal-content p { margin: 0 0 1rem; color: var(--text-secondary); }
#embed-code-textarea { width: 100%; box-sizing: border-box; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; font-family: monospace; resize: none; margin-bottom: 1rem; }
#copy-embed-code-btn { width: 100%; }


/* --- NEW, "POLISHED EXECUTIVE REPORT" Design --- */

@property --p { syntax: '<integer>'; inherits: false; initial-value: 0; }
@keyframes sub-score-anim { from { --p: 0; } }

.analytics-dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background-color: rgba(255, 255, 255, 0.6); /* Glassmorphism effect */
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px; /* Softer radius */
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.summary-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

/* Main Score Card */
.main-score-card {
    grid-row: 1 / 3;
}
.score-circle-gauge { /* Sizing and position */
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}
.score-circle-svg { /* ... same as before ... */ }
.score-circle-svg circle { fill: none; stroke-width: 12; }
.score-circle-base { stroke: rgba(0,0,0,0.05); }
.score-circle-progress { /* ... same as before ... */ }
.score-circle-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.score-card-title {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
}
.score-value {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
}
.score-value.score-good { color: var(--status-success); }
.score-value.score-average { color: var(--status-warning); }
.score-value.score-bad { color: var(--status-error); }
.checklist-summary { /* ... same as before ... */ }
.checklist-stat:hover::after {
    /* Polished tooltip */
    background-color: #1a202c; color: #fff; padding: 0.6rem 0.8rem;
    border-radius: 6px; font-size: 0.85rem; white-space: normal;
    width: 200px; line-height: 1.5;
}

/* Sub-Scores Card */
.sub-scores-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.sub-score-item {
    text-align: center;
}
.sub-score-gauge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 0.75rem;

    /* Conic gradient for the progress ring */
    --p: var(--score);
    animation: sub-score-anim 1.5s 0.5s forwards ease-out;
    background: conic-gradient(var(--score-color, #ccc) calc(var(--p) * 1%), #e2e8f0 0);
}
.sub-score-gauge.score-good { --score-color: var(--status-success); }
.sub-score-gauge.score-average { --score-color: var(--status-warning); }
.sub-score-gauge.score-bad { --score-color: var(--status-error); }
.sub-score-percent {
    font-size: 1.2rem;
    font-weight: 700;
    background-color: var(--background-white);
    width: 68px; /* 80px - (6px padding * 2) */
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.sub-score-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checklist-container.full-width {
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 1024px) {
    .analytics-dashboard-grid { grid-template-columns: 1fr; }
    .main-score-card { grid-row: auto; }
    .checklist-container.full-width { grid-column: auto; }
}
@media (max-width: 768px) {
    .sub-scores-list { grid-template-columns: 1fr 1fr; }
}



/* --- NEW, "POLISHED ANALYTICS DASHBOARD" Design --- */

.analytics-dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.summary-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

/* Main Score Card */
.main-score-card { text-align: center; }
.main-score-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    line-height: 1;
}
.main-score-value {
    font-size: 5rem;
    font-weight: 700;
}
.main-score-value.score-good { color: var(--status-success); }
.main-score-value.score-average { color: var(--status-warning); }
.main-score-value.score-bad { color: var(--status-error); }
.main-score-label {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}
.score-description {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.5rem 0 1.5rem;
    color: var(--text-primary);
}
.checklist-summary { /* ... same as previous working version ... */ }


/* Sub-Scores Card */
.sub-scores-list { display: flex; flex-direction: column; gap: 1.25rem; }
.sub-score-item { padding: 0.5rem; border-radius: 6px; }
.sub-score-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.sub-score-percent { font-weight: 600; color: var(--text-primary); }
.sub-score-bar-container { height: 8px; background-color: rgba(0,0,0,0.05); border-radius: 4px; overflow: hidden; }
.sub-score-bar { width: 0%; height: 100%; border-radius: 4px; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.sub-score-bar.score-good { background-color: var(--status-success); }
.sub-score-bar.score-average { background-color: var(--status-warning); }
.sub-score-bar.score-bad { background-color: var(--status-error); }

/* Responsive */
@media (max-width: 900px) {
    .analytics-dashboard { grid-template-columns: 1fr; }
}

.sub-score-bar {
    width: 0%; /* Animated by JS */
    height: 100%;
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- ADD THESE THREE LINES --- */
.sub-score-bar.score-good { background-color: var(--status-success); }
.sub-score-bar.score-average { background-color: var(--status-warning); }
.sub-score-bar.score-bad { background-color: var(--status-error); }




/* --- NEW Action Hub & Modal Styling (Corrected) --- */

/* Action buttons in the main score card */
.main-score-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* This is the new, specific rule that will not be overridden */
.action-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit; /* Ensure font is consistent */
    font-size: 0.9rem; /* Adjust size as needed */
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--background-light);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none; /* For the <a> tag */
    transition: all 0.2s;
}
.action-hub-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.action-hub-btn .feather {
    width: 16px;
    height: 16px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background-color: var(--background-white);
    border-radius: 12px;
    width: 90%; max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.close-modal-btn { background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text-secondary); }
.close-modal-btn:hover { color: var(--text-primary); }
.modal-content { padding: 1.5rem; }
.modal-content p { margin: 0 0 1rem; color: var(--text-secondary); }
#embed-code-textarea {
    width: 100%; box-sizing: border-box; padding: 0.75rem;
    border: 1px solid var(--border-color); border-radius: 6px;
    font-family: monospace; resize: none; margin-bottom: 1rem;
    background-color: var(--background-light);
}
#copy-embed-code-btn { width: 100%; }


/* --- NEW, STUNNING "INSIGHT CARDS" Styling --- */

.insight-cards-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2); /* Subtle separator inside the glass card */
}

.insight-card {
    position: relative; /* For the tooltip */
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(241, 245, 249, 0.5); /* Faint background color */
    border: 1px solid transparent;
    cursor: default;
}

.card-content {
    text-align: left;
}

.card-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.card-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.1;
}
.card-icon .feather {
    width: 48px;
    height: 48px;
}

/* Color coding for cards */
.insight-card.passed {
    border-color: rgba(56, 161, 105, 0.2);
}
.insight-card.passed .card-value {
    color: var(--status-success);
}
.insight-card.passed .card-icon {
    color: var(--status-success);
}

.insight-card.failed {
    border-color: rgba(221, 107, 32, 0.2);
}
.insight-card.failed .card-value {
    color: var(--status-warning);
}
.insight-card.failed .card-icon {
    color: var(--status-warning);
}

/* Polished Tooltip (replaces old tooltip style) */
.insight-card:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a202c;
    color: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: normal;
    width: 220px; /* Wider for more text */
    line-height: 1.5;
    z-index: 10;
    opacity: 1;
    pointer-events: none; /* Allows clicks to pass through */
    transition: opacity 0.2s;
}

/* --- NEW Top Priority Issue Styling --- */
.top-priority-issue {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.top-priority-issue a {
    display: flex;
    align-items: center;
    background-color: #fdeaea; /* Light red background to draw attention */
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}
.top-priority-issue a:hover {
    background-color: #fbe2e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.1);
}

.priority-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--status-error);
    color: #fff;
    margin-right: 1rem;
}
.priority-icon .feather {
    width: 20px;
    height: 20px;
}
.priority-details {
    flex-grow: 1;
}
.priority-details span {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #c53030;
}
.priority-details strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #a52828;
}
.priority-arrow {
    color: #c53030;
}

/* --- NEW Sub-Score Tooltip Styling --- */
.sub-score-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    position: relative; /* Required for the tooltip */
}
.help-icon {
    width: 14px;
    height: 14px;
    color: #cbd5e0; /* A very light gray */
    cursor: help;
}

/* Polished Tooltip Style */
.sub-score-label:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* Position above the element */
    left: 50%;
    transform: translateX(-50%);

    background-color: #1a202c; /* Dark background */
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: normal; /* Allow text to wrap */
    width: 250px; /* Set a fixed width */
    line-height: 1.5;
    z-index: 10;

    /* Fade-in animation */
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* --- NEW, WIDER & PROFESSIONAL Hero & Form --- */

.hero-section {
    padding: 5rem 1.5rem;
    text-align: center;
}
.hero-content {
    max-width: 1100px; /* <-- INCREASED FROM 800px */
    margin: 0 auto;
}
.hero-content h1 {
    font-size: 3.2rem;
    line-height: 1.2;
    background: linear-gradient(90deg, #1e40af, #6b21a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 700px; /* Can also be increased if desired */
    margin-left: auto;
    margin-right: auto;
}

.analysis-form-wrapper {
    max-width: 1100px; /* <-- INCREASED FROM 700px */
    margin: 0 auto;
}

.input-with-icon {
  width: 100%;
  max-width: 845px;
  margin: 0 auto;
  box-sizing: border-box;
}

.analysis-form { display: flex; flex-direction: column; }
.form-main-group { display: flex; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1); }

.input-with-icon {
    position: relative;
    flex-grow: 1;
}
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    color: var(--text-secondary);
    display: grid;
    place-items: center;
}
.input-icon.loading .feather-loader { animation: spin 1s linear infinite; }
.input-icon.success .feather-check { color: var(--status-success); }
.input-icon.error .feather-x { color: var(--status-error); }

.analysis-form input[type="text"], .analysis-form input[type="url"] {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.analysis-form input[name="domain"] {
    border-right: none;
    border-radius: 12px 0 0 12px;
}
.analysis-form input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    z-index: 2;
    position: relative;
}
.analysis-form #analyse-button {
    flex-shrink: 0;
    border-radius: 0 12px 12px 0;
    font-size: 1.1rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Advanced Keyword Options */
.advanced-options { margin-top: 1rem; }
.keyword-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.keyword-toggle:hover { color: var(--primary-blue); }
.keyword-toggle .feather { width: 16px; height: 16px; }
.keyword-input-wrapper {
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto; margin-right: auto;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 1; transform: translateY(0);
}
.keyword-input-wrapper.hidden {
    opacity: 0; transform: translateY(-10px); height: 0;
    overflow: hidden; margin-top: 0;
}
.keyword-input-wrapper .input-with-icon input {
    font-size: 1rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
.keyword-input-wrapper .input-icon .feather { width: 18px; }

/* URL Feedback (unchanged) */
.url-feedback { min-height: 24px; margin-top: 1rem; font-weight: 500; font-size: 0.9rem; transition: color 0.3s; }
.url-feedback.checking { color: var(--text-secondary); }
.url-feedback.success { color: var(--status-success); }
.url-feedback.error { color: var(--status-error); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-main-group {
        flex-direction: column;
        box-shadow: none;
    }
    .analysis-form input[name="domain"] {
        border-radius: 12px;
        border-right: 1px solid var(--border-color);
        box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    }
    .analysis-form #analyse-button {
        margin-top: 1rem;
        border-radius: 12px;
        width: 100%;
    }
}

/* --- NEW "EXECUTIVE DASHBOARD" Styling --- */

/* Overriding the default stat card for the KPI row */
.stats-grid {
    margin-bottom: 2rem;
}
.stats-grid .stat-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Chart takes 2/3, keyword lists take 1/3 */
    grid-template-rows: auto auto;
    gap: 2rem;
}

.dashboard-card {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.chart-card {
    grid-column: 1 / 2; /* Span the first column */
    grid-row: 1 / 3; /* Span two rows */
    height: 566px;
}
.chart-container {
    position: relative;
    height: calc(100% - 40px);
}

.keyword-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.keyword-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--background-light);
}
.keyword-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.keyword-text {
    font-weight: 500;
}
.keyword-rank {
    font-weight: 700;
    font-size: 1.1rem;
}
.keyword-rank.score-good { color: var(--status-success); }
.keyword-rank.score-average { color: var(--status-warning); }
.keyword-rank.score-bad { color: var(--status-error); }

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr; /* Stack everything on smaller screens */
    }
    .chart-card {
        grid-row: auto; /* Reset row span */
    }
}

/* --- Rank Tracker Redesign --- */
.project-card { position: relative; }
.project-card-main { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.delete-form { position: absolute; top: 0.5rem; right: 0.5rem; }
.delete-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0.5rem; border-radius: 50%; }
.delete-btn:hover { background-color: #fdeaea; color: var(--status-error); }

.tracker-table .ranking-url { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracker-table .action-cell { display: flex; gap: 0.5rem; }
.tracker-table .action-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border-color); color: var(--text-secondary); border-radius: 6px; }
.tracker-table .action-btn:hover { background-color: var(--background-light); color: var(--text-primary); }
.tracker-table .action-btn.delete { background: none; border: none; padding: 0; }
.tracker-table .action-btn.delete:hover { background-color: #fdeaea; color: var(--status-error); }




/* --- NEW, PROFESSIONAL Tracker Page Redesign --- */

.tracker-layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.add-keywords-card {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    position: sticky; /* Stick the form to the side on scroll */
    top: 90px;
}
.add-keywords-card h3 {
    margin-top: 0;
}
.add-keywords-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: -0.5rem 0 1.5rem;
}
.keyword-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}
.keyword-form button {
    width: 100%;
}

.keyword-list-container {
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.keyword-list-header {
    display: flex; align-items: center; padding: 1rem 1.5rem;
    font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}
.keyword-row {
    display: flex; align-items: center; padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.keyword-row:last-child { border-bottom: none; }
.keyword-row:hover { background-color: var(--background-light); }
.keyword-row:hover .col-actions { opacity: 1; }

.col-keyword { flex: 2.5; font-size: 1.05rem; min-width: 0; }
.col-rank { flex: 0.5; font-weight: 700; font-size: 1.1rem; text-align: center; }
.col-change { flex: 0.5; display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; justify-content: center; }
.col-change .feather { width: 16px; height: 16px; }
.col-url { flex: 2; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-actions { flex: 0.5; display: flex; gap: 0.5rem; justify-content: flex-end; opacity: 0; transition: opacity 0.2s; }

.action-btn {
    display: grid; place-items: center; width: 32px; height: 32px;
    border: 1px solid var(--border-color); color: var(--text-secondary);
    border-radius: 6px; background-color: var(--background-white);
    cursor: pointer;
}
.action-btn:hover { background-color: #e2e8f0; color: var(--text-primary); }
.action-btn.delete { background: none; border: none; padding: 0; }
.action-btn.delete:hover { background-color: #fdeaea; color: var(--status-error); }

.change-positive { color: var(--status-success); }
.change-negative { color: var(--status-error); }
.change-neutral { color: var(--text-secondary); }

/* Responsive Tracker */
@media (max-width: 1024px) {
    .tracker-layout-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
    .add-keywords-card {
        position: static; /* Unstick the form */
    }
}

/* --- NEW, "COMMAND CENTER" Tracker Page Design --- */
.tracker-header .header-actions { display: flex; gap: 0.75rem; }

.tracker-kpis {
    margin-top: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.keyword-list-container {
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}
.keyword-list-header, .keyword-row {
    display: grid;
    grid-template-columns: 2.5fr 0.5fr 0.5fr 2fr 0.5fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.5rem;
}
.keyword-list-header {
    font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}
.keyword-row {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.keyword-row:last-child { border-bottom: none; }
.keyword-row:hover { background-color: var(--background-light); }
.keyword-row:hover .col-actions { opacity: 1; }

.col-keyword { display: flex; align-items: center; gap: 0.75rem; font-size: 1.05rem; min-width: 0; }
.favicon { width: 16px; height: 16px; }
.col-rank { font-weight: 700; font-size: 1.1rem; text-align: center; }
.rank-score-good { color: var(--status-success); }
.rank-score-average { color: var(--status-warning); }
.rank-score-bad { color: var(--text-secondary); }

.col-change { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; justify-content: center; }
.col-change .feather { width: 16px; height: 16px; }
.col-url { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-actions { display: flex; gap: 0.5rem; justify-content: flex-end; opacity: 0; transition: opacity 0.2s; }
.no-change { color: var(--text-secondary); }

.serp-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
    font-style: italic;
}


/* --- NEW, PROFESSIONAL "SERP COMMAND CENTER" Tracker Design --- */
.tracker-layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}
.tracker-sidebar {
    position: sticky;
    top: 90px; /* 70px header + 20px margin */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.tracker-kpis-sidebar {
    grid-template-columns: 1fr 1fr; /* Two columns for KPIs */
    gap: 1rem;
}
.add-keywords-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 1.5rem;
}
.add-keywords-card h3 { margin-top: 0; }
.add-keywords-card p { font-size: 0.9rem; color: var(--text-secondary); margin: -0.5rem 0 1.5rem; }
.keyword-form textarea { width: 100%; box-sizing: border-box; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: inherit; resize: vertical; min-height: 120px; }
.keyword-form button { width: 100%; margin-top: 1rem; }

.keyword-list-container {
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.keyword-list-header {
    display: grid; grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 1.5rem; align-items: center; padding: 1rem 1.5rem;
    font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}
.keyword-card {
    border-bottom: 1px solid var(--border-color);
}
.keyword-card:last-child { border-bottom: none; }
.keyword-card summary {
    display: grid; grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 1.5rem; align-items: center; padding: 1.25rem 1.5rem;
    cursor: pointer; list-style: none; /* Hide default triangle */
    transition: background-color 0.2s;
}
.keyword-card summary::-webkit-details-marker { display: none; }
.keyword-card:hover summary { background-color: var(--background-light); }
.expand-icon { transition: transform 0.3s; }
.keyword-card[open] > summary .expand-icon { transform: rotate(180deg); }

.col-keyword { font-weight: 600; font-size: 1.05rem; }
.col-rank { font-weight: 700; font-size: 1.1rem; text-align: center; }
.col-change { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; justify-content: center; }
.col-change .feather { width: 16px; height: 16px; }
.col-actions { display: flex; justify-content: flex-end; }

.keyword-details {
    padding: 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.serp-preview { max-width: 70%; }
.serp-url { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.serp-title { font-size: 1.1rem; font-weight: 500; color: var(--primary-blue); margin: 0.25rem 0; }
.serp-snippet { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.detail-actions { display: flex; gap: 0.75rem; }
.btn-danger { background-color: transparent; border-color: var(--status-error); color: var(--status-error); }
.btn-danger:hover { background-color: #fdeaea; }

/* Responsive Tracker */
@media (max-width: 1024px) {
    .tracker-layout-grid { grid-template-columns: 1fr; }
    .tracker-sidebar { position: static; }
}
@media (max-width: 768px) {
    .keyword-list-header { display: none; }
    .keyword-card summary { grid-template-columns: 1fr 1fr; }
    .col-keyword { grid-column: 1 / -1; margin-bottom: 0.5rem; }
    .col-rank, .col-change { text-align: left; justify-content: flex-start;}
    .keyword-details { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .serp-preview { max-width: 100%; }
}

/* --- NEW, PROFESSIONAL Tracker Button & Action Designs --- */

/* Header Action Hub */
.tracker-header .header-actions {
    display: flex;
    gap: 0.75rem;
}
.tracker-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.tracker-header .btn .feather {
    width: 16px;
    height: 16px;
}

/* Keyword Row Action Buttons (Ghost Style) */
.col-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    opacity: 0.3; /* Subtle by default */
    transition: opacity 0.2s;
}
.keyword-row:hover .col-actions {
    opacity: 1; /* Fully visible on hover */
}

.action-btn-v2 {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.action-btn-v2:hover {
    background-color: var(--background-light);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.action-btn-v2.delete:hover {
    background-color: #fdeaea;
    color: var(--status-error);
    border-color: #fbdada;
}
.action-btn-v2 .feather {
    width: 18px;
    height: 18px;
}

/* Form wrapper for the delete button */
.col-actions form {
    margin: 0;
    padding: 0;
}

/* Detail Actions (inside expanded view) */
.detail-actions {
    display: flex;
    gap: 0.75rem;
}
.btn-danger {
    background-color: transparent;
    border-color: var(--status-error);
    color: var(--status-error);
}
.btn-danger:hover {
    background-color: #fdeaea;
}
.btn-danger .feather {
    width: 16px;
    height: 16px;
}

/* --- NEW, PROFESSIONAL "COMMAND CENTER" Tracker Design --- */

.tracker-layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}
.tracker-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.tracker-kpis-sidebar {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.add-keywords-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 1.5rem;
}
.add-keywords-card h3 { margin-top: 0; }
.add-keywords-card p { font-size: 0.9rem; color: var(--text-secondary); margin: -0.5rem 0 1.5rem; }
.keyword-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}
.keyword-form button {
    width: 100%;
    margin-top: 1rem;
}

/* New Keyword Card List */
.keyword-list-container {
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.keyword-card-v2 {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1.5rem;
}
.keyword-card-v2:last-child {
    border-bottom: none;
}
.rank-info {
    flex-shrink: 0;
    text-align: center;
}
.rank-position {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.rank-change {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.rank-change .feather { width: 14px; height: 14px; }
.change-positive { color: var(--status-success); }
.change-negative { color: var(--status-error); }
.change-neutral, .no-change { color: var(--text-secondary); }

.keyword-serp-details {
    flex-grow: 1;
    min-width: 0;
}
.keyword-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.serp-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.serp-url span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.serp-snippet {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.keyword-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.action-btn-v2 {
    display: grid; place-items: center;
    width: 36px; height: 36px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.action-btn-v2:hover { background-color: #e2e8f0; color: var(--text-primary); }
.action-btn-v2.delete { background: none; border: none; padding: 0; }
.action-btn-v2.delete:hover { background-color: #fdeaea; color: var(--status-error); }
.action-btn-v2 .feather { width: 18px; height: 18px; }

/* Responsive Tracker */
@media (max-width: 1024px) {
    .tracker-layout-grid { grid-template-columns: 1fr; }
    .tracker-sidebar { position: static; }
}
@media (max-width: 768px) {
    .keyword-card-v2 {
        flex-wrap: wrap;
    }
    .keyword-serp-details {
        width: 100%;
        order: 1; /* Move SERP details first */
    }
    .rank-info {
        order: 2;
        text-align: left;
    }
    .keyword-actions {
        order: 3;
        margin-left: auto;
    }
}

/* --- NEW, "STATUS-AWARE" Tracker Page Design --- */

.tracker-layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}
.tracker-sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2rem; }
.tracker-kpis-sidebar { grid-template-columns: 1fr 1fr; gap: 1rem; }

.add-keywords-card {
    background-color: var(--background-white); border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 12px; padding: 1.5rem;
}
.add-keywords-card h3 { margin-top: 0; }
.add-keywords-card p { font-size: 0.9rem; color: var(--text-secondary); margin: -0.5rem 0 1.5rem; }
.keyword-form textarea { width: 100%; box-sizing: border-box; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: inherit; resize: vertical; min-height: 120px; }
.keyword-form button { width: 100%; margin-top: 1rem; }

.keyword-list-container {
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.keyword-list-body {
    padding: 0.5rem;
}
.keyword-card, .keyword-card-placeholder {
    border-bottom: 1px solid var(--border-color);
}
.keyword-card:last-child, .keyword-card-placeholder:last-child {
    border-bottom: none;
}
.keyword-card summary {
    display: grid; grid-template-columns: 3fr 1fr 1fr 1fr;
    gap: 1.5rem; align-items: center; padding: 0.75rem 1rem;
    cursor: pointer; list-style: none;
    transition: background-color 0.2s;
}
.keyword-card summary::-webkit-details-marker { display: none; }
.keyword-card[open] > summary, .keyword-card:hover summary {
    background-color: var(--background-light);
}
.expand-icon { transition: transform 0.3s; }
.keyword-card[open] > summary .expand-icon { transform: rotate(180deg); }

.keyword-card-placeholder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
}
.keyword-card-placeholder.pending { color: var(--text-secondary); }
.keyword-card-placeholder.checking { color: var(--primary-blue); }
.status-text { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.pulsing-icon {
    width: 10px; height: 10px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(55, 125, 255, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(55, 125, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(55, 125, 255, 0); } }

.col-keyword { font-weight: 600; font-size: 1.05rem; }
.col-rank { font-weight: 700; font-size: 1.1rem; text-align: center; }
.col-change { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; justify-content: center; }
.col-actions { display: flex; justify-content: flex-end; }

.keyword-details {
    padding: 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.serp-preview { max-width: 70%; }
.serp-url { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.serp-title { font-size: 1.1rem; font-weight: 500; color: var(--primary-blue); margin: 0.25rem 0; }
.serp-snippet { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.detail-actions { display: flex; gap: 0.75rem; }
.btn-danger { background-color: transparent; border-color: var(--status-error); color: var(--status-error); }
.btn-danger:hover { background-color: #fdeaea; }

/* --- NEW Tracker "Not Ranking" State Styling --- */

.keyword-card.not-ranking summary .col-rank {
    color: var(--text-secondary);
}

.not-ranking-message {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-style: italic;
}
.not-ranking-message .feather {
    width: 20px;
    height: 20px;
}

/* --- NEW Keyword Data Column Styling --- */

.keyword-list-header {
    /* Adjust grid to make space for the new column */
    grid-template-columns: 2.5fr 0.5fr 0.5fr 1fr 0.5fr;
}
.keyword-card summary {
    /* Adjust grid to make space for the new column */
    grid-template-columns: 2.5fr 0.5fr 0.5fr 1fr 0.5fr;
}

.col-data {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.keyword-data-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.keyword-data-item .feather {
    width: 14px;
    height: 14px;
}

/* --- NEW Visual On-Page Inspector Styling --- */

.inspector-layout {
    display: grid;
    grid-template-columns: 300px 1fr; /* Fixed sidebar, flexible preview */
    gap: 2rem;
    align-items: flex-start;
}

.inspector-panel {
    position: sticky;
    top: 92px; /* Header height + margin */
    background-color: var(--background-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.inspector-panel h3 { margin-top: 0; }
.inspector-panel p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

.inspector-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}
.inspector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--background-light);
    cursor: pointer;
    transition: all 0.2s;
}
.inspector-btn:hover {
    background-color: #e2e8f0;
    color: var(--primary-blue);
}
.inspector-btn .feather { width: 18px; height: 18px; }

.inspector-legend h4 { margin-bottom: 0.75rem; }
.inspector-legend ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.inspector-legend li { display: flex; align-items: center; gap: 0.5rem; }
.legend-color {
    width: 12px; height: 12px;
    border-radius: 3px;
    border: 2px solid;
}
.legend-color.h1 { border-color: #2563eb; }
.legend-color.h2 { border-color: #ea580c; }
.legend-color.h3 { border-color: #ca8a04; }
.legend-color.img-ok { border-color: #16a34a; }
.legend-color.img-bad { border-color: #dc2626; }

.inspector-preview {
     flex: 1;
     height: 100%;
 }

.iframe-wrapper {
    width: 100%;
    height: 80vh;
    border-radius: 12px;
    overflow: hidden;
}
.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
}

@media (max-width: 900px) {
    .inspector-layout {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
    .inspector-panel {
        position: static;
    }
}

/* --- NEW, STUNNING "INSIGHT GRID" Checklist Design --- */

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.checklist-header {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}
.checklist-header .feather {
    width: 28px;
    height: 28px;
}
.checklist-header.passed { color: var(--status-success); }
.checklist-header.failed { color: var(--status-error); }

.insight-grid {
    display: grid;
    /* Create responsive columns: 3 on large, 2 on medium, 1 on small screens */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.insight-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}
.insight-pill .feather {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.insight-pill.passed {
    background-color: #e6f6eb;
    color: #2a6f44;
    border: 1px solid #b7e1c7;
}

.insight-pill.failed {
    background-color: #fdeaea;
    color: #a52828;
    border: 1px solid #fbdada;
}


.collapsible-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.summary-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0; /* <-- THIS IS THE FIX */
}

iframe#inspector-iframe {
    width: 100%;
    height: 100%;
    border: none;
}


/* --- NEW, Report Page Tabbed Interface Styling --- */

.report-main-content {
    margin-top: 2rem;
    background-color: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.report-tabs {
    display: flex;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}
.report-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.report-tabs .tab-btn:hover {
    color: var(--text-primary);
}
.report-tabs .tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}
.report-tabs .tab-btn .feather {
    width: 18px;
    height: 18px;
}

/* Disabled Tab for Guests */
.report-tabs .tab-btn.disabled {
    color: #cbd5e0;
    cursor: not-allowed;
}
.report-tabs .tab-btn.disabled:hover {
    border-bottom-color: transparent;
}

/* Tab Content */
.report-main-content .tab-content {
    display: none;
    padding: 2rem;
}
.report-main-content .tab-content.active {
    display: block;
}

/* Pro Feature Lock Screen */
.pro-feature-lock {
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--background-light);
    border-radius: 8px;
}
.pro-feature-lock h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0;
}
.pro-feature-lock p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Inspector styles remain largely the same, but now live inside the tab */
.inspector-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: flex-start;
}


/* --- NEW Table Row Dropdown Styling --- */

.expandable-row-trigger.is-expandable {
    cursor: pointer;
    transition: background-color 0.2s;
}
.expandable-row-trigger.is-expandable:hover {
    background-color: var(--background-light);
}

.expandable-row-trigger .expand-icon {
    width: 20px;
    height: 20px;
    float: right;
    color: var(--text-secondary);
    transition: transform 0.3s ease-in-out;
}

.expandable-row-trigger.active .expand-icon {
    transform: rotate(180deg);
}

/* The hidden details row */
.expandable-details-row {
    /* This is a trick to animate table rows - it's not possible directly */
    /* Instead, we animate the content inside the cell */
}

.expandable-details-row td {
    padding: 0; /* Remove default padding */
}

.expandable-details-row .link-table-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, margin 0.4s ease-in-out;
    margin: 0 1.5rem; /* Match the parent cell's padding */
}

.expandable-details-row.active .link-table-container {
    max-height: 400px; /* Animate to this height */
    overflow-y: auto;
    margin: 1rem 1.5rem; /* Add margin when open */
    border: 1px solid var(--border-color); /* Add a border to the inner table */
}

/* We don't want a border-bottom on the trigger row when it's open */
.expandable-row-trigger.active {
    border-bottom-color: transparent;
}

.expandable-details-row .details-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, margin 0.4s ease-in-out, padding 0.4s ease-in-out;
    margin: 0 1.5rem;
    padding: 0;
    background-color: var(--background-light);
    border-radius: 6px;
}

.expandable-details-row.active .details-content-wrapper {
    max-height: 400px; /* Animate to this height */
    overflow-y: auto;
    margin: 1rem 1.5rem; /* Add margin when open */
    padding: 1rem; /* Add padding when open */
    border: 1px solid var(--border-color);
}

/* Styles for the simple list inside the details row */
.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}
.details-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.details-list li:last-child {
    border-bottom: none;
}
.details-list .url-break {
    word-break: break-all;
    color: var(--text-secondary);
}

/* --- NEW STUNNING Broken Link Card Styling (for expandable row) --- */

.details-content-wrapper .broken-links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.broken-link-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--status-error); /* Red accent border */
    border-radius: 6px;
    padding: 1rem 1.5rem;
    transition: box-shadow 0.2s;
}
.broken-link-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.card-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card-url-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0; /* Important for text truncation */
}

.card-url-section .card-icon {
    width: 20px;
    height: 20px;
    color: var(--status-error);
    flex-shrink: 0;
}

.card-url-section a {
    font-weight: 600;
    color: var(--primary-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." */
    text-decoration: none;
}
.card-url-section a:hover {
    text-decoration: underline;
}

.card-status-section .status-pill {
    font-size: 0.9rem;
}

.card-context-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
}

.card-context-info strong {
    color: var(--text-primary);
}

.card-context-info span {
    font-style: italic;
}

/* --- 13. NEW Comparison Feature Styling --- */
.text-good { color: var(--status-success); }
.text-bad { color: var(--status-error); }
.stat-value.text-good { color: var(--status-success); }
.stat-value.text-bad { color: var(--status-error); }

.checklist-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.checklist-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.checklist-list li:last-child {
    border-bottom: none;
}
.no-change-text {
    color: var(--text-secondary);
    font-style: italic;
}

.comparison-table-container {
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-top: 2rem;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}
.comparison-table th, .comparison-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}
.comparison-table thead th {
    background-color: var(--background-light);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comparison-table thead th a {
    color: var(--primary-blue);
    text-decoration: underline;
}
.comparison-table tbody td:first-child {
    font-weight: 500;
    width: 25%;
}
.comparison-table tbody td {
    line-height: 1.6;
    color: var(--text-secondary);
}
.comparison-table .score-row td {
    font-size: 1.2rem;
    font-weight: 700;
}
/* --- NEW History Page Comparison Form Styling --- */

.history-form {
    background-color: var(--background-white);
    padding: 1rem 1.5rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.history-table .select-col {
    width: 80px;
    text-align: center;
}

.history-table input[type="checkbox"] {
    transform: scale(1.4);
    accent-color: var(--primary-blue); /* Modern way to color checkboxes */
    cursor: pointer;
}

.history-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.compare-notice {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-actions button:disabled {
    background-image: none;
    background-color: var(--border-color);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* --- 13. NEW, STUNNING Comparison Page Design --- */

/* Stat Cards Dashboard */
.comparison-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.comp-stat-card {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-bottom: 4px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.comp-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.comp-stat-values {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.comp-stat-values .old-value {
    color: var(--text-secondary);
}
.comp-stat-values .new-value {
    color: var(--text-primary);
}
.comp-stat-values .feather {
    width: 28px;
    height: 28px;
    color: var(--border-color);
}
.comp-stat-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.comp-stat-diff {
    display: inline-block;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
}
.comp-stat-diff.good {
    background-color: #e6f6eb;
    color: var(--status-success);
}
.comp-stat-diff.bad {
    background-color: #fdeaea;
    color: var(--status-error);
}

/* Issues Grid */
.issues-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.issue-card {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.issue-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.issue-card .feather {
    width: 20px;
    height: 20px;
}
.issue-card.fixed h3 .feather {
    color: var(--status-success);
}
.issue-card.new h3 .feather {
    color: var(--status-warning);
}
.issue-list {
    list-style-type: '✔ '; /* Custom list bullet */
    padding-left: 1.5rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.issue-card.new .issue-list {
    list-style-type: '✖ ';
}
.no-change-text {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    background-color: var(--background-light);
    border-radius: 6px;
    text-align: center;
}

@media (max-width: 900px) {
    .issues-grid {
        grid-template-columns: 1fr;
    }
}

/* --- NEW Comparison Page Enhancements --- */

/* Header with Action Button */
.content-header.with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligns items to the top */
    gap: 1.5rem;
}
.content-header.with-action .header-text {
    flex-grow: 1;
}
.content-header.with-action .header-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.content-header.with-action .header-actions .btn .feather {
    width: 18px;
    height: 18px;
}

/* Table Section Headers */
.comparison-table .table-section-header td {
    background-color: var(--background-light);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--border-color); /* Add a thicker top border for separation */
}

/* --- NEW Master Dashboard Styling --- */

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* 50% for chart, 25% for the other two cards */
    gap: 1.5rem;
    align-items: flex-start;
}

.dashboard-card {
    background-color: var(--background-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.chart-card {
    grid-column: 1 / 2;
    grid-row: 1 / 3; /* Make the chart card span two rows */
}



.empty-list {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem 0;
}

/* Keyword List Styling */
.keyword-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.keyword-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}
.keyword-text {
    font-weight: 500;
    color: var(--text-primary);
}
.keyword-rank {
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: center;
}
.keyword-rank.score-good { background-color: #e6f6eb; color: var(--status-success); }
.keyword-rank.score-average { background-color: #fffaf0; color: var(--status-warning); }

/* Last Analysis Summary Styling */
.last-analysis-summary .summary-url {
    font-weight: 600;
    color: var(--primary-blue);
    display: block;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.last-analysis-summary .summary-score {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.last-analysis-summary .score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}
.last-analysis-summary .score-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.summary-checklist strong {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--status-error);
}
.summary-checklist ul {
    list-style-type: '✖ ';
    padding-left: 1.5rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive for the new grid */
@media (max-width: 1200px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr 1fr;
    }
    .chart-card {
        grid-column: 1 / -1; /* Chart takes full width */
        grid-row: 1 / 2;
    }
}
@media (max-width: 768px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr; /* Stack all cards */
    }
}

/* --- NEW Master Dashboard Enhancement Styles --- */

.dashboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.dashboard-card .card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.dashboard-card .btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1; /* Fix icon alignment */
}
.dashboard-card .btn-small .feather {
    width: 14px;
    height: 14px;
}

.view-all-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-blue);
}


/* --- NEW Features Page Styling --- */

.page-content.static-page {
    padding-bottom: 4rem; /* More space at the bottom */
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}
.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.feature-category-section {
    margin-bottom: 4rem;
}
.feature-category-section h2 {
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary-blue);
    margin-bottom: 2.5rem;
    position: relative;
}
.feature-category-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-blue);
    margin: 10px auto 0;
    border-radius: 2px;
}


.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.feature-card .feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-image: linear-gradient(45deg, #377dff, #8040f2);
    color: var(--background-white);
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
}
.feature-card .feature-icon .feather {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.sub-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.sub-features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.sub-features-list li:last-child {
    border-bottom: none;
}
.sub-features-list .feather {
    width: 18px;
    height: 18px;
    color: var(--status-success); /* Green checkmark */
    flex-shrink: 0;
}

/* --- NEW Collapsible Checklist Styling --- */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checklist-accordion-item {
    background-color: var(--background-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}
.checklist-accordion-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.checklist-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
}
.checklist-header span {
    flex-grow: 1; /* Pushes chevron to the right */
}
.checklist-header.passed { color: var(--status-success); }
.checklist-header.failed { color: var(--status-error); }

.checklist-header .feather {
    width: 20px;
    height: 20px;
}
.checklist-header .accordion-icon {
    transition: transform 0.3s ease-in-out;
    color: var(--text-secondary);
}
.checklist-accordion-item.active .checklist-header .accordion-icon {
    transform: rotate(180deg);
}

.checklist-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding: 0 1.5rem;
}
.checklist-accordion-item.active .checklist-content {
    max-height: 1000px; /* Animate to this height */
    padding: 0 1.5rem 1.5rem;
}

.insight-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.insight-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}
.insight-pill.passed {
    background-color: #e6f6eb;
    color: #2a6f44;
}
.insight-pill.failed {
    background-color: #fdeaea;
    color: #a52828;
}
.insight-pill .feather {
    width: 16px;
    height: 16px;
}
.no-items-in-list {
    font-style: italic;
    color: var(--text-secondary);
    padding: 1rem;
}

/* --- NEW Freemium Prompt Styling --- */

.result-with-freemium-prompt > span {
    display: block; /* Ensure the main text is on its own line */
    margin-bottom: 0.75rem;
}

.freemium-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    background-color: var(--background-light);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.freemium-cta span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.link-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: underline;
}
.link-cta:hover {
    color: var(--primary-blue-darker);
}

/* Extra small button variant */
.btn.btn-x-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- NEW Recommendation Card Styling --- */
.recommendation-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.recommendation-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.recommendation-card-header .feather {
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
}
.recommendation-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.recommendation-card-subtitle {
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.recommendation-block {
    padding: 1rem 1.5rem 1.5rem;
}
.recommendation-block + .recommendation-block {
    border-top: 1px dashed var(--border-color);
}
.recommendation-block h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.recommendation-block p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-block-wrapper {
    position: relative;
}
.code-block-wrapper pre {
    margin: 0;
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
}
.copy-code-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(74, 85, 104, 0.5);
    border: 1px solid #4a5568;
    color: #cbd5e0;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-code-btn:hover {
    background-color: #4a5568;
    color: #fff;
}
.copy-code-btn.copied {
    background-color: var(--status-success);
    color: #fff;
    border-color: var(--status-success);
}

/* --- NEW Freemium Lock Styling for Recommendation Card --- */

/* The recommendation-card needs a position relative for the overlay */
.recommendation-card {
    position: relative;
    overflow: hidden; /* Important for blurred effect */
}

/* The blurred effect for the background content */
.recommendation-card .blurred {
    filter: blur(5px);
    -webkit-filter: blur(5px);
    user-select: none;
    pointer-events: none; /* Make content unclickable */
}

/* The overlay that contains the call to action */
.freemium-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}
.lock-content {
    max-width: 500px;
}
.lock-content .feather {
    width: 48px;
    height: 48px;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}
.lock-content h3 {
    margin: 0 0 0.75rem;
    font-size: 1.3rem;
    color: var(--text-primary);
}
.lock-content p {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.lock-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- NEW Styling for Visual Inspector Freemium Lock --- */

.freemium-lock-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-height: 250px; /* ajustează valoarea după preferință */
}

.blurred-placeholder {
    /* This creates a blurred preview of the feature */
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    padding: 4rem 2rem;
    text-align: center;
    filter: blur(5px);
    -webkit-filter: blur(5px);
    user-select: none;
    pointer-events: none;
}
.blurred-placeholder p {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Ensure the overlay covers the wrapper */
.freemium-lock-wrapper .freemium-lock-overlay {
    position: absolute;
    /* The rest of the .freemium-lock-overlay styles you already have will apply */
}

/* --- NEW "My Account" Page Styling --- */
.account-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.current-plan-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}
.plan-status {
    font-weight: 600;
    color: var(--status-success);
}
.account-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.action-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color 0.2s;
}
.action-link:hover {
    background-color: var(--background-light);
}
.action-link .feather {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.usage-item h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}
.usage-bar-wrapper {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.usage-bar {
    height: 100%;
    background-image: linear-gradient(90deg, #377dff, #8040f2);
    border-radius: 4px;
}
.usage-text {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
}
.usage-text span {
    font-weight: 500;
    color: var(--text-primary);
}
.usage-text small {
    color: var(--text-secondary);
}

/* --- 12. NEW, RELIABLE "Modern Settings Page" Design --- */

.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.settings-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.settings-card-content {
    padding: 1.5rem;
}

/* Profile Info Display from previous design (still works perfectly here) */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.detail-item {
    background-color: var(--background-light);
    padding: 1rem;
    border-radius: 6px;
}
.detail-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.detail-item strong {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-card .settings-form {
    max-width: 500px;
}

/* Danger Zone */
.settings-card.danger-zone {
    border-color: var(--status-error);
    background-color: #fff5f5;
}
.settings-card.danger-zone .settings-card-header {
    background-color: #fdeaea;
}
.settings-card.danger-zone h3 {
    color: #a52828;
}
.settings-card.danger-zone p {
    color: #a52828;
    font-weight: 500;
}
.btn-danger { /* Make sure this is defined globally or here */
    background-image: none;
    background-color: var(--status-error);
}
.btn-danger:hover {
    background-color: #c53030;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.2);
}

/* --- NEW, PROFESSIONAL Danger Button Styling --- */

/* Base style for the danger button */
.btn.btn-danger {
    /* Default "ghost button" state */
    background-color: transparent;
    border: 1px solid var(--status-error);
    color: var(--status-error);
    box-shadow: none; /* Remove any default primary button shadow */
    transition: all 0.2s ease-in-out;
}

/* Hover state - fills with color and glows */
.btn.btn-danger:hover {
    background-color: var(--status-error);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -5px rgba(229, 62, 62, 0.5);
}

/* Active state - "push down" effect */
.btn.btn-danger:active {
    transform: translateY(0);
    background-color: #c53030; /* Darker red */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* --- NEW Enhanced Admin Dashboard Styling --- */

/* Stat Card Changes */
.stat-card {
    position: relative;
    padding-bottom: 2.5rem; /* Space for the change indicator */
}
.stat-change {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.stat-change.good { color: var(--status-success); }
.stat-change.bad { color: var(--status-error); }

/* Activity Feed */
.activity-feed td {
    padding: 1rem 1.5rem;
}
.activity-icon {
    width: 50px;
    text-align: center;
}
.activity-icon .feather {
    width: 24px;
    height: 24px;
}
.activity-icon .good { color: var(--status-success); }
.activity-icon .info { color: var(--primary-blue); }
.activity-feed em {
    color: var(--text-secondary);
    font-style: normal;
    word-break: break-all;
}
.activity-time {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* User Management Table */
.user-management-table .action-cell {
    text-align: right;
    white-space: nowrap;
}
.action-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    margin-left: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
}
.action-btn:hover {
    background-color: var(--background-light);
    color: var(--text-primary);
}
.action-btn.danger:hover {
    color: var(--status-error);
}

/* Impersonation Banner */
.impersonation-banner {
    background-color: var(--status-warning);
    color: #fff;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
}
.impersonation-banner .banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.impersonation-banner a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}


/* --- NEW Enhanced Admin Dashboard Styling --- */

.admin-section {
    margin-top: 2.5rem;
}

.health-grid {
    grid-template-columns: 1fr 1fr; /* Two columns for health cards */
    gap: 1rem;
}

.health-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 1rem; /* Remove extra space from stat-card */
}
.health-card .stat-value {
    font-size: 2.5rem;
}
.health-card .stat-label {
    font-size: 1rem;
}
.health-card.good {
    border-left: 4px solid var(--status-success);
}
.health-card.warning {
    border-left: 4px solid var(--status-warning);
}
.health-card .stat-change {
    display: none; /* Hide the 24h change for these cards */
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Activity feed is wider */
    gap: 2rem;
    margin-top: 2.5rem;
}

.activity-feed em {
    max-width: 300px; /* Prevent long URLs from breaking layout */
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

@media (max-width: 1200px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .health-grid {
        grid-template-columns: 1fr;
    }
}

/* --- NEW User Details Page Styling --- */

.user-details-layout {
    display: grid;
    grid-template-columns: 350px 1fr; /* Sidebar on left, main content on right */
    gap: 2rem;
    align-items: flex-start;
}

.user-details-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.settings-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.settings-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}
.settings-card-content {
    padding: 1.5rem;
}

.user-details-actions {
    display: flex;
    gap: 1rem;
}
.user-details-actions .btn {
    flex-grow: 1;
}

@media (max-width: 1024px) {
    .user-details-layout {
        grid-template-columns: 1fr;
    }
}

/* --- NEW Admin Dashboard Link Styling --- */
.user-detail-link {
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: none;
}
.user-detail-link:hover {
    text-decoration: underline;
}

/* Ensure table cells with links align properly */
.activity-feed td,
.admin-table td {
    vertical-align: middle;
}

/* --- NEW, PROFESSIONAL Button Design System --- */

/* Base .btn style for all buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none; /* For <a> tags styled as buttons */
    white-space: nowrap;

    /* Smooth transition for all effects */
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Prevent text selection on rapid clicks */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.btn .feather {
    width: 18px;
    height: 18px;
}

/* 1. Primary Button (Gradient & Glow) */
.btn-primary {
    background-image: linear-gradient(135deg, #4F46E5 0%, #8040f2 100%); /* Indigo to Purple */
    color: #fff;
    box-shadow: 0 4px 15px -5px rgba(79, 70, 229, 0.4);
     text-align: center;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px -5px rgba(128, 64, 242, 0.5);
}
.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px -3px rgba(128, 64, 242, 0.4);
}
.btn-primary:disabled {
    background-image: none;
    background-color: var(--border-color);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 2. Secondary Button (Clean & Subtle) */
.btn-secondary {
    background-color: var(--background-white);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: var(--background-light);
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px -4px rgba(0,0,0,0.1);
}
.btn-secondary:active {
    transform: translateY(0);
    background-color: #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* 3. Danger Button (Cautious & Clear) */
.btn-danger {
    background-color: transparent;
    border-color: rgba(229, 62, 62, 0.3);
    color: var(--status-error);
}
.btn-danger:hover {
    background-color: var(--status-error);
    border-color: var(--status-error);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -5px rgba(229, 62, 62, 0.5);
}
.btn-danger:active {
    transform: translateY(0);
    background-color: #c53030; /* Darker red */
    border-color: #c53030;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Auth button can be an alias for primary */
.btn-auth {
    width: 100%;
    /* Inherits styles from .btn and .btn-primary, just add this if needed */
}

/* --- NEW, STUNNING "Upgrade Opportunity" Card Styling --- */

.upgrade-card-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.upgrade-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 2.5rem;
    text-align: center;
    max-width: 550px;

    /* Subtle animation on appear */
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upgrade-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-image: linear-gradient(45deg, #377dff, #8040f2);
    color: var(--background-white);
    display: grid;
    place-items: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 15px rgba(55, 125, 255, 0.3);
}
.upgrade-card-icon .feather {
    width: 32px;
    height: 32px;
}

.upgrade-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.upgrade-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.upgrade-card .subtitle {
    font-weight: 500;
    color: var(--text-primary);
}

.upgrade-card-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}
.upgrade-card-actions .btn-large {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
}

.view-plans-link {
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s;
}
.view-plans-link:hover {
    color: var(--primary-blue);
}


/* --- NEW Content Template Tool Styling --- */
.content-template-dashboard {
  margin-top: 2.5rem;
}
.template-header {
  text-align: center;
  margin-bottom: 2rem;
}
.template-header h2 {
  font-size: 1.8rem;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.template-card {
  background-color: var(--background-white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.template-card.full-width {
  grid-column: 1 / -1;
}
.template-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.template-card p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.keyword-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.keyword-pill {
  background-color: var(--background-light);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

/* Re-use link table styles from other pages for consistency */
.template-card .link-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 1rem;
}

.headings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}
.headings-list li {
  padding: 0.5rem;
  border-radius: 4px;
}
.headings-list li:nth-child(odd) {
  background-color: var(--background-light);
}

/* --- NEW "Content Blueprint" Design --- */
.template-card.summary-targets {
    background-image: linear-gradient(45deg, #ebf8ff, #f7fafc);
    border: 1px solid var(--primary-blue);
    margin-bottom: 2.5rem;
}
.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.target-item {
    text-align: center;
}
.target-item .feather {
    width: 32px;
    height: 32px;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
}
.target-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.target-item strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.competitor-url {
    display: block;
    font-size: 0.85rem;
    color: var(--status-success);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

/* --- NEW STYLES FOR COMPARE PAGE --- */

.compare-page .content-header {
    text-align: center;
    margin-bottom: 2rem;
}

.compare-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.compare-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.compare-form .form-group {
    display: flex;
    flex-direction: column;
}
.compare-form label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.compare-form input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
}
.compare-form button {
    align-self: center;
    padding: 12px 30px;
    font-size: 1.1rem;
}

.comparison-results-container {
    margin-top: 2rem;
}

.comparison-summary-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.summary-card-compare {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.compare-url-link {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-score-wrapper {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 1rem;
}
.compare-score-value {
    font-size: 3.5rem;
    font-weight: 700;
}
.compare-score-label {
    font-size: 1.5rem;
    font-weight: 500;
    color: #6c757d;
    margin-left: 5px;
}

.compare-checklist-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}
.compare-checklist-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.compare-checklist-stats .passed { color: #1a7f37; }
.compare-checklist-stats .failed { color: #b31d1d; }

.vs-separator {
    font-size: 2rem;
    font-weight: 700;
    color: #ced4da;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}
.comparison-table th,
.comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}
.comparison-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}
.comparison-table tbody td:nth-child(2),
.comparison-table tbody td:nth-child(3) {
    text-align: center;
    font-weight: 500;
}

.comparison-table .category-header td {
    background-color: #f1f3f5;
    font-weight: 700;
    text-align: left;
    color: var(--primary-color);
}

.comparison-table td.winner {
    background-color: #d1f7d9;
    font-weight: 700;
    color: #0d6b23;
    border-radius: 4px;
}
.error-message {
    color: #b31d1d;
    background-color: #fce3e3;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compare-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .comparison-summary-grid {
        grid-template-columns: 1fr;
    }
    .vs-separator {
        transform: rotate(90deg);
    }
}

/* --- NEW: Style for the limit error box on compare page --- */
.limit-error-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}
.limit-error-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #664d03;
}
.limit-error-box p {
    margin-bottom: 1.5rem;
}
.limit-error-box .btn-auth {
    background-color: var(--primary-color);
    color: #fff;
}

/* ==================================================== */
/* "BLUEPRINT" - SIMPLE & CLEAN CSS FOR COMPARE PAGE    */
/* ==================================================== */

.compare-wrapper-clean {
    background-color: #f8f9fa; /* Light grey background */
    border: 1px solid #e9ecef;
    padding: 2rem;
    border-radius: 16px;
}

.compare-form-clean {
    width: 100%;
}

.compare-grid-clean {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch; /* Makes cards equal height */
    gap: 2rem;
    margin-bottom: 2rem;
}

.compare-card-clean {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column; /* This is key for the layout */
}

.card-header-clean {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-header-clean h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #343a40;
}

.card-header-clean i {
    color: var(--primary-color);
    width: 20px;
    height: 20px;
}

.card-body-clean {
    flex-grow: 1; /* This makes the body fill the card's vertical space */
    display: flex; /* So we can use margin:auto below */
}

.input-group-clean {
    position: relative;
    width: 100%;
    margin-top: auto; /* This pushes the input to the very bottom */
}

.input-group-clean i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    width: 18px;
    height: 18px;
}

.input-group-clean input[type="url"] {
    width: 90%;
    padding: 12px 12px 12px 40px; /* Padding for the icon */
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group-clean input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.2);
}

.separator-clean {
    display: flex;
    align-items: center;
    justify-content: center;
}

.separator-clean span {
    color: #adb5bd;
    font-weight: 600;
    font-size: 1.1rem;
}

.form-action-clean {
    display: flex;
    justify-content: center;
}

.btn-submit-clean {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-submit-clean:hover {
    background-color: #2c6ad4; /* Slightly darker shade of primary */
    transform: translateY(-2px);
}
.btn-submit-clean i {
    width: 18px;
    height: 18px;
}


/* Responsive Design */
@media (max-width: 992px) {
    .compare-grid-clean {
        grid-template-columns: 1fr; /* Stack on smaller screens */
        gap: 1.5rem;
    }

    .separator-clean {
        padding: 0.5rem 0;
    }
}

/* --- NEW: Styles for dynamic CTA in results table --- */

.btn-cta-small {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-cta-small:hover {
    background-color: #2c6ad4; /* A slightly darker primary color */
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-cta-small i {
    width: 14px;
    height: 14px;
}

/* --- STYLES FOR ICONS IN MAIN NAVIGATION --- */

.main-nav.desktop-nav ul li a {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Adjust the space between icon and text */
}

.main-nav.desktop-nav ul li a i {
    width: 18px;  /* Adjust icon size */
    height: 18px;
    stroke-width: 2px;
}

/* Style for the language switcher icon */
.language-switcher-nav-item {
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 8px;
}
.language-switcher-nav-item i {
    width: 18px;
    height: 18px;
    color: #6c757d; /* A neutral color */
}

/* --- CSS for the Final CTA Section --- */
.final-cta-section {
    padding: 6rem 1.5rem;
    background-color: #f8fafc; /* A very light grey background for the whole section */
    overflow: hidden; /* Important for containing the shapes */
}

.cta-container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: #111827; /* Dark background for the card */
    color: #fff;
    border-radius: 24px;
    padding: 4rem 3rem;
    position: relative;
    overflow: hidden; /* Hide overflowing parts of the shapes */
}

/* Background decorative shapes */
.cta-background-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none; /* Make them unclickable */
}
.shape-1 {
    width: 400px;
    height: 400px;
    background-color: #3b82f6;
    top: -150px;
    left: -150px;
}
.shape-2 {
    width: 300px;
    height: 300px;
    background-color: #8b5cf6;
    bottom: -100px;
    right: 100px;
}
.shape-3 {
    width: 200px;
    height: 200px;
    background-color: #10b981;
    top: 50px;
    right: -80px;
}

/* Main content that sits above the shapes */
.cta-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.cta-main-panel {
    text-align: left;
}

.cta-icon-flare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}
.cta-icon-flare i {
    color: #60a5fa; /* A lighter blue */
    width: 28px;
    height: 28px;
}

.cta-main-panel h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.cta-main-panel p {
    font-size: 1.125rem;
    color: #d1d5db; /* Lighter grey for better readability */
    margin-bottom: 2rem;
    max-width: 500px;
}

.cta-primary-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #3b82f6;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.cta-primary-button:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}
.cta-primary-button i {
    transition: transform 0.2s ease-in-out;
}
.cta-primary-button:hover i {
    transform: translateX(4px);
}

.cta-subtext {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.cta-features-panel {
    border-left: 1px solid #374151; /* Separator line */
    padding-left: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cta-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: #e5e7eb;
}
.cta-feature-item i {
    color: #10b981; /* Green checkmark */
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .cta-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cta-main-panel {
        text-align: center;
    }
    .cta-main-panel p {
        margin-left: auto;
        margin-right: auto;
    }
    .cta-features-panel {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #374151;
        padding-top: 3rem;
        align-items: center;
    }
    .cta-feature-item {
        max-width: 350px;
        text-align: left;
    }
}



/* =================================== */
/* V2 RESULTS DASHBOARD STYLES         */
/* =================================== */

:root {
    --color-pass: #28a745;
    --color-warn: #ffc107;
    --color-fail: #dc3545;
    --color-bg-light: #ffffff;
    --color-bg-offwhite: #f8f9fa;
    --color-border: #dee2e6;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.results-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    background: var(--color-bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--color-border);
}

/* --- Grid for Score and Priority --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

/* --- Score Card --- */
.score-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--color-pass) calc(var(--score-percent) * 1%), #ededed 0);
    margin-bottom: 1rem;
    transition: background 1.5s ease-out;
}
.score-value {
    width: 110px;
    height: 110px;
    background: var(--color-bg-light);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-pass);
}
.score-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}
.score-card p {
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* --- Top Priority Card --- */
.top-priority-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #fff9e6;
    border-color: var(--color-warn);
}
.top-priority-card .card-icon { color: var(--color-warn); }
.top-priority-card .card-icon svg { width: 40px; height: 40px; }
.top-priority-card h3 { margin: 0 0 0.5rem 0; font-size: 1.2rem; }
.top-priority-card p { margin: 0; color: var(--color-text-muted); }


/* --- Summary Stats --- */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}
.stat-card svg { width: 36px; height: 36px; margin-bottom: 0.75rem; }
.stat-number { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.status-pass { border-left: 5px solid var(--color-pass); }
.status-warn { border-left: 5px solid var(--color-warn); }
.status-fail { border-left: 5px solid var(--color-fail); }
.stat-card.status-pass .stat-number, .stat-card.status-pass svg { color: var(--color-pass); }
.stat-card.status-warn .stat-number, .stat-card.status-warn svg { color: var(--color-warn); }
.stat-card.status-fail .stat-number, .stat-card.status-fail svg { color: var(--color-fail); }


/* --- Accordion Checklist --- */
.detailed-checklist h3 { margin-bottom: 1rem; }
.seo-accordion { display: flex; flex-direction: column; gap: 0.5rem; }
.accordion-item { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: var(--color-bg-offwhite);
    font-weight: 600;
    transition: background-color 0.2s;
}
.accordion-header:hover { background-color: #e9ecef; }
.accordion-icon { transition: transform 0.3s ease; }
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background: var(--color-bg-light);
    padding: 0 1rem;
}

.checklist-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
}
.checklist-row:last-child { border-bottom: none; }
.checklist-row-icon svg { width: 20px; height: 20px; margin-top: 2px; }
.checklist-row.status-pass .checklist-row-icon { color: var(--color-pass); }
.checklist-row.status-warn .checklist-row-icon { color: var(--color-warn); }
.checklist-row.status-fail .checklist-row-icon { color: var(--color-fail); }
.checklist-row-content strong { display: block; margin-bottom: 0.25rem; }
.checklist-row-content p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

/* CSS - Example adjustments */
.analysis-loading-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999; /* higher than anything else */
    display: flex;
    align-items: center;
    justify-content: center;
}



.spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%; /* Makes it a circle */

  /* The gray ring */
  border: 5px solid #e0e0e0;

  /* The colored part of the ring that will spin */
  border-top-color: #3498db;

  /* The animation */
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================= */
/* HOW IT WORKS - ENHANCED CSS-ONLY VERSION  */
/* ========================================= */

/* --- New variables for a modern, dark theme --- */
:root {
    --hiw-bg: #111827; /* Dark blue/gray background */
    --hiw-card-bg: #1f2937; /* Slightly lighter card background */
    --hiw-primary: #4f46e5; /* A vibrant indigo for accents */
    --hiw-text-bright: #f9fafb; /* Off-white for titles */
    --hiw-text-muted: #9ca3af; /* Gray for descriptions */
    --hiw-border-color: #374151;
}

/* --- Keyframe Animations (The magic for no-JS animation) --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawLine {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}


/* --- Main Section Container --- */
.how-it-works-section {
    padding: 100px 0;
    background-color: var(--hiw-bg);
    text-align: center;
    overflow: hidden; /* Hide elements before they animate in */
}

.how-it-works-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Section Header: Title, Subtitle, Description --- */
.section-subtitle {
    display: inline-block;
    padding: 6px 15px;
    background-color: rgba(79, 70, 229, 0.15);
    color: var(--hiw-primary);
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--hiw-primary);
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--hiw-text-bright);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-description {
    font-size: 1.1rem;
    color: var(--hiw-text-muted);
    max-width: 700px;
    margin: 0 auto 60px auto;
    line-height: 1.7;
}

/* --- The Grid for the Cards --- */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative; /* For the connector line */
}

/* --- The Animated Connector Line (CSS-Only) --- */
.how-it-works-grid::after {
    content: "";
    position: absolute;
    top: 52px; /* Vertically align with the center of the icons */
    left: 15%;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, var(--hiw-primary), rgba(79, 70, 229, 0.5));
    z-index: 1;
    transform-origin: left;

    /* Attach the animation */
    animation: drawLine 1s cubic-bezier(0.65, 0, 0.35, 1) 0.8s forwards;
    /* (animation-name, duration, timing-function, delay, fill-mode) */
}

/* --- The Individual Cards --- */
.how-it-works-card {
    background-color: var(--hiw-card-bg);
    border: 1px solid var(--hiw-border-color);
    border-radius: 16px;
    padding: 35px;
    text-align: left;
    position: relative;
    z-index: 2; /* Cards are above the connector line */
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Attach the base animation */
    opacity: 0; /* Start invisible */
    animation: fadeInUp 0.7s ease-out forwards;
}

/* --- Staggered Animation Delay --- */
.how-it-works-card:nth-of-type(1) {
    animation-delay: 0.2s;
}
.how-it-works-card:nth-of-type(2) {
    animation-delay: 0.4s;
}
.how-it-works-card:nth-of-type(3) {
    animation-delay: 0.6s;
}

/* --- Premium Hover Effect --- */
.how-it-works-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* --- Card Content --- */
.how-it-works-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.how-it-works-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--hiw-primary);
    color: #fff;
    display: grid;
    place-items: center;
    transition: transform 0.3s ease;
}
.how-it-works-card:hover .card-icon {
    transform: scale(1.1);
}
.how-it-works-card .card-icon i svg { width: 30px; height: 30px; }

.how-it-works-card .card-step-number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #4b5563, #1f2937);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.how-it-works-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hiw-text-bright);
    margin-bottom: 12px;
}

.how-it-works-card p {
    color: var(--hiw-text-muted);
    line-height: 1.7;
    margin: 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .section-title { font-size: 2.5rem; }
    /* Hide the connector line on tablets and below */
    .how-it-works-grid::after { display: none; }
}

@media (max-width: 767px) {
    .how-it-works-section { padding: 60px 0; }
    .section-title { font-size: 2.1rem; }
    .how-it-works-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }
}


/* --- 3. NEW "ARCHITECTURAL CLARITY V2" Header Design --- */

.site-header {
  position: sticky; top: 0; z-index: 1000;
  width: 100%;
  background-color: #ffffff; /* Clean white background */
  border-bottom: 1px solid var(--border-color); /* Subtle bottom border */
  padding: 0 2rem;
  box-sizing: border-box;
  transition: box-shadow 0.3s, border-color 0.3s;
  display: flex; /* Ensure full width flex */
  justify-content: space-between;
  align-items: center;
  height: 72px;
}
.site-header.scrolled {
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Soft shadow on scroll */
  border-bottom-color: var(--border-color);
}
/* No header-container needed anymore, elements directly flex */

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem; /* Wider gap between logo and nav */
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* Standard gap for right-side actions */
}

/* Logo */
.header-logo a {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-blue);
  transition: transform 0.2s;
}
.header-logo a:hover {
  transform: scale(1.05);
}

/* Desktop Navigation */
.main-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.75rem; }
.main-nav a {
  font-size: 1rem; font-weight: 500; color: var(--text-secondary);
  padding: 0.5rem 1rem; border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--text-primary); background-color: var(--background-light); }
.main-nav a.active { color: var(--primary-blue); background-color: #ebf8ff; font-weight: 600; }
.main-nav .admin-link a.active { background-color: #fffaf0; color: #dd6b20; }

/* Universal Button Styles (Primary & Secondary are defined in global styles) */
/* .btn, .btn-primary, .btn-secondary, etc. styles are typically defined globally
 and not repeated here. Ensure these are defined in your common CSS. */

/* NEW Language Switcher within Nav */
.language-switcher-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Space between EN | RO */
  margin-left: 1.5rem; /* Space from last nav item */
  padding: 0.5rem 0; /* Align with nav links */
}
.language-switcher-nav-item .lang-text-link {
  font-size: 0.9rem; /* Slightly smaller than main nav */
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.language-switcher-nav-item .lang-text-link:hover {
  color: var(--primary-blue);
}
.language-switcher-nav-item .lang-text-link.active {
  color: var(--primary-blue);
  font-weight: 700; /* More emphasis on active */
}
.language-switcher-nav-item .lang-separator {
  color: var(--border-color); /* Vertical line color */
}

/* User Profile Dropdown */
.user-profile { position: relative; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: var(--background-light); border: 1px solid var(--border-color); color: var(--text-primary); display: grid; place-items: center; font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.user-profile:hover .user-avatar, .user-profile.active .user-avatar { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.2); }
/* Generic Dropdown styles */
.dropdown-trigger { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); right: 0; width: 220px;
  background-color: #fff; border: 1px solid var(--border-color);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 1000; padding: 0.5rem; opacity: 0;
  transform: translateY(10px); visibility: hidden;
  transition: all 0.2s ease-out;
}
.dropdown-trigger.active .dropdown-menu { opacity: 1; transform: translateY(0); visibility: visible; }
/* User dropdown specific styles */
.user-dropdown .dropdown-header { padding: 0.75rem 1rem; color: var(--text-secondary); font-size: 0.9rem; border-bottom: 1px solid var(--border-color); margin-bottom: 0.5rem; }
.user-dropdown .dropdown-header strong { color: var(--text-primary); }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 6px; font-weight: 500; color: var(--text-primary); }
.dropdown-item:hover { background-color: var(--background-light); }
.dropdown-item .feather { width: 18px; height: 18px; color: var(--text-secondary); }
.dropdown-item.logout-link { color: var(--status-error); }
.dropdown-item.logout-link:hover { background-color: #fdeaea; }
.dropdown-item.logout-link .feather { color: var(--status-error); }

/* Mobile Menu (Hamburger Icon & Panel) */
.hamburger-menu { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--text-primary); }
.hamburger-menu:hover { background-color: var(--background-light); border-radius: 6px; }
.mobile-menu-panel { position: fixed; top: 0; right: -100%; width: 100%; max-width: 320px; height: 100%; background-color: var(--background-white); z-index: 2001; padding: 1.5rem; box-shadow: -5px 0 25px rgba(0,0,0,0.1); transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1); display: flex; flex-direction: column; }
.mobile-menu-panel.active { right: 0; }
.mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s; }
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1rem; }
.mobile-menu-header h4 { margin: 0; color: var(--text-primary); }
.close-menu { background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--text-secondary); }
.mobile-nav { flex-grow: 1; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav li a { display: block; padding: 0.75rem 0; font-size: 1.2rem; font-weight: 500; color: var(--text-primary); }
.mobile-nav li a:hover { color: var(--primary-blue); }
.mobile-menu-footer { display: flex; flex-direction: column; gap: 1rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.mobile-menu-footer .btn { width: 100%; box-sizing: border-box; }

/* Responsive Breakpoint */
@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .hamburger-menu { display: block; }
}

/* --- POLISHED THEME SWITCHER STYLES --- */

/* The "Pill" container that holds the buttons */
.embed-theme-switcher {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background-color: #f3f4f6; /* A very light, neutral grey */
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* Base styles for each theme button */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    padding: 8px 16px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;

    color: #4A5568; /* A sophisticated medium-dark grey for inactive text */
    background-color: transparent;
    border: none;
    border-radius: 9px; /* Rounded to fit nicely inside the container */
    cursor: pointer;

    /* Smooth transition for a professional feel */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle hover effect for the INACTIVE button */
.theme-btn:not(.active):hover {
    color: #1A202C; /* Darken text on hover */
}

/* --- The Active State --- */
.theme-btn.active {
    background-color: #ffffff;
    color: #1A202C; /* A strong, dark color for selected text */
    font-weight: 600;

    /* A soft shadow to make the active button "pop" */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Ensure Feather icons are sized and aligned properly */
.theme-btn i {
    width: 16px;
    height: 16px;
    /* This line helps if icons are slightly misaligned vertically */
    stroke-width: 2.5;
}
