/* 
 * UnfollowGram Manual Tracker - Dark Theme
 * Matching unfollowgram.com branding
 */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #22222e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #9090a0;
    --accent-primary: #818cf8;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border-color: #2a2a3a;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Links in muted text and cards need underline for accessibility */
.text-muted a,
p.text-muted a,
.feature-description a,
.card a:not(.btn),
section p a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.text-muted a:hover,
p.text-muted a:hover,
.feature-description a:hover,
.card a:not(.btn):hover,
section p a:hover {
    text-decoration: none;
}

a:hover {
    color: var(--accent-secondary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 500px;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* File Upload */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.upload-zone-text {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.upload-zone-subtext {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Upload username input */
.upload-username-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    max-width: 320px;
    width: 100%;
}

.upload-username-input input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.upload-username-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.upload-username-input input::placeholder {
    color: var(--text-muted);
}

.upload-username-input .btn {
    width: 100%;
}

.upload-step {
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--text-secondary);
    background: transparent;
    border: none;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab.active {
    background: var(--accent-gradient);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

.stat-change {
    font-size: 0.8rem;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.stat-change.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* User List */
.user-list {
    list-style: none;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.user-item:hover {
    background: var(--bg-hover);
}

.user-item:last-child {
    border-bottom: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
}

.user-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-dark {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Alert */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* Pricing Cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

/* Pricing Tabs */
.pricing-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.pricing-tab {
    padding: 12px 28px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.pricing-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pricing-tab .discount-badge {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.pricing-tab.active .discount-badge {
    background: white;
    color: #15803d; /* Darker green for contrast on white */
}

.pricing-content {
    animation: fadeIn 0.3s ease;
}

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

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.pricing-card.featured {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-period {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin: 24px 0;
}

.pricing-features li {
    padding: 10px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
    color: var(--text-muted);
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    padding-left: 44px;
}

.search-box-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }
.text-right { text-align: right; }

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    /* Navbar */
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
        margin-top: 16px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a,
    .nav-links span {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }
    
    .nav-links .btn {
        margin-top: 8px;
        text-align: center;
    }
    
    /* Hero */
    .hero {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero .d-flex {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero .btn-lg {
        width: 100%;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    /* Tabs - horizontal scroll */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        gap: 4px;
    }
    
    .tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .tabs::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    /* Cards */
    .card {
        padding: 16px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .card-header .search-box {
        width: 100% !important;
    }
    
    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card {
        padding: 24px;
    }
    
    .pricing-tabs {
        flex-direction: column;
        gap: 12px;
    }
    
    .pricing-tab {
        width: 100%;
        justify-content: center;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Upload Zone */
    .upload-zone {
        padding: 30px 20px;
    }
    
    .upload-zone-icon {
        font-size: 2rem;
    }
    
    .upload-zone-text {
        font-size: 0.95rem;
    }
    
    .upload-zone-subtext {
        font-size: 0.8rem;
    }
    
    /* Page headers */
    .d-flex.justify-between {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start !important;
    }
    
    /* Auth pages */
    .auth-card {
        padding: 20px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer .d-flex {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    /* Account switcher */
    .account-switcher {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .account-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    
    .account-tab {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .user-name {
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* Insights card on mobile */
    #insights-card .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #comparison-card .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Age breakdown badges */
    #age-breakdown {
        flex-direction: column;
    }
    
    #age-breakdown .badge {
        text-align: center;
    }
    
    /* Modal */
    .card[style*="max-width: 400px"],
    .card[style*="max-width: 450px"] {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    /* Table on mobile */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Utility for mobile hiding */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Landing page grid responsiveness */
@media (max-width: 768px) {
    /* How it works 3-column grid */
    section [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Side by side comparison */
    section [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Who it's for 4-column grid */
    section [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* FAQ cards with icon */
    .card[style*="display: flex"][style*="gap: 16px"] {
        flex-direction: column;
        text-align: center;
    }
}
