/* NWS Warning Tags Application Custom Styles */

/* Enhanced form styling */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check-label {
    cursor: pointer;
}

/* Fieldset styling for better visual hierarchy */
fieldset {
    background: rgba(var(--bs-light-rgb), 0.5);
}

fieldset legend {
    width: auto;
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    border: none;
}

/* Card enhancements */
.card-header h4 {
    font-weight: 600;
}

/* Table styling improvements */
.table-responsive {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-height: 70vh; /* Limit height to enable scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
}

.table {
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    background: var(--bs-light);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

/* Ensure sticky headers work properly in responsive containers */
.table-responsive .table thead.sticky th {
    position: sticky;
    top: 0;
    background: var(--bs-light);
    z-index: 10;
}

.table tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Interactive table buttons */
.btn[id^="create-grid-"] {
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn[id^="create-grid-"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Warning type specific colors */
.bg-tornado { background-color: #dc3545 !important; }
.bg-severe { background-color: #ffc107 !important; }
.bg-flood { background-color: #0dcaf0 !important; }
.bg-marine { background-color: #0d6efd !important; }

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #0dcaf0;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
}

/* Code block styling */
code {
    background-color: rgba(var(--bs-dark-rgb), 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Breadcrumb styling */
.breadcrumb {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

/* Container improvements */
.container-fluid {
    max-width: 1400px;
}

/* Download button group styling */
.btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Tabulator container styling */
[id$="-tabulator"] {
    margin-top: 1rem;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Tabulator theme overrides */
.tabulator .tabulator-header {
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--bs-border-color);
}

.tabulator .tabulator-header .tabulator-col {
    border-right: 1px solid var(--bs-border-color);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tabulator .tabulator-row:nth-child(even) {
    background-color: rgba(var(--bs-light-rgb), 0.5);
}

.tabulator .tabulator-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.tabulator .tabulator-cell {
    border-right: 1px solid var(--bs-border-color-translucent);
    padding: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    fieldset {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .card-header h4 {
        font-size: 1.1rem;
    }
}

/* Desktop full-width tables */
@media (min-width: 992px) {
    .warning-tables .row {
        display: block;
    }
    
    .warning-tables .col-lg-6 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    .warning-tables .card {
        height: auto;
    }
}

/* Print styles */
@media print {
    .btn, .alert, nav {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Focus styles for accessibility */
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Loading state styling */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Icon spacing improvements */
.bi {
    vertical-align: -0.125em;
}
