/* assets/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --bg-color: #f1f5f9;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.main-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.content-wrapper {
    flex: 1;
    padding: 2.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #fff;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control[readonly] {
    background-color: #f8fafc;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: #f8fafc;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: #f8fafc;
}

.pagination .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-width: 2.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

th {
    font-weight: 600;
    color: var(--secondary);
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* Responsive Media Queries */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .content-wrapper {
        padding: 1rem 0.5rem;
    }

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

    .card {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header .btn {
        width: 100%;
    }

    /* NCS Dashboard Specifics */
    #qsoForm {
        padding: 1rem;
    }

    #callsign {
        font-size: 1.25rem !important;
    }

    .btn {
        width: 100%;
    }

    /* Table adjustments for very small screens */
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Utility */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

/* Alerts */
.alert { 
    padding: 1rem; 
    border-radius: var(--radius); 
    margin-bottom: 1.5rem; 
    font-size: 0.95rem;
}
.alert-error { 
    background: #fef2f2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
}
.alert-success { 
    background: #ecfdf5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
}
.badge { 
    display: inline-block; 
    padding: 0.25rem 0.6rem; 
    border-radius: 9999px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    background: #e2e8f0; 
    color: #475569;
}
.badge.primary { background: #dbeafe; color: #1e40af; }
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
