/**
 * Portal Custom Theme
 * Primary Color: #d00004 (Trimex Red)
 * ================================
 * Color Palette:
 * - Primary: #d00004
 * - Primary Dark: #a00003
 * - Primary Light: #ff1a1f
 * - Secondary: #2c3e50
 * - Accent: #e74c3c
 * - Success: #27ae60
 * - Warning: #f39c12
 * - Info: #3498db
 */

:root {
    --primary-color: #d00004;
    --primary-dark: #a00003;
    --primary-light: #ff1a1f;
    --primary-hover: #b00003;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #f8f9fa;
    --card-shadow: 0 2px 8px rgba(208, 0, 4, 0.1);
    --card-shadow-hover: 0 4px 16px rgba(208, 0, 4, 0.2);
}

/* ================================
   GLOBAL STYLES
   ================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* ================================
   NAVBAR
   ================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid var(--primary-dark);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
    vertical-align: middle;
}

.navbar-brand:hover {
    color: #ffe6e6 !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ================================
   BUTTONS
   ================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(208, 0, 4, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 12px rgba(208, 0, 4, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active,
.btn-primary:focus {
    background: var(--primary-dark) !important;
    box-shadow: 0 2px 4px rgba(208, 0, 4, 0.5) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(208, 0, 4, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2980b9 100%);
    border: none;
}

/* ================================
   CARDS
   ================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 1.5rem;
}

.card-title {
    color: var(--secondary-color);
    font-weight: 700;
}

/* ================================
   STATS CARDS
   ================================ */
.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-left-width: 6px;
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(208, 0, 4, 0.3);
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0.5rem 0;
}

/* ================================
   BADGES
   ================================ */
.badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2980b9 100%);
}

/* ================================
   FORMS
   ================================ */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(208, 0, 4, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: var(--light-bg);
    border-color: #ced4da;
    color: var(--secondary-color);
}

/* ================================
   ALERTS
   ================================ */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: var(--info-color);
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: var(--warning-color);
    color: #856404;
}

/* ================================
   TABLES
   ================================ */
.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    border: none;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(208, 0, 4, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(208, 0, 4, 0.05);
}

/* ================================
   PAGINATION
   ================================ */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(208, 0, 4, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/* ================================
   LOGIN & AUTH PAGES
   ================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, var(--primary-color) 100%);
    padding: 2rem;
}

.auth-card {
    max-width: 450px;
    width: 100%;
}

.auth-card .card {
    border-radius: 16px;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
}

.auth-body {
    padding: 2rem;
}

/* ================================
   PAYSLIP CARDS
   ================================ */
.payslip-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.payslip-card:hover {
    border-left-width: 6px;
    box-shadow: var(--card-shadow-hover);
}

.payslip-period {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.payslip-date {
    color: #6c757d;
    font-size: 0.875rem;
}

.payslip-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ================================
   PROFILE PAGE
   ================================ */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.profile-info {
    font-size: 1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* ================================
   DASHBOARD
   ================================ */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.welcome-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.welcome-card p {
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* ================================
   LOADING STATES
   ================================ */
.spinner-border-primary {
    color: var(--primary-color);
}

/* ================================
   UTILITIES
   ================================ */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .welcome-card h2 {
        font-size: 1.5rem;
    }
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
