/* ========================================
   GLOBAL RESPONSIVE CSS FOR HRM SYSTEM
   ======================================== */

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
/* Mobile First Approach */
/* Extra Small devices (phones, 320px and up) */
/* Small devices (landscape phones, 576px and up) */
/* Medium devices (tablets, 768px and up) */
/* Large devices (desktops, 992px and up) */
/* Extra large devices (large desktops, 1200px and up) */
/* 14-inch laptops typically around 1366px */

/* ========================================
   GLOBAL RESPONSIVE SETTINGS
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    font-size: 14px; /* Base font size for mobile */
}

@media (min-width: 576px) {
    html { font-size: 15px; }
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

@media (min-width: 992px) {
    html { font-size: 16px; }
}

@media (min-width: 1200px) {
    html { font-size: 16px; }
}

@media (min-width: 1366px) {
    html { font-size: 16px; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ========================================
   RESPONSIVE CONTAINER SYSTEM
   ======================================== */
.container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    width: 100%;
}

@media (min-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 768px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ========================================
   RESPONSIVE GRID SYSTEM
   ======================================== */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    display: flex;
    flex-wrap: wrap;
}

@media (min-width: 576px) {
    .row {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
}

@media (min-width: 768px) {
    .row {
        margin-left: -1rem;
        margin-right: -1rem;
    }
}

.col-12, .col-md-6, .col-md-4, .col-md-3, .col-lg-6, .col-lg-4, .col-lg-3, .col-xl-3, .col-xl-4, .col-xl-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    position: relative;
    width: 100%;
}

@media (min-width: 576px) {
    .col-12, .col-md-6, .col-md-4, .col-md-3, .col-lg-6, .col-lg-4, .col-lg-3, .col-xl-3, .col-xl-4, .col-xl-6 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (min-width: 768px) {
    .col-12, .col-md-6, .col-md-4, .col-md-3, .col-lg-6, .col-lg-4, .col-lg-3, .col-xl-3, .col-xl-4, .col-xl-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Responsive column classes */
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
}

/* ========================================
   RESPONSIVE SIDEBAR SYSTEM
   ======================================== */
.sidebar {
    background: linear-gradient(180deg, #6f42c1 0%, #e83e8c 100%);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 280px;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

@media (max-width: 767px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

@media (min-width: 768px) {
    .sidebar-collapsed {
        width: 70px;
    }
    
    .sidebar-collapsed .nav-link span,
    .sidebar-collapsed .sidebar-brand span,
    .sidebar-collapsed .user-details {
        display: none;
    }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    background: #6f42c1;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .sidebar-toggle {
        top: 1.5rem;
        left: 1.5rem;
        padding: 0.75rem;
        border-radius: 0.75rem;
        font-size: 1.5rem;
    }
}

/* Main Content Adjustment */
.main-content {
    margin-left: 0;
    padding: 1rem;
    min-height: 100vh;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 280px;
        padding: 2rem;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 70px;
    }
}

/* ========================================
   RESPONSIVE NAVIGATION
   ======================================== */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .nav-link {
        padding: 1rem 1.25rem;
        margin: 0.25rem 0.75rem;
        font-size: 1rem;
    }
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    min-width: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .nav-link i {
        margin-right: 1rem;
        font-size: 1.25rem;
        min-width: 1.75rem;
    }
}

/* ========================================
   RESPONSIVE CARDS
   ======================================== */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s;
    margin-bottom: 1rem;
    border: none;
    overflow: hidden;
}

@media (min-width: 768px) {
    .card {
        border-radius: 1rem;
        margin-bottom: 1.5rem;
    }
}

.card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
    font-weight: 600;
    font-size: 1rem;
    color: #495057;
}

@media (min-width: 768px) {
    .card-header {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
    }
}

.card-body {
    padding: 1rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE FORMS
   ======================================== */
.form-control,
.form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    min-height: 48px; /* Touch-friendly height */
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .form-control,
    .form-select {
        padding: 0.75rem 1rem;
        border-radius: 0.75rem;
        min-height: auto;
    }
}

.form-control:focus,
.form-select:focus {
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .form-label {
        font-size: 1rem;
    }
}

/* ========================================
   RESPONSIVE BUTTONS
   ======================================== */
.btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

@media (min-width: 768px) {
    .btn {
        font-size: 1rem;
        padding: 0.75rem 2rem;
        border-radius: 0.75rem;
        min-height: auto;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #000;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.btn-outline-primary {
    border: 2px solid #6f42c1;
    color: #6f42c1;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #6f42c1;
    color: white;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    min-height: 36px;
}

@media (min-width: 768px) {
    .btn-sm {
        font-size: 0.9rem;
        padding: 0.6rem 1.25rem;
        min-height: auto;
    }
}

/* ========================================
   RESPONSIVE TABLES
   ======================================== */
.table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

@media (min-width: 768px) {
    .table {
        font-size: 1rem;
    }
}

.table thead th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
}

@media (min-width: 768px) {
    .table thead th {
        font-size: 0.9rem;
        padding: 1rem 0.75rem;
    }
}

.table tbody td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

@media (min-width: 768px) {
    .table tbody td {
        padding: 1rem 0.75rem;
    }
}

.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .table-responsive {
        border-radius: 0.75rem;
    }
}

/* ========================================
   RESPONSIVE BADGES
   ======================================== */
.badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        border-radius: 0.375rem;
    }
}

.bg-success { background: #28a745 !important; }
.bg-warning { background: #ffc107 !important; color: #000 !important; }
.bg-info { background: #17a2b8 !important; }
.bg-danger { background: #dc3545 !important; }
.bg-secondary { background: #6c757d !important; }
.bg-primary { background: #6f42c1 !important; }

/* ========================================
   RESPONSIVE HERO SECTIONS
   ======================================== */
.hero {
    background: linear-gradient(90deg, #6f42c1 60%, #e83e8c 100%);
    color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero {
        padding: 2.5rem 2rem;
        margin-bottom: 2.5rem;
        border-radius: 1.5rem;
    }
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
}

.hero p {
    font-size: 0.9rem;
    margin-bottom: 0;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .hero p {
        font-size: 1.25rem;
    }
}

/* ========================================
   RESPONSIVE STATS CARDS
   ======================================== */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: transform 0.2s;
    margin-bottom: 1rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .stats-card {
        border-radius: 1rem;
        margin-bottom: 1.5rem;
    }
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-card .card-body {
    padding: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .stats-card .card-body {
        padding: 1.5rem;
    }
}

.stats-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .stats-card h2 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}

.stats-card small {
    font-size: 0.8rem;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .stats-card small {
        font-size: 0.9rem;
    }
}

/* ========================================
   RESPONSIVE CHARTS
   ======================================== */
.chart-container {
    position: relative;
    height: 250px;
    margin: 15px 0;
}

@media (min-width: 768px) {
    .chart-container {
        height: 300px;
        margin: 20px 0;
    }
}

@media (min-width: 992px) {
    .chart-container {
        height: 350px;
    }
}

/* ========================================
   RESPONSIVE LIST GROUPS
   ======================================== */
.list-group-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    background: white;
}

@media (min-width: 768px) {
    .list-group-item {
        padding: 1rem;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

.list-group-item h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

@media (min-width: 768px) {
    .list-group-item h6 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

.list-group-item small {
    font-size: 0.75rem;
    color: #6c757d;
}

@media (min-width: 768px) {
    .list-group-item small {
        font-size: 0.8rem;
    }
}

/* ========================================
   RESPONSIVE MODALS
   ======================================== */
.modal-dialog {
    margin: 1rem;
    max-width: 95%;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

@media (min-width: 768px) {
    .modal-dialog {
        max-width: 600px;
    }
}

@media (min-width: 992px) {
    .modal-dialog {
        max-width: 800px;
    }
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 1.5rem;
    }
}

.modal-body {
    padding: 1rem;
}

@media (min-width: 768px) {
    .modal-body {
        padding: 1.5rem;
    }
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

@media (min-width: 768px) {
    .modal-footer {
        padding: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE ALERTS
   ======================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: none;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .alert {
        padding: 1rem 1.5rem;
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
        font-size: 1rem;
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

@media (min-width: 768px) {
    .text-md-left { text-align: left !important; }
    .text-md-right { text-align: right !important; }
    .text-md-center { text-align: center !important; }
}

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.9rem; font-weight: 600; }

@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
    h5 { font-size: 1.25rem; }
    h6 { font-size: 1rem; }
}

.display-6 {
    font-size: 1.5rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .display-6 {
        font-size: 2.5rem;
    }
}

.fs-1 { font-size: 2rem !important; }
.fs-2 { font-size: 1.75rem !important; }
.fs-3 { font-size: 1.5rem !important; }
.fs-4 { font-size: 1.25rem !important; }
.fs-5 { font-size: 1rem !important; }
.fs-6 { font-size: 0.875rem !important; }

@media (min-width: 768px) {
    .fs-1 { font-size: 3rem !important; }
    .fs-2 { font-size: 2.5rem !important; }
    .fs-3 { font-size: 2rem !important; }
    .fs-4 { font-size: 1.75rem !important; }
    .fs-5 { font-size: 1.25rem !important; }
    .fs-6 { font-size: 1rem !important; }
}

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */
img {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-width: 100%;
    height: auto;
}

/* ========================================
   RESPONSIVE NAVBAR
   ======================================== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
    .navbar {
        padding: 1rem 2rem;
    }
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6f42c1;
}

@media (min-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE FOOTER
   ======================================== */
.footer {
    background: #343a40;
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .footer {
        padding: 2rem;
        font-size: 1rem;
    }
}

/* ========================================
   RESPONSIVE PRINT STYLES
   ======================================== */
@media print {
    .sidebar,
    .sidebar-toggle,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* ========================================
   RESPONSIVE ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid #6f42c1;
    outline-offset: 2px;
}

/* ========================================
   RESPONSIVE DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .table {
        color: #ffffff;
    }
    
    .table thead th {
        background-color: #3d3d3d;
        color: #ffffff;
    }
    
    .form-control,
    .form-select {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #4d4d4d;
    }
}

/* ========================================
   RESPONSIVE PERFORMANCE OPTIMIZATIONS
   ======================================== */
/* Optimize for mobile performance */
@media (max-width: 767px) {
    .card {
        will-change: transform;
    }
    
    .btn {
        will-change: transform;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .card,
    .btn,
    .nav-link,
    .sidebar {
        transition: none !important;
    }
} 