/**
 * SIPEKA - Custom Styles
 * Sistem Penilaian Kinerja Pegawai
 */

/* ===========================================
   ROOT VARIABLES
   =========================================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-success: linear-gradient(135deg, #28a745, #20c997);
    --gradient-warning: linear-gradient(135deg, #ffc107, #fd7e14);
    --gradient-danger: linear-gradient(135deg, #dc3545, #e83e8c);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
}

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

/* ===========================================
   NAVBAR STYLES
   =========================================== */
.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.navbar-brand:hover {
    color: var(--secondary-color) !important;
}

/* ===========================================
   SIDEBAR STYLES
   =========================================== */
.sidebar {
    min-height: calc(100vh - 56px);
    background: var(--gradient-primary);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.3);
    transform: translateX(5px);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* ===========================================
   CARD STYLES
   =========================================== */
.card {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0 !important;
    border: none;
    padding: 1rem 1.5rem;
}

.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
}

/* ===========================================
   STATS CARDS
   =========================================== */
.stats-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.stats-card .stats-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* ===========================================
   BUTTON STYLES
   =========================================== */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    background: var(--gradient-primary);
}

.btn-success {
    background: var(--gradient-success);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
    background: var(--gradient-success);
}

.btn-warning {
    background: var(--gradient-warning);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
    background: var(--gradient-warning);
}

.btn-danger {
    background: var(--gradient-danger);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    background: var(--gradient-danger);
}

/* ===========================================
   TABLE STYLES
   =========================================== */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* ===========================================
   FORM STYLES
   =========================================== */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background-color: #fff;
}

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

/* ===========================================
   BADGE STYLES
   =========================================== */
.badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

.badge.bg-success {
    background: var(--gradient-success) !important;
}

.badge.bg-warning {
    background: var(--gradient-warning) !important;
}

.badge.bg-danger {
    background: var(--gradient-danger) !important;
}

/* ===========================================
   ALERT STYLES
   =========================================== */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(232, 62, 140, 0.1));
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(253, 126, 20, 0.1));
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(102, 126, 234, 0.1));
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ===========================================
   MODAL STYLES
   =========================================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    border: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border: none;
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
}

/* ===========================================
   TIMELINE STYLES
   =========================================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -35px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 3px solid white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.timeline-content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.timeline-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* ===========================================
   PROGRESS STYLES
   =========================================== */
.progress {
    height: 1rem;
    border-radius: var(--border-radius);
    background-color: rgba(102, 126, 234, 0.1);
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    transition: width 0.6s ease;
}

/* ===========================================
   PAGE HEADER STYLES
   =========================================== */
.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow);
}

.page-header h1, .page-header h2 {
    margin: 0;
    font-weight: 700;
}

.page-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .stats-card .stats-number {
        font-size: 1.5rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card .stats-icon {
        font-size: 2rem;
    }
    
    .stats-card .stats-number {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.bg-gradient-warning {
    background: var(--gradient-warning) !important;
}

.bg-gradient-danger {
    background: var(--gradient-danger) !important;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: var(--shadow) !important;
}

.shadow-lg-custom {
    box-shadow: var(--shadow-lg) !important;
}

.border-radius-custom {
    border-radius: var(--border-radius-xl) !important;
}

/* ===========================================
   ANIMATION STYLES
   =========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===========================================
   LOADING STYLES
   =========================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    .sidebar, .navbar, .btn, .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .stats-card {
        background: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Sticky header + shadow/shrink */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1055;
  height: 88px;
  background: var(--header-gradient);
  box-shadow: 0 2px 12px rgba(102,126,234,.05);
  transition: height .28s cubic-bezier(.4,0,.2,1), box-shadow .2s, background .2s, padding .18s;
}

body.navbar-shrink .navbar {
  height: 54px;
  background: var(--header-gradient);
  box-shadow: 0 6px 24px rgba(102,126,234,.17);
  padding-top: 4px;
  padding-bottom: 4px;
}

.main-content {
  padding-top: 100px;
  transition: padding-top .28s cubic-bezier(.4,0,.2,1);
}
body.navbar-shrink .main-content {
  padding-top: 64px;
}

/* Untuk logo shrink */
.navbar .brand-logo {
  transition: width .25s, height .25s, padding .25s;
  width: 70px;
  height: 70px;
}
body.navbar-shrink .navbar .brand-logo {
  width: 46px;
  height: 46px;
  padding: 7px;
}