/**
 * Mana App - Main Stylesheet
 */

/* ==================== Global Styles ==================== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --success-color: #48bb78;
    --info-color: #4299e1;
    --warning-color: #ed8936;
    --danger-color: #f56565;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

main {
    flex: 1;
}

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

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

/* ==================== Cards ==================== */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* ==================== Buttons ==================== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
}

/* ==================== Forms ==================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label.fw-bold {
    color: #344054;
}

/* ==================== Tables ==================== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #1d2939;
    color: #fff;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    padding: 0.75rem;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa;
}

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

/* ==================== Preview Modal ==================== */
#previewModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#previewModal .modal-title {
    font-weight: 600;
}

.preview-content {
    max-height: calc(100vh - 300px);
    overflow: auto;
}

.preview-content .table-responsive {
    max-height: 100%;
}

/* ==================== Loading Overlay ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==================== Toast Notifications ==================== */
.toast {
    min-width: 300px;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

/* ==================== Badge ==================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* ==================== Date Range Buttons ==================== */
.btn-group .btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: var(--primary-color);
}

/* ==================== Quick Action Buttons ==================== */
.btn-outline-primary.py-3,
.btn-outline-success.py-3,
.btn-outline-info.py-3,
.btn-outline-warning.py-3 {
    transition: all 0.2s ease-in-out;
}

.btn-outline-primary.py-3:hover,
.btn-outline-success.py-3:hover,
.btn-outline-info.py-3:hover,
.btn-outline-warning.py-3:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==================== Material Summary Cards ==================== */
.card.bg-light .card-title {
    margin-bottom: 0;
}

.card.bg-light .card-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== Footer ==================== */
.footer {
    margin-top: auto;
    border-top: 1px solid #e9ecef;
}

/* ==================== Responsive Adjustments ==================== */
@media (max-width: 768px) {
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    .preview-content {
        max-height: calc(100vh - 350px);
    }

    .modal-footer .row {
        flex-direction: column;
    }

    .modal-footer .col-md-6 {
        margin-bottom: 1rem;
    }

    .modal-footer .col-md-6:last-child {
        text-align: center !important;
    }
}

/* ==================== Scrollbar Styling ==================== */
.preview-content::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-content::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* ==================== Print Styles ==================== */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal-footer {
        display: none !important;
    }

    .preview-content {
        max-height: none;
        overflow: visible;
    }
}
