/* IndexPilot Premium CSS Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS VARIABLES & THEMES --- */
:root {
    --primary-color: #3955A2;
    --primary-hover: #2d4380;
    --primary-rgb: 57, 85, 162;
    
    /* Light Theme (Default) */
    --bg-color: #f6f8fc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-bg: #ffffff;
    --sidebar-active: #f1f5f9;
    --shadow-color: rgba(0, 0, 0, 0.04);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error-bg: rgba(239, 68, 68, 0.1);
    
    --border-radius: 16px;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-active: #334155;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-hover: rgba(0, 0, 0, 0.3);
}

/* --- GENERAL RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.25;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* --- LAYOUTS: PUBLIC MAIN --- */
.main-header {
    background: rgba(var(--bg-color), 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.logo img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff !important;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--sidebar-active);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--error);
    color: white !important;
}
.btn-danger:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

/* --- HERO SECTION --- */
.hero {
    padding: 8rem 1.5rem 6rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- SECTIONS: HOW IT WORKS --- */
.section {
    padding: 5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

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

/* Timeline Cards */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 2rem 3rem;
    position: relative;
    background: transparent;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--card-bg);
    border: 4px solid var(--primary-color);
    top: 2.5rem;
    border-radius: 50%;
    z-index: 1;
}

.timeline-left {
    left: 0;
    text-align: right;
}

.timeline-right {
    left: 50%;
}

.timeline-right::after {
    left: -8px;
}

.timeline-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: var(--transition);
}
.timeline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px var(--shadow-hover);
}

.timeline-card .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    font-weight: 800;
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* --- PRICING GRID --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pricing-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px var(--shadow-hover);
    border-color: var(--primary-color);
}

.pricing-card.popular {
    border: 2px solid var(--primary-color);
}

.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
}

.price {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 800;
    margin: 1.5rem 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

/* --- FOOTER --- */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 1.5rem 2rem;
    text-align: center;
    background-color: var(--card-bg);
    color: var(--text-muted);
}

/* --- LAYOUTS: DASHBOARD STYLE --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
}

.sidebar-item.active a, .sidebar-item a:hover {
    background-color: var(--sidebar-active);
    color: var(--text-color);
}

.sidebar-item.active a {
    color: var(--primary-color);
    font-weight: 600;
}

.dashboard-content {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* --- STATS CARD GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    position: relative;
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-hover);
}

.stats-card .card-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stats-card .card-value {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 800;
}

.stats-card.success-rate .card-value { color: var(--success); }
.stats-card.failed-urls .card-value { color: var(--error); }

/* --- FORMS & DIALOGUES --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 280px;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger { border-left-color: var(--error); }

/* --- DATA TABLES --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.table th, .table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--sidebar-active);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table tbody tr:hover {
    background-color: var(--sidebar-active);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-danger { background-color: var(--error-bg); color: var(--error); }

/* --- DARK / LIGHT SWITCHER BUTTON --- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-muted);
    transition: var(--transition);
}
.theme-toggle:hover {
    background-color: var(--sidebar-active);
    color: var(--text-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- RESPONSIBILITY (MOBILE FIRST) --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .dashboard-content {
        margin-left: 0;
    }
    .timeline::after {
        left: 2rem;
    }
    .timeline-item {
        width: 100%;
        text-align: left !important;
        padding-left: 4rem;
        padding-right: 1.5rem;
    }
    .timeline-item::after {
        left: 2rem;
        margin-left: -8px;
    }
    .nav-links {
        display: none;
    }
    .hero h1 {
        font-size: 2.25rem;
    }
}
