/**
 * Tactical Planning Page - RSI HUD Theme
 * Hyperion Interstellar Design System
 */

/* ============================================
   Page Layout
   ============================================ */
.tactical-page {
    position: relative;
    z-index: 1;
    animation: hy-fade-in 0.25s;
    min-height: calc(100vh - 48px);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Header Section
   ============================================ */
.tactical-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 8px;
}

.tactical-header__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tactical-header__kicker {
    font-family: var(--hy-font-mono);
    font-size: 10px;
    color: var(--hy-accent);
    letter-spacing: 0.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tactical-header__kicker::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--hy-accent);
}

.tactical-header__kicker-sub {
    color: var(--hy-ink-3);
}

.tactical-header__title {
    margin: 0;
    font-family: var(--hy-font-display);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--hy-ink);
    text-transform: uppercase;
    line-height: 1;
}

.tactical-header__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   View Toggle (2D/3D/Split)
   ============================================ */
.tactical-view-toggle {
    display: flex;
    padding: 2px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--hy-border-soft);
    gap: 0;
}

.tactical-view-toggle .mud-button-root {
    min-width: 48px;
    padding: 5px 12px;
    border: none !important;
    border-radius: 0 !important;
    font-family: var(--hy-font-mono);
    font-size: 9px;
    letter-spacing: 0.18em;
}

.tactical-view-toggle .mud-button-root:hover {
    background: rgba(255, 122, 38, 0.15);
}

/* ============================================
   Plans List View
   ============================================ */
.tactical-plans-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tactical-plans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--hy-panel);
    border: 1px solid var(--hy-border-soft);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    backdrop-filter: blur(10px);
}

.tactical-plans-header__title {
    font-family: var(--hy-font-mono);
    font-size: 10px;
    color: var(--hy-accent);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tactical-plans-header__count {
    color: var(--hy-ink-3);
    font-weight: 400;
}

/* ============================================
   Plan Card
   ============================================ */
.tactical-plan-card {
    position: relative;
    background: var(--hy-panel);
    border: 1px solid var(--hy-border-soft);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.7, 0.3, 1.2);
    overflow: hidden;
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 0 16px 0 0;
}

.tactical-plan-card:hover {
    transform: translateY(-2px);
    border-color: var(--hy-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px var(--hy-accent-glow);
}

.tactical-plan-card__thumbnail {
    width: 180px;
    height: 100px;
    background: var(--hy-panel-solid);
    position: relative;
    overflow: hidden;
}

.tactical-plan-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tactical-plan-card__thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hy-panel-solid), rgba(255, 122, 38, 0.05));
}

.tactical-plan-card__thumbnail-placeholder svg {
    width: 32px;
    height: 32px;
    color: var(--hy-ink-3);
}

.tactical-plan-card__content {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
}

.tactical-plan-card__title {
    font-family: var(--hy-font-title);
    font-size: 14px;
    color: var(--hy-ink);
    letter-spacing: 0.04em;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tactical-plan-card__meta {
    display: flex;
    gap: 16px;
    font-family: var(--hy-font-mono);
    font-size: 10px;
    color: var(--hy-ink-3);
    letter-spacing: 0.08em;
}

.tactical-plan-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tactical-plan-card__meta-item .mud-icon-root {
    font-size: 14px;
}

.tactical-plan-card__description {
    margin-top: 6px;
    font-size: 12px;
    color: var(--hy-ink-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tactical-plan-card__actions {
    display: flex;
    gap: 8px;
    padding: 12px 0;
}

/* ============================================
   Editor Layout
   ============================================ */
.tactical-editor-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 10px;
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--hy-panel);
    border: 1px solid var(--hy-border-soft);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    backdrop-filter: blur(10px);
}

.plan-title {
    font-family: var(--hy-font-title);
    font-size: 14px;
    color: var(--hy-ink);
    letter-spacing: 0.04em;
}

.editor-content {
    display: grid;
    grid-template-columns: 260px 1fr auto;
    gap: 12px;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* ============================================
   Editor Sidebars
   ============================================ */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.editor-sidebar.left-sidebar {
    width: 260px;
}

.editor-sidebar.right-sidebar {
    width: 280px;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.editor-sidebar.right-sidebar.collapsed {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

/* History toggle button */
.history-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 48px;
    background: var(--hy-panel);
    border: 1px solid var(--hy-border-soft);
    border-right: none;
    color: var(--hy-ink-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    z-index: 10;
    transition: all 0.2s;
}

.history-toggle-btn:hover {
    color: var(--hy-accent);
    border-color: var(--hy-accent);
}

.history-toggle-btn.open {
    right: 280px;
}

/* ============================================
   Editor Canvas Area
   ============================================ */
.editor-canvas {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 10px;
}

.editor-canvas.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.editor-canvas-pane {
    flex: 1;
    min-height: 0;
    position: relative;
    background: radial-gradient(ellipse at 50% 40%, #0e1520 0%, #06080d 60%, #02040a 100%);
    border: 1px solid var(--hy-border);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    overflow: hidden;
}

/* ============================================
   Editor Status Bar
   ============================================ */
.editor-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--hy-font-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--hy-ink-3);
    padding: 8px 16px;
    border-top: 1px solid var(--hy-border-soft);
    background: var(--hy-panel);
}

.editor-statusbar .text-muted {
    color: var(--hy-ink-3);
}

.editor-statusbar .text-warning {
    color: var(--hy-warn);
}

/* ============================================
   Empty State
   ============================================ */
.tactical-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background: var(--hy-panel);
    border: 1px dashed var(--hy-border-soft);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.tactical-empty-state__icon {
    width: 64px;
    height: 64px;
    color: var(--hy-ink-3);
    margin-bottom: 16px;
}

.tactical-empty-state__title {
    font-family: var(--hy-font-title);
    font-size: 16px;
    color: var(--hy-ink);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.tactical-empty-state__desc {
    font-size: 13px;
    color: var(--hy-ink-2);
    margin-bottom: 24px;
    max-width: 400px;
}

/* ============================================
   Loading State
   ============================================ */
.tactical-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
}

.tactical-loading__text {
    font-family: var(--hy-font-mono);
    font-size: 11px;
    color: var(--hy-ink-3);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ============================================
   Grid for Plans
   ============================================ */
.tactical-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .editor-content {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar.left-sidebar,
    .editor-sidebar.right-sidebar {
        display: none;
    }
    
    .tactical-plan-card {
        grid-template-columns: 140px 1fr;
    }
    
    .tactical-plan-card__actions {
        display: none;
    }
}

@media (max-width: 768px) {
    .tactical-page {
        padding: 16px;
    }
    
    .tactical-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .tactical-header__actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .tactical-plan-card {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    .tactical-plan-card__thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .tactical-plan-card__content {
        padding: 12px 16px;
    }
}
