/* ===== css/login.css ===== */
/* TOOLSTORE – Login Page (Glassmorphism + Header + Sidebar) */

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow-x: hidden;
}

/* ===== THEME VARIABLES ===== */
:root {
    --bg-body: #06080f;
    --bg-sidebar: rgba(10, 12, 22, 0.85);
    --bg-card: rgba(16, 20, 40, 0.8);
    --bg-card-hover: rgba(22, 28, 50, 0.9);
    --bg-input: #1a1f35;
    --bg-header: rgba(8, 10, 20, 0.8);
    --border-color: rgba(35, 40, 74, 0.6);
    --text-primary: #eef2ff;
    --text-secondary: #99a4d0;
    --text-muted: #5b6690;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    --radius: 22px;
    --radius-sm: 14px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --accent: #8b7cf0;
    --accent-light: #b8a9ff;
    --accent-dark: #5a4bd6;
    --green: #00e6b0;
    --green-bg: rgba(0, 230, 176, 0.12);
    --orange: #ffb347;
    --orange-bg: rgba(255, 179, 71, 0.12);
    --red: #ff6b7a;
    --red-bg: rgba(255, 107, 122, 0.12);
    --blue: #4d8cff;
    --blue-bg: rgba(77, 140, 255, 0.12);
    --purple: #8b7cf0;
    --purple-bg: rgba(139, 124, 240, 0.12);
    --glow: 0 0 50px rgba(139, 124, 240, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(18px);
}

[data-theme="light"] {
    --bg-body: #f2f5fc;
    --bg-sidebar: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(245, 248, 255, 0.95);
    --bg-input: #eef2f9;
    --bg-header: rgba(255, 255, 255, 0.8);
    --border-color: rgba(210, 220, 240, 0.7);
    --text-primary: #14182b;
    --text-secondary: #4a5278;
    --text-muted: #7a84a8;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.06);
    --glow: 0 0 50px rgba(139, 124, 240, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(210, 220, 240, 0.4);
}

/* ===== BACKGROUND DECORATION ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(139, 124, 240, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(77, 140, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 230, 176, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-light));
    border-radius: 10px;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    padding: 28px 20px 30px;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
}
.sidebar.closed {
    transform: translateX(-100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}
.sidebar-brand img {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: 0 6px 20px rgba(139, 124, 240, 0.4);
}
.sidebar-brand span {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    margin-bottom: 2px;
}
.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    transition: transform 0.3s ease;
}
.sidebar-nav .nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    transform: translateX(6px);
}
.sidebar-nav .nav-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 8px 28px rgba(139, 124, 240, 0.5);
}
.sidebar-nav .nav-link i {
    width: 22px;
    font-size: 16px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-footer .badge {
    background: var(--green);
    color: #06080f;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 230, 176, 0.3);
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}
.main.expanded {
    margin-left: 0;
}

/* ===== HEADER ===== */
.header {
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 74px;
    transition: background 0.5s, border-color 0.5s;
}
.header:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
}
.hamburger {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    backdrop-filter: blur(12px);
}
.hamburger:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    transform: rotate(90deg);
    box-shadow: 0 4px 20px rgba(139, 124, 240, 0.3);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 14px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header-center .logo-img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: 0 6px 22px rgba(139, 124, 240, 0.4);
    animation: floatLogo 3s ease-in-out infinite;
}
@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.header-center .brand-name {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.header-center .brand-name small {
    font-weight: 400;
    font-size: 13px;
    -webkit-text-fill-color: var(--text-muted);
    margin-left: 6px;
    letter-spacing: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: flex-end;
}
.header-right .icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 14px;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
}
.header-right .icon-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(139, 124, 240, 0.35);
}

/* Avatar */
.avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.avatar-wrap:hover {
    transform: scale(1.05);
}
.avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.4s ease;
}
.avatar-wrap:hover img {
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(139, 124, 240, 0.5);
}
.avatar-wrap .online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    background: var(--green);
    border-radius: 50%;
    border: 2px solid var(--bg-header);
    transition: all 0.3s;
    box-shadow: 0 0 12px rgba(0, 230, 176, 0.6);
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 230, 176, 0.4); }
    50% { box-shadow: 0 0 18px rgba(0, 230, 176, 0.8); }
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    min-width: 230px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.94);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
    z-index: 200;
}
.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.dropdown-menu .dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    padding-left: 28px;
}
.dropdown-menu .dropdown-item i {
    width: 20px;
    font-size: 16px;
    color: var(--text-muted);
}
.dropdown-menu .dropdown-item:hover i {
    color: var(--accent);
}
.dropdown-menu .user-info {
    padding: 8px 24px 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}
.dropdown-menu .user-info .name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
}
.dropdown-menu .user-info .email {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== CONTENT (căn giữa form) ===== */
.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeSlideUp 0.7s ease forwards;
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-card), 0 0 60px rgba(139, 124, 240, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
    opacity: 0.9;
}
.login-card:hover {
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
    transform: translateY(-4px);
}

/* ===== LOGIN HEADER ===== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header .logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: 0 8px 28px rgba(139, 124, 240, 0.5);
    margin-bottom: 18px;
    animation: pulseGlow 3s infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 124, 240, 0.2); }
    50% { box-shadow: 0 0 45px rgba(139, 124, 240, 0.4); }
}
.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.login-header p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== FORM STYLES ===== */
.login-form .form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group label i {
    font-size: 15px;
    color: var(--accent-light);
    width: 18px;
    text-align: center;
}
.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}
.form-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(139, 124, 240, 0.3), 0 0 0 3px rgba(139, 124, 240, 0.1);
    background: var(--bg-card-hover);
}

/* Toggle password button */
.password-wrapper {
    position: relative;
}
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    transition: color 0.3s;
}
.toggle-password:hover {
    color: var(--accent);
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
}
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
.remember-me input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.forgot-password {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.forgot-password:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===== BUTTON ===== */
.btn-login {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(139, 124, 240, 0.4);
    position: relative;
    overflow: hidden;
}
.btn-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn-login:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    box-shadow: 0 12px 32px rgba(139, 124, 240, 0.6);
    transform: translateY(-2px);
}
.btn-login:hover::after {
    width: 300px;
    height: 300px;
}
.btn-login i {
    font-size: 18px;
    transition: transform 0.3s;
}
.btn-login:hover i {
    transform: translateX(4px);
}

/* ===== FOOTER ===== */
.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-muted);
}
.login-footer a {
    color: var(--accent-light);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}
.login-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        padding: 10px 18px;
        min-height: 66px;
    }
    .header-center .brand-name {
        font-size: 20px;
    }
    .header-center .brand-name small {
        display: none;
    }
    .header-center .logo-img {
        width: 38px;
        height: 38px;
    }
    .header-right .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .avatar-wrap {
        width: 38px;
        height: 38px;
    }
    .dropdown-menu {
        min-width: 200px;
        right: -10px;
    }
    .login-card {
        padding: 30px 22px;
    }
}

@media (max-width: 480px) {
    .header-center .brand-name {
        font-size: 17px;
    }
    .header-center .logo-img {
        width: 32px;
        height: 32px;
    }
    .header-right .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .avatar-wrap {
        width: 34px;
        height: 34px;
    }
    .login-header .logo {
        width: 52px;
        height: 52px;
    }
    .login-header h1 {
        font-size: 24px;
    }
    .btn-login {
        padding: 14px;
    }
}