/*
 * Modern UI Stylesheet
 * Reusable CSS for ColdFusion modernized pages
 * Version: 1.0
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
}
  
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    min-height: 100vh;
    color: var(--dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    /* padding: 2rem; */
}

/* Header */
.page-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 1.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease;
}

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

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray);
    font-size: 1rem;
}

/* Toolbar */
.toolbar {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.toolbar-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-control-plaintext {
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.75rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-export {
    background: white;
    color: var(--dark);
    border: 2px solid #e2e8f0;
}

.btn-export:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Card Container */
.card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.6s ease;
}

/* DataTables Styling */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    /* display: none; */
}

.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

.dataTable thead th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    /* color: white; */
    font-weight: 600;
    text-transform: uppercase;
    /* font-size: 0.75rem; */
    letter-spacing: 0.05em;
    padding: 1rem;
    border: none;
    white-space: nowrap;
}

.dataTable thead th:first-child {
    border-radius: 0.75rem 0 0 0;
}

.dataTable thead th:last-child {
    border-radius: 0 0.75rem 0 0;
}

.dataTable tbody tr {
    transition: all 0.2s ease;
}

.dataTable tbody tr:hover {
    background: var(--light);
    transform: translateX(2px);
}

.dataTable tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

/* Status Badges */
.badge {
    padding: 0.5rem 1.25rem;  /* Increased from 0.25rem 0.75rem */
    border-radius: 2rem;
    font-size: 1rem;           /* Increased from 0.75rem */
    font-weight: 600;
    display: inline-block;
}

.badge-open {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-weight: bold;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-closed {
    background: rgba(100, 116, 139, 0.1);
    color: var(--gray);
    font-weight: bold;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-pending {
    background: rgba(251, 146, 60, 0.1);
    color: var(--warning);
    font-weight: bold;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-weight: bold;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-weight: bold;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    font-weight: bold;
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(251, 146, 60, 0.1);
    color: var(--warning);
    font-weight: bold;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-weight: bold;
    border: 1px solid rgba(216, 13, 13, 0.3);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    font-weight: bold;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Autocomplete */
.autocomplete-results {
    position: absolute;
    border: 1px solid #e2e8f0;
    border-top: none;
    background: white;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -0.5rem;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.autocomplete-item:hover {
    background: var(--light);
}

/* Checkboxes */
.form-check {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 0.5rem;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Radio Buttons */
.form-radio {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.form-radio-input {
    cursor: pointer;
    margin-right: 0.5rem;
}

.form-radio-label {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(251, 146, 60, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--dark);
}

/* Tabs */
.tabs {
   /* display: flex; */
   gap: 0.5rem;
   border-bottom: 2px solid #e2e8f0;
   margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
} 

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-header {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .toolbar-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 1rem;
    }

    .dataTable thead th,
    .dataTable tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }
.ml-3 { margin-left: 1.5rem; }
.ml-4 { margin-left: 2rem; }

.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }
.mr-3 { margin-right: 1.5rem; }
.mr-4 { margin-right: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.w-full { width: 100%; }
.w-auto { width: auto; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.rounded { border-radius: 0.5rem; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
