/* Base Variables & Theme */
:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --nav-height: 70px;
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body.dark-theme {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    padding-top: var(--nav-height);
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Universal Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
    box-sizing: border-box;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.nav-btn {
    background: var(--accent-primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}
.nav-btn:hover { background: var(--accent-hover); }
.nav-btn-dashboard {
    background: var(--card-border);
    color: var(--text-primary) !important;
}
.nav-btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger) !important;
    border: 1px solid var(--danger);
    margin-left: 10px;
}

/* Layouts */
.container {
    width: 100%;
    max-width: 500px;
    padding: 40px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container-wide {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    box-sizing: border-box;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}

/* Typography */
h1 { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); margin-top: 0; margin-bottom: 10px; text-align: center; letter-spacing: -1px; }
h2 { font-size: 1.5rem; font-weight: 700; margin-top: 0; margin-bottom: 20px; color: var(--text-primary); text-align: center; }
p.subtitle { color: var(--text-secondary); text-align: center; margin-top: 0; margin-bottom: 30px; line-height: 1.5; font-size: 1.05rem; }

/* Inputs & Buttons */
input, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-primary); }

.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-color); }

/* Utilities */
.divider { display: flex; align-items: center; margin: 20px 0; color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; font-weight: 600; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--card-border); }
.divider::before { margin-right: 15px; } .divider::after { margin-left: 15px; }


.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.premium-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(168, 85, 247, 0.2);
}
body.dark-theme .premium-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 90%; max-width: 400px;
    box-shadow: var(--shadow-md);
    transform: translateY(20px); transition: transform 0.2s;
    border: 1px solid var(--card-border);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.2s, background 0.2s, color 0.2s;
}
.theme-toggle-btn:hover {
    transform: scale(1.05);
    background: var(--card-border);
}
.theme-toggle-btn:active {
    transform: scale(0.95);
}
.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Mobile Responsiveness */
@media (max-width: 600px) {
    .navbar {
        padding: 0 10px;
    }
    .nav-brand {
        font-size: 1rem;
    }
    .brand-text {
        display: none;
    }
    .nav-links {
        gap: 6px;
    }
    .nav-links a {
        font-size: 0.8rem;
    }
    .nav-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .nav-btn-logout {
        margin-left: 0;
    }
    .header, .clips-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    .header h1, .clips-header h2 {
        justify-content: center;
    }
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    .received-card .btn {
        width: auto;
        margin-bottom: 0;
    }
    .theme-toggle-btn {
        bottom: 15px;
        right: 15px;
    }
    .cards-container {
        padding: 0 15px;
    }
    .action-card {
        min-width: 100%;
    }
}


/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}
.toast-success svg {
    color: var(--success);
}
.toast-error svg {
    color: var(--danger);
}
