/* ============================================
   HR SYSTEM - SHARED RESPONSIVE CSS
   Supports: Mobile (<600px), Tablet (<900px), Desktop (>900px)
   ============================================ */

/* ---- HAMBURGER BUTTON (mobile only) ---- */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: var(--primary, #4e73df);
    color: white;
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

.hamburger-btn:hover {
    background: var(--secondary, #224abe);
}

/* ---- SIDEBAR OVERLAY (mobile) ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ---- SIDEBAR ---- */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- MAIN CONTENT header padding on mobile ---- */
@media (max-width: 900px) {
    .hamburger-btn {
        display: flex;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1060;
        transform: translateX(-100%);
        width: 260px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 1.5rem 1rem !important;
        padding-top: 4.5rem !important;
        width: 100% !important;
    }

    /* Top bar stacked */
    .top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 1.5rem !important;
    }

    .page-title h1 {
        font-size: 1.3rem !important;
    }

    /* Dashboard grid: 2 col tablet */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* Action grid: 1 col tablet */
    .action-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Two-column content grids → 1 col */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Admin & user sections padding */
    .admin-section,
    .user-section {
        padding: 1.2rem !important;
        border-radius: 16px !important;
    }

    /* Action cards */
    .action-card {
        padding: 1.2rem !important;
    }

    /* User profile pill in topbar */
    .user-profile {
        padding: 6px 14px !important;
        font-size: 0.85rem !important;
    }
}

@media (max-width: 600px) {

    /* Dashboard grid: 1 col mobile */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .main-content {
        padding: 1rem 0.75rem !important;
        padding-top: 4.5rem !important;
    }

    .stat-card .value {
        font-size: 1.4rem !important;
    }

    .btn-clock {
        font-size: 0.9rem !important;
        padding: 12px 18px !important;
        border-radius: 12px !important;
    }

    /* Employee greeting stacked */
    div[style*="justify-content: space-between"][style*="align-items: flex-start"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .action-card i {
        font-size: 1.8rem !important;
    }

    /* Tables overflow */
    table {
        font-size: 0.78rem !important;
    }

    /* Form adjustment */
    .card {
        padding: 1.5rem !important;
        border-radius: 12px !important;
    }
    
    label {
        font-size: 0.85rem !important;
    }
    
    input, select, textarea {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }
    
    /* Ensure select dropdown looks good */
    select {
        height: auto !important;
        word-wrap: normal !important;
        white-space: normal !important;
    }
    
    optgroup {
        font-weight: 700 !important;
        background: #f1f3f9 !important;
    }
}

/* ---- LOGIN PAGE RESPONSIVE ---- */
@media (max-width: 480px) {
    .login-container {
        margin: 0 12px !important;
        padding: 2rem 1.5rem !important;
        border-radius: 16px !important;
    }

    .login-header h1 {
        font-size: 1.6rem !important;
    }
}

/* ---- INDEX / WELCOME PAGE RESPONSIVE ---- */
@media (max-width: 480px) {
    .welcome-card {
        padding: 2rem 1.5rem !important;
        border-radius: 20px !important;
        width: 94% !important;
    }

    .welcome-card h1 {
        font-size: 1.6rem !important;
    }

    .logo-container {
        width: 72px !important;
        height: 72px !important;
        font-size: 2rem !important;
    }

    .btn {
        padding: 14px !important;
        font-size: 0.95rem !important;
    }
}

/* ---- GENERAL TABLE RESPONSIVE ---- */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .content-card table {
        min-width: 300px;
    }
}