/* SafeKey - Custom Styles (TailwindCSS CDN base + custom) */

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

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f0f1a;
    --bg-card-dark: #1a1a2e;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ─── Gradient Text ─────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Glass Effect ──────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ─── Glow Effects ──────────────────────────── */
.glow-purple {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.3);
}

.glow-cyan {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

/* ─── Button Styles ─────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), #9333ea);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    border-radius: 0.75rem;
    border: 2px solid var(--primary);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

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

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { filter: brightness(1.1); }

.icon-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.icon-btn:hover {
    background: #f3f4f6;
    color: var(--primary);
}
.dark .icon-btn:hover {
    background: #374151;
    color: var(--primary-light);
}

/* ─── Form Styles ─────────────────────────── */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
    background: white;
    color: #1f2937;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.dark .form-input {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.dark .form-input:focus {
    border-color: var(--primary-light);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.dark .form-label { color: #d1d5db; }

/* ─── Card ───────────────────────────────── */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.dark .card {
    background: #1a1a2e;
    border-color: #374151;
}

/* ─── Sidebar ────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #0f0f1a 0%, #1a0a2e 100%);
    transition: transform 0.3s ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(124, 58, 237, 0.2);
    color: white;
}

.sidebar-link.active {
    background: rgba(124, 58, 237, 0.3);
    border-left: 3px solid var(--primary-light);
}

/* ─── Vault Items ────────────────────────── */
.vault-item {
    animation: slideIn 0.2s ease;
}

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

/* ─── Strength Bar ───────────────────────── */
.strength-bar {
    height: 4px;
    border-radius: 9999px;
    background: #e5e7eb;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* ─── Plan Cards ─────────────────────────── */
.plan-card {
    border-radius: 1.5rem;
    padding: 2rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
    position: relative;
}

.plan-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(124, 58, 237, 0.15);
}

.plan-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(6, 182, 212, 0.05));
}

.dark .plan-card { border-color: #374151; background: #1a1a2e; }
.dark .plan-card.featured { border-color: var(--primary); }

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

.badge-purple { background: rgba(124,58,237,0.15); color: var(--primary); }
.badge-green { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-amber { background: rgba(245,158,11,0.15); color: var(--warning); }

/* ─── Modal ──────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}

.dark .modal-box { background: #1a1a2e; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ─── Hero Gradient BG ───────────────────── */
.hero-bg {
    background: radial-gradient(ellipse at 20% 50%, rgba(124,58,237,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.1) 0%, transparent 60%),
                linear-gradient(180deg, #0f0f1a 0%, #1a0a2e 100%);
}

/* ─── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.7); }

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); position: fixed; z-index: 40; }
    #sidebar.open { transform: translateX(0); }
    .modal-box { padding: 1.25rem; }
}
