/**
 * Weekly Nets Main CSS
 * File: /weekly_nets/css/main.css
 * Purpose: Main stylesheet for the NET logging system
 * Follows W5OBM Website Development Guidelines
 */

/* ===== ROOT VARIABLES ===== */
:root {
    /*
     * Theme-aware palette:
     * - When the global header/theme system is loaded, prefer its CSS variables.
     * - When running standalone (no header), fall back to the legacy defaults.
     */
    --net-primary: var(--w5obm-primary, #007bff);
    --net-secondary: var(--w5obm-secondary, #6c757d);
    --net-success: var(--w5obm-success, #28a745);
    --net-danger: var(--w5obm-danger, #dc3545);
    --net-warning: var(--w5obm-warning, #ffc107);
    --net-info: var(--w5obm-info, #17a2b8);
    --net-light: var(--w5obm-light, #f8f9fa);
    --net-dark: var(--w5obm-dark, #343a40);

    /* Prefer Bootstrap 5 variables when present */
    --net-border: var(--bs-border-color, #dee2e6);
    --net-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --net-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --net-transition: all 0.3s ease;
}

/* ===== CONTAINER STYLING PER WEBSITE GUIDELINES ===== */
.master-container {
    max-width: 90%;
    margin: 50px auto 0 auto;
    padding: 30px;
    background: var(--bs-body-bg, #ffffff);
    border-radius: 8px;
    box-shadow: var(--net-shadow);
    border: 1px solid var(--net-border);
}

.centered-container {
    max-width: 100%;
    margin: 0 auto 30px auto;
    padding: 0 15px;
}

/* Responsive container widths */
@media (min-width: 768px) {
    .master-container {
        max-width: 85%;
    }
}

@media (min-width: 992px) {
    .master-container {
        max-width: 80%;
    }
}

@media (min-width: 1200px) {
    .master-container {
        max-width: 75%;
    }
}

/* ===== CARD STYLING PER WEBSITE GUIDELINES ===== */
.card {
    box-shadow: var(--net-shadow) !important;
    border-radius: 12px !important;
    border: none !important;
    margin: 0 auto;
    max-width: 100%;
    transition: var(--net-transition);
    background: var(--bs-body-bg, #ffffff);
}

.card:hover {
    box-shadow: var(--net-shadow-hover) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    background-color: var(--net-primary) !important;
    color: white !important;
}

.card-body {
    padding: 1.5rem;
}

/* ===== NET LOGGER SPECIFIC STYLES ===== */
.net-session-card {
    border-left: 4px solid var(--net-primary);
    margin-bottom: 20px;
}

.net-session-card.active {
    border-left-color: var(--net-success);
    background-color: var(--bs-success-bg-subtle, #f8fff9);
}

.net-session-card.completed {
    border-left-color: var(--net-secondary);
    background-color: var(--net-light);
}

.net-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.net-stat-box {
    background: var(--bs-body-bg, #ffffff);
    border: 1px solid var(--net-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--net-shadow);
    transition: var(--net-transition);
}

.net-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--net-shadow-hover);
}

.net-stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--net-primary);
    margin-bottom: 0.5rem;
}

.net-stat-label {
    color: var(--net-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== CHECKIN TABLE STYLES ===== */
.checkin-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--net-shadow);
}

.checkin-table th {
    background-color: var(--net-primary);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 600;
}

.checkin-table td {
    padding: 10px 12px;
    border-top: 1px solid var(--net-border);
}

.checkin-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* ===== BUTTON STYLING PER WEBSITE GUIDELINES ===== */
.btn {
    transition: var(--net-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--net-primary);
    border-color: var(--net-primary);
}

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

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

.btn-warning {
    background-color: var(--net-warning);
    border-color: var(--net-warning);
}

/* ===== FORM STYLING ===== */
.form-control,
.form-select {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--net-border);
    border-radius: 6px;
    transition: var(--net-transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--net-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--net-dark);
    margin-bottom: 0.5rem;
}

/* ===== NET LOGGER MODALS ===== */
.modal-header {
    background-color: var(--net-primary);
    color: white;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.modal-footer {
    border-top: 1px solid var(--net-border);
    padding: 1rem 1.5rem;
}

/* ===== CHECKIN TYPE BADGES ===== */
.checkin-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.checkin-type-regular {
    background-color: var(--net-primary);
    color: white;
}

.checkin-type-mobile {
    background-color: var(--net-warning);
    color: var(--net-dark);
}

.checkin-type-echolink {
    background-color: var(--net-info);
    color: white;
}

.checkin-type-traffic {
    background-color: var(--net-danger);
    color: white;
}

/* ===== NET STATUS INDICATORS ===== */
.net-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.net-status-active {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--net-success);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.net-status-completed {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--net-secondary);
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.net-status-scheduled {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--net-primary);
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.net-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ===== TRAFFIC HANDLING STYLES ===== */
.traffic-section {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.traffic-section h6 {
    color: #856404;
    margin-bottom: 0.75rem;
}

.traffic-priority {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.traffic-priority h6 {
    color: #721c24;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .master-container {
        margin: 10px auto;
        max-width: 95%;
        padding: 15px;
    }
    
    .net-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.75rem;
    }
    
    .net-stat-number {
        font-size: 1.5rem;
    }
    
    .checkin-table {
        font-size: 0.875rem;
    }
    
    .checkin-table th,
    .checkin-table td {
        padding: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

/* ===== DATATABLES INTEGRATION ===== */
.dataTables_wrapper {
    margin-top: 1rem;
}

.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    border: 1px solid var(--net-border);
    border-radius: 6px;
    padding: 6px 12px;
}

.dataTables_length select {
    border: 1px solid var(--net-border);
    border-radius: 6px;
    padding: 4px 8px;
}

/* ===== ANIMATION CLASSES ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* ===== LOADING SPINNER ===== */
.spinner-net {
    border: 3px solid var(--net-light);
    border-top: 3px solid var(--net-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */
.text-net-primary {
    color: var(--net-primary) !important;
}

.text-net-secondary {
    color: var(--net-secondary) !important;
}

.bg-net-light {
    background-color: var(--net-light) !important;
}

.border-net {
    border-color: var(--net-border) !important;
}

/* ===== RADIOGRAM MODAL (INLINE-STYLE FREE) ===== */
.w5obm-icon-40 {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.w5obm-icon-60 {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.w5obm-radiogram-strong-border {
    border: 2px solid #000 !important;
}

.w5obm-radiogram-underline {
    border: none !important;
    border-bottom: 1px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.w5obm-radiogram-w-80 {
    width: 80px !important;
}

.w5obm-radiogram-w-100 {
    width: 100px !important;
}

.w5obm-radiogram-w-120 {
    width: 120px !important;
}

.w5obm-radiogram-message-table {
    border: 2px solid #000 !important;
}

.w5obm-radiogram-cell {
    border: 1px solid #000 !important;
    width: 20%;
}

#radiogramModal .message-word {
    border: none !important;
    font-family: monospace;
    font-size: 12px;
    box-shadow: none !important;
}

/* ===== PRINT STYLES ===== */
@media print {
    .master-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .btn {
        display: none;
    }
    
    .net-status {
        border: 1px solid #000;
    }
}
