/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(25, 25, 35, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    /* TikTok-inspired colors */
    --accent-pink: #fe2c55;
    --accent-cyan: #25f4ee;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;

    /* Gradients */
    --gradient-primary: linear-gradient(
            135deg,
            var(--accent-pink),
            var(--accent-purple)
    );
    --gradient-secondary: linear-gradient(
            135deg,
            var(--accent-cyan),
            var(--accent-blue)
    );
    --gradient-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(254, 44, 85, 0.5);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(254, 44, 85, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================
   RESET & BASE
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(254, 44, 85, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(254, 44, 85, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

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

/* ==========================================
   HEADER
   ========================================== */
.header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.9);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-menu {
    position: relative;
}

.lang-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 14px 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.lang-menu-btn:hover {
    border-color: rgba(254, 44, 85, 0.5);
}

.lang-chevron {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.lang-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 70px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
}

.lang-menu-dropdown.open {
    display: block;
}

.lang-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-menu-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.lang-menu-item--current {
    color: var(--text-primary);
    background: var(--bg-glass);
}

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

[hidden] { display: none !important; }

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 10px 0;
}

.nav-link:hover {
    color: var(--accent-pink);
}

/* ==========================================
   USER MENU DROPDOWN
   ========================================== */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color var(--transition-fast);
}

.user-menu-btn:hover {
    border-color: rgba(254, 44, 85, 0.5);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-display-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
}

.user-menu-dropdown.open {
    display: block;
}

.user-menu-header {
    padding: 14px 16px;
}

.user-menu-fullname {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-menu-login {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-menu-badge {
    display: inline-block;
    margin-top: 6px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.user-menu-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.user-menu-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.user-menu-item--danger {
    color: var(--accent-pink);
}

.user-menu-item--danger:hover {
    background: rgba(254, 44, 85, 0.08);
    color: var(--accent-pink);
}

/* ==========================================
   GLASSMORPHISM CARD
   ========================================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(254, 44, 85, 0.3);
    box-shadow: var(--shadow-glow);
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
    margin-bottom: 24px;
}

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

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.1);
}

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

.form-input:read-only {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-input.input--invalid {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.15);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(254, 44, 85, 0.5);
}

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

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

.btn-secondary:hover {
    border-color: rgba(254, 44, 85, 0.5);
    background: rgba(254, 44, 85, 0.3);
}

.btn-copy {
    background: var(--gradient-secondary);
    color: var(--bg-primary);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(37, 244, 238, 0.5);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger {
    background: rgba(254,44,85,0.15);
    color: var(--accent-pink);
    border: 1px solid rgba(254,44,85,0.3);
}

.btn-danger:hover {
    background: rgba(254,44,85,0.3);
}

.btn-success {
    background: rgba(37,244,238,0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(37,244,238,0.3);
}

.btn-success:hover {
    background: rgba(37,244,238,0.3);
}

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

/* ==========================================
   UTILITIES
   ========================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

.mb-4 {
    margin-bottom: 2rem;
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================
   FORM PAGES
   ========================================== */
.hero--compact { padding: 60px 0; }

.form-wrap { max-width: 480px; margin: 0 auto; }
.form-wrap--sm { max-width: 420px; }

.page-heading {
    text-align: center;
    margin-bottom: 28px;
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-block { width: 100%; margin-top: 8px; }

.form-input--error {
    border-color: var(--accent-pink) !important;
    box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.18);
}

.field-error {
    display: none;
    color: var(--accent-pink);
    font-size: 0.78rem;
    margin-top: 4px;
}
.field-error.visible { display: block; }

.required-star {
    color: var(--accent-pink);
    margin-left: 1px;
}

.form-alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 20px;
    text-align: center;
    font-size: 0.95rem;
    border: 1px solid var(--accent-pink);
    background: rgba(254, 44, 85, 0.08);
    color: var(--accent-pink);
}

.form-alert--success {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(37, 244, 238, 0.08);
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: rgba(254, 44, 85, 0.5);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 44, 85, 0.8);
}
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(254, 44, 85, 0.5) var(--bg-secondary);
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88em;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.page-btn:hover:not(:disabled):not(.active):not(.page-btn--dots) {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    background: rgba(37, 244, 238, 0.07);
}

.page-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

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

.page-btn--dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
    color: var(--text-muted);
    pointer-events: none;
}

/* ==========================================
   MODAL
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    z-index: 501;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .glass-card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }
}
