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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
    --success: #10b981;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 400px),
                      radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.1), transparent 400px);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #818cf8, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.nav-links a {
    margin-left: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.auth-card {
    max-width: 420px;
    margin: 80px auto;
    animation: slideUp 0.5s ease-out;
}

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

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 1.75rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

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

.btn:active {
    transform: translateY(1px);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #818cf8;
}

/* Channel specific styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    gap: 20px;
}

.page-title-group h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.page-title-group p {
    margin: 5px 0 0 0;
    color: var(--text-muted);
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.channel-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
}

.channel-card.mode-manual::before {
    background: #6c757d;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.channel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.channel-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.channel-details {
    flex: 1;
    min-width: 0;
}

.channel-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-id {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: monospace;
}

.channel-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.badge-oauth {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

.badge-manual {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

.channel-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

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

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header .btn-group {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    .page-header .btn-group .btn {
        flex: 1;
    }
}

.btn-group {
    display: flex;
    gap: 12px;
}

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn-group .btn {
        width: 100%;
    }
}

/* Pricing Section Styles */
.pricing-header {
    text-align: center;
    margin-bottom: 60px;
}

.pricing-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 48px 32px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 30px 60px -12px rgba(99, 102, 241, 0.25);
}

.pricing-card.featured {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(30, 41, 59, 0.7) 100%);
    border-color: var(--primary);
}

.pricing-card.featured::after {
    content: 'Recommended';
    position: absolute;
    top: 20px;
    right: -30px;
    background: var(--primary);
    color: white;
    padding: 4px 40px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-name {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 16px;
}

.plan-price {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.plan-price small {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.plan-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    flex: 1;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.plan-features li svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}

.plan-action .btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.plan-action .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.plan-action .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
