/* ============================================================
   GSDF Training Portal - Global Stylesheet
   Georgia State Defense Force
   Primary: #212931 | Accent: #c8a951
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f5f7;
    color: #212931;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #c8a951;
    text-decoration: none;
}

a:hover {
    color: #b8993e;
    text-decoration: underline;
}

/* ---- NAVBAR ---- */
.navbar {
    background: #212931;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.navbar-brand:hover {
    color: #c8a951;
    text-decoration: none;
}

.navbar-brand-text {
    line-height: 1.2;
}

.navbar-brand-title {
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar-brand-subtitle {
    font-size: 0.7em;
    color: #c8a951;
    font-weight: 400;
}

.navbar-collapse {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-links a {
    color: #ccc;
    font-size: 0.9em;
    padding: 8px 14px;
    border-radius: 5px;
    transition: all 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: #fff;
    background: rgba(200, 169, 81, 0.15);
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ccc;
    font-size: 0.9em;
}

.navbar-user .user-name {
    color: #c8a951;
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid #c8a951;
    color: #c8a951;
    padding: 6px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-logout:hover {
    background: #c8a951;
    color: #212931;
    text-decoration: none;
}

/* ---- FOOTER ---- */
.footer {
    background: #212931;
    color: #999;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 0.85em;
}

.footer strong {
    color: #c8a951;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* ---- AUTH PAGES ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #212931 0%, #1a1f25 50%, #2c3440 100%);
    padding: 30px 20px;
}

.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
}

.auth-brand-header {
    color: #ffffff;
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 22px;
    line-height: 1.2;
    border-bottom: 3px solid #c8a951;
    padding-bottom: 16px;
    width: 100%;
}

.auth-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    width: 100%;
    align-self: stretch;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #212931;
    font-size: 1.6em;
    margin-bottom: 5px;
}

.auth-header p {
    color: #888;
    font-size: 0.9em;
}

/* ---- CAPTCHA ---- */
.captcha-group {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #d0d7e3;
}

.captcha-group label {
    color: #212931;
    font-size: 0.95em;
}

/* ---- FORMS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #c8a951;
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: #212931;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #c8a951;
    color: #212931;
}

.btn-gold {
    background: #c8a951;
    color: #212931;
}

a.btn-gold:hover,
.btn-gold:hover {
    background: #b8993e;
    color: #212931 !important;
    text-decoration: none !important;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-google {
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    margin-top: 15px;
}

.btn-google:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #aaa;
    font-size: 0.85em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.auth-divider span {
    padding: 0 12px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: #888;
}

.auth-footer a {
    color: #c8a951;
    font-weight: 600;
}

/* ---- ALERTS ---- */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ---- DASHBOARD ---- */
.dashboard-welcome {
    margin-bottom: 40px;
}

.dashboard-welcome h2 {
    font-size: 1.8em;
    color: #212931;
    margin-bottom: 5px;
}

.dashboard-welcome p {
    color: #888;
    font-size: 1em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 960px;
    margin: 0 auto;
}

.dashboard-card {
    background: #212931;
    border-radius: 12px;
    padding: 35px 25px;
    text-align: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 2px solid transparent;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: #c8a951;
    text-decoration: none;
    color: #fff;
}

.dashboard-card .card-icon {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.dashboard-card .card-title {
    font-size: 1.2em;
    font-weight: 700;
}

.dashboard-card .card-desc {
    font-size: 0.85em;
    color: #aaa;
}

/* ---- CONTENT PAGES ---- */
.content-page {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.content-page h2 {
    color: #212931;
    font-size: 1.8em;
    margin-bottom: 5px;
    padding-bottom: 15px;
    border-bottom: 3px solid #c8a951;
}

.content-page .content-body {
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
    white-space: pre-line;
    margin-top: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c8a951;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.back-link:hover {
    color: #212931;
}

/* ---- RANK QUIZ ---- */
.quiz-container {
    max-width: 650px;
    margin: 0 auto;
}

.score-board {
    background: #212931;
    color: #fff;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.score-item {
    text-align: center;
}

.score-label {
    color: #aaa;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #c8a951;
}

.rank-display {
    text-align: center;
    margin: 25px 0;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    border: 3px solid #212931;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.rank-image {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 140px;
}

.rank-image img {
    width: 120px;
    height: auto;
    max-height: 200px !important;
    display: block;
}

.question {
    font-size: 1.2em;
    color: #212931;
    font-weight: 600;
}

.options {
    display: grid;
    gap: 12px;
    margin: 25px 0;
}

.option-btn {
    background: #fff;
    border: 2px solid #212931;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: #212931;
}

.option-btn:hover {
    background: #212931;
    color: #fff;
    transform: translateX(5px);
}

.category-badge {
    display: inline-block;
    background: #c8a951;
    color: #212931;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 10px;
}

.feedback-msg {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 1.05em;
}

.feedback-msg.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback-msg.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.btn-next {
    background: #212931;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-next:hover {
    background: #c8a951;
    color: #212931;
}

.btn-reset {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #b02a37;
    border-color: #b02a37;
    color: #fff;
}

/* ---- FEEDBACK FORM ---- */
.feedback-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* ---- ADMIN ---- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-header h2 {
    color: #212931;
    font-size: 1.5em;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 30px auto;
}

.admin-card {
    background: #fff;
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.2s;
    text-decoration: none;
    color: #212931;
    border: 2px solid transparent;
}

.admin-card:hover {
    border-color: #c8a951;
    transform: translateY(-3px);
    text-decoration: none;
    color: #212931;
}

.admin-card .card-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.admin-card .card-title {
    font-weight: 700;
    font-size: 1em;
}

/* ---- TABLES ---- */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.data-table th {
    background: #212931;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge-admin {
    background: #c8a951;
    color: #212931;
}

.badge-user {
    background: #e0e0e0;
    color: #555;
}

.badge-unread {
    background: #dc3545;
    color: #fff;
}

.badge-read {
    background: #28a745;
    color: #fff;
}

/* ---- EDIT FORM ---- */
.edit-form {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.edit-form textarea {
    min-height: 300px;
    resize: vertical;
    font-family: inherit;
}

/* ---- TRAINING PAGE ---- */
.training-category {
    margin-top: 30px;
}

.training-category-title {
    font-size: 1.2em;
    color: #212931;
    padding: 10px 15px;
    background: #f0f1f3;
    border-left: 4px solid #c8a951;
    border-radius: 0 6px 6px 0;
    margin-bottom: 15px;
}

.training-item {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.training-item:hover {
    background: #f8f9fa;
}

.training-item-bullet {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: #c8a951;
    border-radius: 50%;
    margin-top: 7px;
}

.training-item-content {
    flex: 1;
}

.training-item-title {
    font-weight: 600;
    font-size: 1em;
    color: #212931;
    margin-bottom: 3px;
}

.training-item-title a {
    color: #212931;
    text-decoration: none;
    border-bottom: 1px dashed #c8a951;
}

.training-item-title a:hover {
    color: #c8a951;
    text-decoration: none;
}

.training-item-url {
    margin-top: 3px;
}

.training-item-url a {
    font-size: 0.82em;
    color: #3498db;
    word-break: break-all;
}

.training-item-url a:hover {
    color: #2980b9;
}

.training-item-file {
    font-size: 0.85em;
    color: #888;
    margin-top: 4px;
}

.training-item-file a {
    color: #c8a951;
    font-weight: 600;
}

.training-item-note {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fff8e1;
    border-left: 3px solid #f39c12;
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    color: #856404;
    line-height: 1.5;
}

/* ---- NOTE CARDS ---- */
.note-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #c8a951;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.note-card-header strong {
    font-size: 1.05em;
    color: #212931;
}

.note-date {
    font-size: 0.8em;
    color: #999;
}

.note-card-body {
    color: #555;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 12px;
}

.note-card-actions {
    display: flex;
    gap: 8px;
}

/* ---- FEEDBACK HISTORY ---- */
.feedback-history-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #212931;
}

.feedback-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.feedback-history-date {
    font-size: 0.8em;
    color: #999;
}

.feedback-history-subject {
    font-weight: 700;
    font-size: 1.05em;
    color: #212931;
    margin-bottom: 6px;
}

.feedback-history-message {
    color: #555;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 12px;
}

.feedback-history-footer {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ---- DOCUMENT CARDS ---- */
.doc-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #eee;
    transition: border-color 0.2s;
}

.doc-card:hover {
    border-color: #c8a951;
}

.doc-card-icon {
    font-size: 1.8em;
    min-width: 40px;
    text-align: center;
}

.doc-card-body {
    flex: 1;
    min-width: 0;
}

.doc-card-type {
    margin-bottom: 4px;
}

.doc-card-title {
    font-weight: 600;
    color: #212931;
    font-size: 0.95em;
}

.doc-card-meta {
    font-size: 0.78em;
    color: #999;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
        height: auto;
        flex-wrap: wrap;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 10px;
        margin-top: 8px;
    }

    .navbar-collapse.open {
        display: flex;
    }

    .navbar-links {
        flex-direction: column;
        gap: 2px;
        width: 100%;
    }

    .navbar-links a {
        padding: 10px 14px;
        border-radius: 6px;
    }

    .navbar-user {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 6px;
    }

    .btn-logout {
        text-align: center;
    }

    .main-content {
        padding: 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .content-page {
        padding: 25px 20px;
    }

    .auth-brand-header {
        font-size: 1.4em;
        letter-spacing: 2px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .auth-container {
        padding: 25px;
    }

    .score-board {
        padding: 12px 8px;
        gap: 0;
    }
    .score-item {
        flex: 1;
        padding: 4px 6px;
        border-right: 1px solid #333;
    }
    .score-item:last-child {
        border-right: none;
    }
    .score-label {
        font-size: 0.72em;
        margin-bottom: 2px;
    }
    .score-value {
        font-size: 1.15em;
    }

    .doc-card {
        flex-wrap: wrap;
    }

    .doc-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ---- RESPONSIVE TABLES (card layout on small screens) ---- */
@media (max-width: 768px) {
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 14px 16px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        position: relative;
    }

    .data-table td {
        border-bottom: none;
        padding: 6px 0;
        font-size: 0.9em;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.78em;
        text-transform: uppercase;
        color: #888;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        min-width: 90px;
    }

    .data-table td:empty {
        display: none;
    }

    .data-table td.actions,
    .data-table td:last-child .actions {
        justify-content: flex-end;
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid #f0f0f0;
    }

    .data-table .actions {
        flex-wrap: wrap;
    }

    .data-table td img {
        max-height: 50px;
    }

    .table-container {
        overflow-x: visible;
    }
}
