/**
 * Fleet Crew - Main Stylesheet
 * =============================
 * Modern dark UI with Orbitron typography
 * 
 * This file imports all modular stylesheets in the correct order.
 * 
 * Structure:
 * 1. Theme - CSS variables, reset, base typography
 * 2. Layout - Grid, flexbox, containers, spacing
 * 3. Navigation - Header, nav, dropdowns, menus
 * 4. Components - Buttons, cards, forms, tables, badges
 * 5. Modals - Overlays, dialogs, toasts
 * 6. Utilities - Helper classes, colors, effects
 */

@import url('theme.css?v=20260206');
@import url('layout.css?v=20260206');
@import url('navigation.css?v=20260206');
@import url('components.css?v=20260206');
@import url('modals.css?v=20260206');
@import url('utilities.css?v=20260206');

/* ============================
   Page-Specific Overrides
   ============================ */

/* Login Page - Full screen centered layout */
.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.login-card {
    width: 100%;
    max-width: 500px;
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-title {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    text-shadow: 0 0 20px var(--color-primary-glow);
    margin: 0;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    letter-spacing: 2px;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: var(--space-2xl);
}

.dashboard-welcome {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.dashboard-welcome h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-sm);
}

.dashboard-welcome .highlight {
    color: var(--color-primary);
}

/* Changelog & Announcements */
.changelog-item,
.announcement-item {
    border-left: 3px solid var(--color-primary);
    padding-left: var(--space-md);
    margin-bottom: var(--space-lg);
}

.changelog-version {
    color: var(--color-primary);
    font-weight: 700;
}

.changelog-date {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Message Labels */
.msg-label-om {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--color-accent-gold);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-accent-gold);
}

.msg-label-platoon {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(211, 47, 47, 0.2);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
}

/* Ticker (Login Page) */
.login-ticker {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 50;
}

.ticker-prefix {
    color: var(--color-error);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.ticker-text {
    color: var(--text-primary);
    text-shadow: 0 0 5px black;
}

/* Timeclock Page */
.timeclock-grid {
    display: grid;
    gap: var(--space-md);
}

.timeclock-slot {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    transition: all var(--transition-base);
}

.timeclock-slot:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow-sm);
}

.timeclock-slot.active {
    border-color: var(--color-success);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

/* Profile Page */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--color-primary);
    object-fit: cover;
}

.profile-info h2 {
    margin-bottom: var(--space-xs);
}

.profile-meta {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Ribbon Display */
.ribbon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ribbon-bar {
    width: 60px;
    height: 18px;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* Statistics Charts */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
}

/* Points Table */
.points-table {
    width: 100%;
}

.points-table th,
.points-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.points-cell-positive {
    color: var(--color-success);
}

.points-cell-negative {
    color: var(--color-error);
}

/* Admin Panel */
.admin-user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
}

.admin-user-card:hover {
    border-color: var(--color-primary);
}

/* Troop Management */
.troop-slot {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-base);
}

.troop-slot.occupied {
    border-color: var(--color-success);
    background: rgba(76, 175, 80, 0.1);
}

.troop-slot.empty {
    border-style: dashed;
    color: var(--text-muted);
}

/* Revision/Case System */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.case-header {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.case-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.case-status-open {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
}

.case-status-closed {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .dashboard-welcome h1 {
        font-size: var(--font-size-2xl);
    }
    
    .login-title {
        font-size: var(--font-size-2xl);
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
}

/* ============================
   Points / Activity Matrix Table
   ============================ */
.matrix-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.matrix-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    max-height: 70vh;
    overflow-y: auto;
}

.matrix-main {
    min-width: 0;
}

.archive-link {
    display: block;
    padding: 10px 12px;
    margin-bottom: 5px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
}

.archive-link:hover {
    background: var(--bg-elevated);
    color: var(--text-white);
}

.archive-link.active {
    background: rgba(211, 47, 47, 0.15);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
}

.archive-item-wrapper.arch-hidden {
    opacity: 0.5;
}

.archive-item-wrapper.arch-test .archive-link {
    color: #9c27b0;
    font-style: italic;
}

/* Activity Table Styles */
#activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#activity-table th,
#activity-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #333;
    white-space: nowrap;
}

#activity-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-row-top th {
    background: #1a1a1a;
    color: var(--text-white);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 6px;
}

.header-row-bottom th {
    background: #111;
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 6px 4px;
}

.border-right {
    border-right: 2px solid #444 !important;
}

/* Group Colors */
.group-fb { background: rgba(103, 58, 183, 0.15); color: #b39ddb; }
.group-tr { background: rgba(0, 150, 136, 0.15); color: #80cbc4; }
.group-to { background: rgba(255, 193, 7, 0.15); color: #ffe082; }
.group-no { background: rgba(33, 150, 243, 0.15); color: #90caf9; }
.group-om { background: rgba(76, 175, 80, 0.15); color: #a5d6a7; }
.group-extra { background: rgba(156, 39, 176, 0.15); color: #ce93d8; }
.group-result { background: rgba(255, 255, 255, 0.05); color: white; }

/* User Row */
.user-row {
    background: #0a0a0a;
    transition: background 0.2s;
}

.user-row:hover {
    background: #151515;
}

.user-row:nth-child(even) {
    background: #0d0d0d;
}

.user-row:nth-child(even):hover {
    background: #151515;
}

/* Cell Styles */
.col-tiny { width: 40px; }
.col-rank { width: 50px;  font-size: 0.7rem; color: var(--text-muted); }
.col-name { width: 120px; text-align: left !important; }
.personal-rank-cell { color: var(--color-primary); font-weight: bold; }
.personal-name-cell { color: white !important; }

/* Input Styles in Table */
#activity-table input[type="number"],
#activity-table input.num-calc {
    width: 45px;
    padding: 4px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: white;
    text-align: center;
    font-size: 0.8rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

#activity-table input[type="number"]::-webkit-outer-spin-button,
#activity-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#activity-table input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #222;
}

#activity-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* Result Cells */
.result-sum {
    font-weight: bold;
    font-size: 1rem !important;
    color: var(--color-success) !important;
}

.duty-val {
    font-size: 0.8rem;
}

/* Action Buttons */
.btn-action-green {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #81c784;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-action-green:hover {
    background: rgba(76, 175, 80, 0.35);
}

.btn-action-blü {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid #2196f3;
    color: #64b5f6;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-action-blü:hover {
    background: rgba(33, 150, 243, 0.35);
}

/* ============================
   Points Legend Box
   ============================ */
.legend-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-top: 30px;
}

.legend-header {
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

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

.legend-table th {
    background: var(--bg-elevated);
    color: var(--text-white);
    padding: 12px 15px;
    text-align: left;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.legend-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #222;
    color: var(--text-gray);
    vertical-align: top;
}

.legend-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.legend-table .pts {
    
    font-weight: bold;
    color: var(--color-success);
    font-size: 1.3rem;
}

/* Responsive Matrix */
@media (max-width: 1200px) {
    .matrix-layout {
        grid-template-columns: 1fr;
    }
    
    .matrix-sidebar {
        max-height: 200px;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .matrix-sidebar h4 {
        width: 100%;
    }
    
    .archive-link {
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    #activity-table {
        font-size: 0.7rem;
    }
    
    #activity-table input[type="number"] {
        width: 35px;
        padding: 2px;
    }
    
    .header-row-top th,
    .header-row-bottom th {
        padding: 4px 2px;
        font-size: 0.6rem;
    }
}

/* ============================
   FAB Design Menu
   ============================ */
.design-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.design-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6a1b1b);
    border: 2px solid var(--color-primary);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(211, 47, 47, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-fab-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(211, 47, 47, 0.6);
}

.design-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
}

.design-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.design-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.design-option:hover {
    background: var(--bg-elevated);
    color: var(--text-white);
}

.design-option .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* White mode - design menu */
.theme-white .design-fab-btn {
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.3) !important;
}
.theme-white .design-fab-btn:hover {
    box-shadow: 0 6px 30px rgba(21, 101, 192, 0.4) !important;
}
.theme-white .design-menu {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}
.theme-white .design-option {
    color: #616161 !important;
}
.theme-white .design-option:hover {
    background: #f5f5f5 !important;
    color: #212121 !important;
}
.theme-white .design-option .dot {
    border-color: rgba(0, 0, 0, 0.2) !important;
}

/* ============================
   Dashboard Layout Improvements
   ============================ */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-lg);
}

@media (max-width: 1200px) {
    .dashboard-grid-main {
        grid-template-columns: 1fr;
    }
}

/* ============================
   Revision Dashboard Improvements  
   ============================ */
.rev-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.rev-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.rev-stat-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.rev-stat-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.rev-stat-value {
    font-size: 2rem;
    font-weight: bold;
    
    color: var(--text-white);
}

.rev-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--space-xs);
}

.rev-recent-list {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
    overflow: hidden;
}

.rev-recent-header {
    background: var(--bg-elevated);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    font-family: 'Orbitron', sans-serif;
    color: var(--text-white);
    font-weight: bold;
}

.rev-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.2s;
    cursor: pointer;
}

.rev-recent-item:hover {
    background: var(--bg-elevated);
}

.rev-recent-item:last-child {
    border-bottom: none;
}

@media (max-width: 900px) {
    .rev-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .rev-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   White Mode Overrides for main.css
   ============================ */
.theme-white #activity-table th,
.theme-white #activity-table td {
    border-color: rgba(0, 0, 0, 0.1) !important;
}
.theme-white .header-row-top th {
    background: #e8eaf6 !important;
    color: #37474f !important;
}
.theme-white .header-row-bottom th {
    background: #f0f0f0 !important;
    color: #757575 !important;
}
.theme-white .border-right {
    border-right-color: rgba(0, 0, 0, 0.15) !important;
}
.theme-white .group-fb { background: rgba(103, 58, 183, 0.08) !important; color: #7b1fa2 !important; }
.theme-white .group-tr { background: rgba(0, 150, 136, 0.08) !important; color: #00897b !important; }
.theme-white .group-to { background: rgba(255, 193, 7, 0.08) !important; color: #f9a825 !important; }
.theme-white .group-no { background: rgba(33, 150, 243, 0.08) !important; color: #1976d2 !important; }
.theme-white .group-om { background: rgba(76, 175, 80, 0.08) !important; color: #388e3c !important; }
.theme-white .group-extra { background: rgba(156, 39, 176, 0.08) !important; color: #8e24aa !important; }
.theme-white .group-result { background: rgba(0, 0, 0, 0.03) !important; color: #212121 !important; }
.theme-white .user-row {
    background: #ffffff !important;
}
.theme-white .user-row:hover {
    background: #f5f5f5 !important;
}
.theme-white .user-row:nth-child(even) {
    background: #fafafa !important;
}
.theme-white .user-row:nth-child(even):hover {
    background: #f0f0f0 !important;
}
.theme-white .col-rank { color: #757575 !important; }
.theme-white .personal-rank-cell { color: #1565c0 !important; }
.theme-white .personal-name-cell { color: #212121 !important; }
.theme-white #activity-table input[type="number"],
.theme-white #activity-table input.num-calc {
    background: #f8f8f8 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #212121 !important;
}
.theme-white #activity-table input[type="number"]:focus {
    background: #ffffff !important;
    border-color: #1565c0 !important;
}
.theme-white .rev-recent-item {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
.theme-white .rev-recent-header {
    color: #212121 !important;
}