/* ======================================
   HR Management System - Global Styles
   Clean, Organized, Modern Design
   ====================================== */

/* Color System */
:root {
    /* Primary Colors */
    --cream: #FFF8F0;
    --warmBrown: #6B3E26;
    --accent: #ECA869;
    --accentHover: #d86e3a;
    --lightBeige: #F5E6D3;
    
    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======================================
   LAYOUT COMPONENTS
   ====================================== */

/* Page Container */
.page-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cream), var(--lightBeige), var(--cream));
}

/* Glass Card - Modern Container */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(107, 62, 38, 0.1);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid;
    border-image: linear-gradient(to right, var(--accent), var(--warmBrown)) 1;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--warmBrown);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.25rem;
    }
}

/* Statistics Counter */
.stats-counter {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent), var(--accentHover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ======================================
   SEARCH & FILTERS
   ====================================== */

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 28rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid rgba(107, 62, 38, 0.2);
    border-radius: 0.75rem;
    background: white;
    color: var(--warmBrown);
    transition: all var(--transition-base);
}

.search-input::placeholder {
    color: rgba(107, 62, 38, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(236, 168, 105, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(107, 62, 38, 0.5);
    pointer-events: none;
}


/* ======================================
   BUTTONS
   ====================================== */

/* Action Buttons Group */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Add Button */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accentHover));
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.btn-add:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* Export Button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
    transition: all var(--transition-base);
}

.btn-export:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

/* Filter Button */
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--warmBrown);
    border: 2px solid rgba(107, 62, 38, 0.2);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-filter:hover {
    background: var(--warmBrown);
    color: white;
    border-color: var(--warmBrown);
}

/* Standard Button Variants */
.btn-primary {
    background: var(--accent);
    color: white;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-primary:hover {
    background: var(--accentHover);
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--lightBeige);
    color: var(--warmBrown);
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(107, 62, 38, 0.2);
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: rgba(107, 62, 38, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}


/* ======================================
   TABLES
   ====================================== */

/* Modern Table Container */
.modern-table-container {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid rgba(107, 62, 38, 0.1);
}

/* Modern Table */
.modern-table {
    width: 100%;
}

.modern-table thead {
    background: linear-gradient(to right, var(--warmBrown), #92400e, var(--warmBrown));
}

.modern-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cream);
}

.modern-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--warmBrown);
}

.modern-table tbody tr {
    border-bottom: 1px solid rgba(107, 62, 38, 0.1);
    transition: all var(--transition-base);
}

.modern-table tbody tr:hover {
    background: linear-gradient(to right, rgba(255, 248, 240, 0.3), rgba(245, 230, 211, 0.3));
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody tr:nth-child(even) {
    background: rgba(255, 248, 240, 0.2);
}

/* Table Action Buttons */
.table-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-base);
}

.table-btn:hover {
    transform: scale(1.05);
}

.table-btn-view {
    background: var(--info);
    color: white;
    box-shadow: var(--shadow-md);
}

.table-btn-view:hover {
    background: #2563eb;
    box-shadow: var(--shadow-lg);
}

.table-btn-edit {
    background: var(--warning);
    color: white;
    box-shadow: var(--shadow-md);
}

.table-btn-edit:hover {
    background: #d97706;
    box-shadow: var(--shadow-lg);
}

.table-btn-delete {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-md);
}

.table-btn-delete:hover {
    background: #dc2626;
    box-shadow: var(--shadow-lg);
}

/* Table Avatar */
.table-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgba(107, 62, 38, 0.2);
    box-shadow: var(--shadow-sm);
}


/* ======================================
   STATUS BADGES
   ====================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}


/* ======================================
   FORMS
   ====================================== */

.form-label {
    display: block;
    color: var(--warmBrown);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(107, 62, 38, 0.2);
    border-radius: 0.5rem;
    background: white;
    color: var(--warmBrown);
    transition: all var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(236, 168, 105, 0.2);
}

.form-select {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(107, 62, 38, 0.2);
    border-radius: 0.5rem;
    background: white;
    color: var(--warmBrown);
    cursor: pointer;
    transition: all var(--transition-base);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(236, 168, 105, 0.2);
}

.form-textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(107, 62, 38, 0.2);
    border-radius: 0.5rem;
    background: white;
    color: var(--warmBrown);
    resize: none;
    transition: all var(--transition-base);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(236, 168, 105, 0.2);
}


/* ======================================
   CARDS
   ====================================== */

.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(107, 62, 38, 0.1);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warmBrown);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(236, 168, 105, 0.3);
}


/* ======================================
   NAVIGATION
   ====================================== */

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: var(--cream);
    font-weight: 500;
    transition: all var(--transition-base);
}

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

.nav-link.active {
    background: var(--accent);
    color: var(--warmBrown);
    box-shadow: var(--shadow-md);
}

.mobile-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--cream);
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--accent);
    color: var(--warmBrown);
}


/* ======================================
   EMPTY STATES
   ====================================== */

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem;
    color: rgba(107, 62, 38, 0.3);
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warmBrown);
    margin-bottom: 0.5rem;
}

.empty-message {
    color: rgba(107, 62, 38, 0.6);
    margin-bottom: 1.5rem;
}


/* ======================================
   TOOLTIPS
   ====================================== */

.tooltip {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--warmBrown);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 50;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--warmBrown);
}

.group:hover .tooltip {
    opacity: 1;
    visibility: visible;
}


/* ======================================
   UTILITIES
   ====================================== */

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 4px solid rgba(236, 168, 105, 0.3);
    border-top-color: var(--accent);
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(107, 62, 38, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}


/* ======================================
   SCROLLBAR
   ====================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cream);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accentHover);
}


/* ======================================
   SWEETALERT2 CUSTOMIZATION
   ====================================== */

.swal2-popup {
    font-family: 'Phetsarath', sans-serif !important;
}

.swal2-confirm {
    background-color: var(--accent) !important;
}

.swal2-confirm:hover {
    background-color: var(--accentHover) !important;
}
