/**
 * ViecVaTro Design System
 * Primary stylesheet for layout, components and utilities.
 */

/* ========== Google Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

/* ========== CSS Variables ========== */
:root {
    --vvt-primary: #2563eb;
    --vvt-primary-hover: #1d4ed8;
    --vvt-secondary: #059669;
    --vvt-secondary-hover: #047857;
    --vvt-dark: #1e293b;
    --vvt-muted: #64748b;
    --vvt-border: #e2e8f0;
    --vvt-bg: #f8fafc;
    --vvt-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --vvt-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    --vvt-radius: 12px;
    --vvt-radius-sm: 8px;
    --vvt-navbar-height: 56px;
    --vvt-sidebar-width: 220px;
    --vvt-font-sans: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ========== Base ========== */
body {
    font-family: var(--vvt-font-sans);
    background: var(--vvt-bg);
    color: var(--vvt-dark);
}

/* ========== Navbar ========== */
.navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--vvt-primary) !important;
    letter-spacing: -0.5px;
}
.navbar .nav-link {
    font-weight: 500;
}

/* ========== Buttons ========== */
.btn-primary {
    background: var(--vvt-primary);
    border-color: var(--vvt-primary);
}
.btn-primary:hover {
    background: var(--vvt-primary-hover);
    border-color: var(--vvt-primary-hover);
}
.btn-success {
    background: var(--vvt-secondary);
    border-color: var(--vvt-secondary);
}
.btn-success:hover {
    background: var(--vvt-secondary-hover);
    border-color: var(--vvt-secondary-hover);
}

/* ========== Cards ========== */
.card {
    border: none;
    box-shadow: var(--vvt-card-shadow);
    border-radius: var(--vvt-radius);
    transition: box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: var(--vvt-card-shadow-hover);
}
.card-listing {
    overflow: hidden;
}
.card-listing .card-img-top {
    height: 180px;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.card-listing:hover .card-img-top {
    transform: scale(1.03);
}
.card-stat {
    text-align: center;
    padding: 1.5rem;
}
.card-stat h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.card-stat p {
    color: var(--vvt-muted);
    margin: 0;
    font-size: 0.85rem;
}

/* ========== Dashboard Sidebar ========== */
.vvt-sidebar {
    min-height: calc(100vh - var(--vvt-navbar-height));
    background: #fff;
    border-right: 1px solid var(--vvt-border);
    width: var(--vvt-sidebar-width);
}
.vvt-sidebar .sidebar-brand {
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--vvt-primary);
    border-bottom: 1px solid var(--vvt-border);
}
.vvt-sidebar .sidebar-title {
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vvt-muted);
}
.vvt-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: var(--vvt-radius-sm);
    color: var(--vvt-dark);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}
.vvt-sidebar .nav-link:hover {
    background: #f1f5f9;
    color: var(--vvt-primary);
}
.vvt-sidebar .nav-link.active {
    background: #eff6ff;
    color: var(--vvt-primary);
    font-weight: 600;
}
.vvt-sidebar .nav-link i {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ========== Role nav link (legacy / main navbar dashboard link) ========== */
.role-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--vvt-radius-sm);
    text-decoration: none;
    color: var(--vvt-dark);
    font-size: 0.9rem;
}
.role-nav-link:hover {
    background: #f1f5f9;
}
.role-nav-link.active {
    background: #eff6ff;
    color: var(--vvt-primary);
    font-weight: 600;
}

/* ========== Zone selection cards (Chọn KCN) ========== */
.zone-card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.zone-card:hover {
    box-shadow: var(--vvt-card-shadow-hover);
    border-color: var(--vvt-primary) !important;
    transform: translateY(-2px);
}
.zone-card.zone-card-selected,
.zone-card.border-primary {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.zone-card .zone-card-icon {
    transition: transform 0.2s ease;
}
.zone-card:hover .zone-card-icon {
    transform: scale(1.05);
}

/* ========== CTA cards (Nhà tuyển dụng / Chủ trọ / CTV) ========== */
.cta-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    border-radius: var(--vvt-radius);
}
.cta-card:hover {
    box-shadow: var(--vvt-card-shadow-hover);
    transform: translateY(-3px);
}
.cta-card .cta-card-icon {
    transition: transform 0.2s ease;
}
.cta-card:hover .cta-card-icon {
    transform: scale(1.08);
}

/* ========== Zone badge ========== */
.zone-badge {
    background: #ecfdf5;
    color: var(--vvt-secondary);
    border: 1px solid #d1fae5;
    font-weight: 500;
}

/* ========== Notifications ========== */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
}
.notif-dropdown {
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
}
.notif-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 16px;
    cursor: pointer;
}
.notif-item:hover {
    background: #f8fafc;
}
.notif-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--vvt-primary);
}

/* ========== Stat card (dashboard KPI) ========== */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}
.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.stat-card p {
    color: var(--vvt-muted);
    margin: 0;
    font-size: 0.85rem;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    font-size: 0.9rem;
}
.breadcrumb-item a {
    color: var(--vvt-primary);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ========== Empty state ========== */
.empty-state {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--vvt-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state p {
    margin-bottom: 0.5rem;
}
.empty-state .btn {
    margin-top: 0.5rem;
}

/* ========== Tables ========== */
.table th {
    font-weight: 600;
    color: var(--vvt-dark);
    border-bottom-width: 1px;
}
.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* ========== Hero ========== */
.vvt-hero {
    background: linear-gradient(135deg, var(--vvt-primary) 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}
.vvt-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.vvt-hero .hero-content {
    animation: vvtFadeInUp 0.6s ease-out;
}
.vvt-hero .hero-form {
    animation: vvtFadeInUp 0.6s ease-out 0.15s both;
}
.vvt-hero .hero-btns {
    animation: vvtFadeInUp 0.6s ease-out 0.25s both;
}
@keyframes vvtFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.vvt-hero .hero-visual {
    animation: vvtFadeIn 0.8s ease-out 0.2s both;
}
@keyframes vvtFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.btn-hover-scale { transition: transform 0.2s ease; }
.btn-hover-scale:hover { transform: scale(1.02); }
.card-featured { border: 2px solid var(--vvt-primary); background: linear-gradient(to bottom, rgba(37, 99, 235, 0.03), transparent); }
.room-card-price { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.5rem 0.75rem; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); color: #fff; font-weight: 700; }

/* ========== Footer ========== */
.vvt-footer {
    background: var(--vvt-dark);
    color: #fff;
}
.vvt-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
.vvt-footer a:hover {
    color: #fff;
}
.vvt-footer h5, .vvt-footer h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 1rem;
    }
    .notif-dropdown {
        width: 100vw;
        max-width: 360px;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    .vvt-sidebar {
        position: fixed;
        left: 0;
        top: var(--vvt-navbar-height);
        z-index: 1020;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
    }
    .vvt-sidebar.show {
        transform: translateX(0);
    }
    .vvt-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1015;
        top: var(--vvt-navbar-height);
    }
    .vvt-sidebar-backdrop.show {
        display: block;
    }
}
