/* ============================================
   Aplikasi Disposisi Surat - Custom Styles
   ============================================ */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 280px;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.card-header h5 {
    margin-bottom: 0;
}

/* Dashboard Stats */
.stat-card {
    border-radius: 10px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.stat-card.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
}

.stat-card.bg-gradient-success {
    background: linear-gradient(135deg, #198754 0%, #0f5132 100%);
}

.stat-card.bg-gradient-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
}

.stat-card.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #cc9a06 100%);
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table td {
    vertical-align: middle;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

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

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* File Upload */
.file-upload-wrapper {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.file-upload-wrapper.dragover {
    border-color: var(--primary-color);
    background-color: #e7f1ff;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.file-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--danger-color);
}

.file-preview-item .remove-file {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Disposisi Style */
.disposisi-text {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Letter Template Styles */
.letter-container {
    background: white;
    max-width: 210mm;
    margin: 0 auto;
    padding: 20mm 25mm;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.letter-kop {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.letter-logo {
    position: absolute;
    left: 25mm;
    width: 80px;
    height: auto;
}

.letter-kop-content {
    text-align: center;
}

.letter-title {
    font-size: 16pt;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.letter-subtitle {
    font-size: 14pt;
    font-weight: 600;
    margin: 0;
}

.letter-sub-subtitle {
    font-size: 11pt;
    margin: 0;
}

.letter-address {
    font-size: 10pt;
    margin: 0;
}

.double-underline {
    border-bottom: 3px double #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.letter-body {
    font-size: 12pt;
    line-height: 1.5;
}

.letter-body p {
    margin-bottom: 10px;
    text-align: justify;
}

.letter-ttd {
    margin-top: 30px;
    text-align: right;
}

.letter-ttd-block {
    display: inline-block;
    text-align: center;
    min-width: 150px;
}

.tembusan-list {
    margin-top: 30px;
    font-size: 11pt;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar, footer, .no-print {
        display: none !important;
    }
    
    .letter-container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    @page {
        size: A4 portrait;
        margin: 15mm;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* DataTables Custom */
.dataTables_wrapper .dataTables_length select {
    width: auto;
}

.dataTables_wrapper .dataTables_filter input {
    width: 200px;
}

/* Select2 Custom */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    min-height: 42px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
}

/* Summernote Custom */
.note-editor {
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.note-editor .note-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn-group .btn {
        flex: 1;
        border-radius: 6px !important;
    }
    
    .letter-container {
        padding: 10mm 15mm;
    }
}

/* Status Badges */
.status-baru {
    background-color: #0dcaf0;
    color: #000;
}

.status-diproses {
    background-color: #ffc107;
    color: #000;
}

.status-selesai {
    background-color: #198754;
    color: #fff;
}

.status-draft {
    background-color: #6c757d;
    color: #fff;
}

.status-terkirim {
    background-color: #0d6efd;
    color: #fff;
}

.status-arsip {
    background-color: #198754;
    color: #fff;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0aa2c0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    overflow: hidden;
}

.login-card .card-body {
    padding: 2rem;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Timeline untuk Disposisi */
.disposition-timeline {
    position: relative;
    padding-left: 30px;
}

.disposition-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.disposition-timeline-item {
    position: relative;
    margin-bottom: 15px;
    padding-left: 15px;
}

.disposition-timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
}
