/* Common Styles - Shared across all pages */

:root {
    --primary-blue: #001F54;
    --primary-orange: #FF7103;
    --accent-green: #008080;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --border-color: #ddd;
    --error-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 84, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error-color);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table thead {
    background-color: var(--light-gray);
    border-bottom: 2px solid var(--border-color);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    color: var(--primary-blue);
}

.table tbody tr:hover {
    background-color: rgba(0, 31, 84, 0.02);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: rgba(0, 31, 84, 0.1);
    color: var(--primary-blue);
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.badge-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background-color: var(--light-gray);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: var(--light-gray);
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: #666;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid rgba(0, 31, 84, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 0.6s linear infinite;
}

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

/* Responsive Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Dropdown/Select Styling */
select.form-control {
    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='%23001F54' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Print Styles */
@media print {

    header,
    footer,
    .btn,
    .modal {
        display: none !important;
    }

    .container {
        margin: 0;
        padding: 0;
    }

    body {
        background: white;
    }
}

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

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    text-align: center;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPop 0.5s ease;
}

.confirm-modal-icon.alert-triangle {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.confirm-modal-icon.trash {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.confirm-modal-icon.check {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.confirm-modal-icon.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.confirm-modal-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

@keyframes iconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0 0 0.75rem 0;
}

.confirm-modal-message {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-left: 4px solid;
    min-width: 320px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-message {
    flex: 1;
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #4b5563;
}

@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}

/* Standardized Pagination Styles */
.pagination-container {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    border-top: 1px solid #f1f5f9;
    background: white;
}

.pagination-info {
    display: flex;
    align-items: center;
    margin-right: auto;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.pagination-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 0.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-btn.active {
    background: var(--primary-blue);
    color: white !important;
    border-color: var(--primary-blue);
    box-shadow: 0 2px 6px rgba(0, 31, 84, 0.2);
}

.pagination-btn svg {
    width: 14px;
    height: 14px;
}

.pagination-ellipsis {
    padding: 0 0.4rem;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 0.85rem;
    user-select: none;
}

/* Global Loader Overly */
#globalLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    transition: opacity 0.3s ease;
}

#globalLoader.active {
    display: flex;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}