/* ==========================================================================
   TNO - Times News Open - Base Styles
   ========================================================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f6f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #1a5276;
    text-decoration: none;
}

a:hover {
    color: #0d3547;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: #1a5276;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1em;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: #1a5276;
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.site-logo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.site-logo:hover {
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: transform 0.3s;
}

.site-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    color: rgba(255,255,255,0.85);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.site-main {
    flex: 1;
    padding: 30px 0;
}

.page-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.page-header h1 {
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
    margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.7);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer a {
    color: rgba(255,255,255,0.9);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    line-height: 1.4;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

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

.btn-primary {
    background: #1a5276;
    color: #fff;
}

.btn-primary:hover {
    background: #154360;
    color: #fff;
}

.btn-secondary {
    background: #5d6d7e;
    color: #fff;
}

.btn-secondary:hover {
    background: #4a5a6a;
    color: #fff;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
    color: #fff;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
    color: #fff;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background: #d68910;
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
    font-size: 0.9rem;
}

.form-group label .required {
    color: #c0392b;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #1a5276;
    box-shadow: 0 0 0 3px rgba(26,82,118,0.1);
}

.form-control.error {
    border-color: #c0392b;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

.form-actions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   Alerts / Flash Messages
   ========================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error, .alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

table th,
table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a5276;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

table tbody tr:hover {
    background: #f5f8fb;
}

table .text-center { text-align: center; }
table .text-right { text-align: right; }
table .text-nowrap { white-space: nowrap; }

.table-actions {
    display: flex;
    gap: 5px;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #1a5276;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 20px 0;
}

.page-link {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1a5276;
    background: #fff;
}

.page-link:hover {
    background: #e8f4fd;
    text-decoration: none;
}

.page-link.active {
    background: #1a5276;
    color: #fff;
    border-color: #1a5276;
}

.page-link.disabled {
    color: #aaa;
    pointer-events: none;
    background: #f8f8f8;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #888; }
.text-success { color: #27ae60; }
.text-danger { color: #c0392b; }
.text-warning { color: #f39c12; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.plus { color: #27ae60; }
.minus { color: #c0392b; }
.even { color: #888; }

.hidden { display: none; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    html { font-size: 15px; }

    .container { padding: 0 15px; }

    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a5276;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .site-nav.open { display: block; }

    .site-nav ul {
        flex-direction: column;
        padding: 10px 20px;
        gap: 0;
    }

    .site-nav a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .btn-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .site-main { padding: 20px 0; }

    .card-body { padding: 15px; }

    table th, table td { padding: 8px 10px; font-size: 0.85rem; }
}
