/* ==========================================
   COMPONENT STYLES
   ========================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-200);
}

.btn-success {
    background-color: var(--accent-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

/* Cards */
.card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.1);
    padding: var(--space-6);
    transition: all var(--transition-base);
    border: 1px solid rgba(184, 230, 249, 0.5);
    backdrop-filter: blur(10px);
}

.card:hover {
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.15);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: 0;
}

.card-body {
    margin-bottom: var(--space-4);
}

.card-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    font-size: var(--text-base);
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    color: var(--accent-red);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
}

.table thead {
    background: linear-gradient(135deg, #e0f7ff 0%, #b8e6f9 100%);
}

.table th {
    padding: var(--space-4);
    text-align: left;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-sm);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background-color: var(--accent-green-light);
    color: #065f46;
}

.badge-warning {
    background-color: var(--accent-orange-light);
    color: #92400e;
}

.badge-danger {
    background-color: var(--accent-red-light);
    color: #991b1b;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-base);
}

.modal-backdrop.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* Alert/Notification */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert-success {
    background-color: var(--accent-green-light);
    color: #065f46;
    border-left: 4px solid var(--accent-green);
}

.alert-error {
    background-color: var(--accent-red-light);
    color: #991b1b;
    border-left: 4px solid var(--accent-red);
}

.alert-warning {
    background-color: var(--accent-orange-light);
    color: #92400e;
    border-left: 4px solid var(--accent-orange);
}

.alert-info {
    background-color: var(--primary-50);
    color: var(--primary-800);
    border-left: 4px solid var(--primary-500);
}

/* Stats Card */
.stat-card {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-label {
    font-size: var(--text-sm);
    opacity: 0.9;
    font-weight: var(--font-medium);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin-top: var(--space-2);
}

.stat-icon {
    font-size: var(--text-4xl);
    opacity: 0.2;
    position: absolute;
    right: var(--space-6);
    top: 50%;
    transform: translateY(-50%);
}

/* Officer Stats (Per-Petugas Statistics) */
.officer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
}

.officer-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
    border: 2px solid rgba(2, 132, 199, 0.2);
    transition: all var(--transition-base);
}

.officer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.2);
    border-color: var(--primary-500);
}

.officer-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid rgba(2, 132, 199, 0.1);
}

.officer-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.officer-info h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.officer-info p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

.officer-stats-row {
    background: rgba(245, 248, 250, 0.8);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

.officer-stats-row:last-child {
    margin-bottom: 0;
}

.officer-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.officer-stat-item:last-child {
    margin-bottom: 0;
}

.officer-stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
}

.officer-stat-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.officer-stat-value.success {
    color: var(--accent-green);
}

.officer-stat-value.danger {
    color: var(--accent-red);
}

/* Mobile responsive for officer stats */
@media (max-width: 768px) {
    .officer-stats-grid {
        grid-template-columns: 1fr;
    }
}