/**
 * GEOINT Dashboard v4.1 - Feature Styles
 * Timeline Viewer, Country Profiles, Nuclear Monitor, Notifications, Login
 */

/* ===== TIMELINE VIEWER ===== */
.timeline-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.timeline-controls select {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    color: var(--text-primary, #e2e8f0);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

.timeline-controls select:focus {
    border-color: var(--accent, #00d4ff);
}

/* Heatmap */
.heatmap-grid {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.heatmap-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
}

.heatmap-label {
    font-size: 9px;
    color: var(--text-muted, #64748b);
    height: 12px;
    line-height: 12px;
}

.heatmap-cells {
    display: grid;
    grid-template-rows: repeat(7, 12px);
    grid-auto-flow: column;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.heatmap-cell:hover {
    transform: scale(1.4);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
    z-index: 2;
}

/* Milestones */
.milestones-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 16px;
}

.milestones-track::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border, #334155);
}

.milestone-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.milestone-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.milestone-content {
    flex: 1;
    min-width: 0;
}

.milestone-date {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    margin-bottom: 2px;
}

.milestone-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.3;
}

.milestone-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    align-items: center;
    flex-wrap: wrap;
}

/* Timeline Feed */
.timeline-date-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent, #00d4ff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--border, #334155);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date-count {
    background: var(--accent, #00d4ff);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.timeline-item {
    display: flex;
    gap: 0;
    padding: 4px 0;
}

.timeline-line {
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.timeline-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--tl-color, var(--border, #334155));
    opacity: 0.3;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-top: 12px;
}

.timeline-dot-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-card {
    flex: 1;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 4px 0 4px 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-card:hover {
    border-color: var(--accent, #00d4ff);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.08);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
}

.timeline-card-header strong {
    color: var(--text-primary, #e2e8f0);
}

.timeline-time {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.timeline-card-desc {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
    margin-top: 6px;
}

.timeline-card-meta {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Compact view */
.timeline-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 11px;
}

.timeline-title-compact {
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}


/* ===== COUNTRY PROFILES ===== */
.country-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.country-search-row input {
    flex: 1;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    color: var(--text-primary, #e2e8f0);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
}

.country-search-row input:focus {
    border-color: var(--accent, #00d4ff);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.country-search-row select {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    color: var(--text-primary, #e2e8f0);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    outline: none;
}

.country-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.country-stat-card {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.country-stat-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent, #00d4ff);
}

.country-stat-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.countries-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    min-height: 500px;
}

/* Country List */
.country-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.country-list-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: var(--border, #334155);
}

.country-list-item.selected {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent, #00d4ff);
}

.country-flag {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.country-info {
    flex: 1;
    min-width: 0;
}

.country-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-meta {
    display: flex;
    gap: 8px;
}

.country-risk {
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
}

/* Country Profile */
.country-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, #334155);
    margin-bottom: 16px;
}

.cp-flag {
    font-size: 42px;
    line-height: 1;
}

.cp-title {
    flex: 1;
}

.cp-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary, #e2e8f0);
}

.cp-risk {
    border: 2px solid;
    border-radius: 8px;
    padding: 8px 16px;
    text-align: center;
    flex-shrink: 0;
}

.cp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.cp-stat {
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.cp-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary, #e2e8f0);
}

.cp-stat-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.cp-indicators {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.cp-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-ind-label {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    width: 100px;
    flex-shrink: 0;
}

.cp-ind-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.cp-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cp-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    font-size: 12px;
}

.cp-detail-label {
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.cp-detail-row span:last-child {
    color: var(--text-primary, #e2e8f0);
    text-align: right;
}

.cp-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent, #00d4ff);
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border, #334155);
}

.cp-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.mini-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary, #94a3b8);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.cp-report-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    transition: background 0.15s;
}

.cp-report-item:hover {
    background: rgba(0, 212, 255, 0.05);
    color: var(--text-primary, #e2e8f0);
}

.cp-relation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
}


/* ===== NUCLEAR MONITOR ===== */
.nuclear-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.nuclear-stat-card {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.nuclear-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.nuclear-stat-val {
    font-size: 22px;
    font-weight: 800;
    color: #f59e0b;
}

.nuclear-stat-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

/* Arsenal Grid */
.arsenal-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arsenal-item {
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    padding: 10px 12px;
    transition: border-color 0.2s;
}

.arsenal-item:hover {
    border-color: #f59e0b;
}

.arsenal-country {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 6px;
}

.arsenal-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arsenal-count {
    font-size: 13px;
    font-weight: 800;
    color: #ef4444;
    min-width: 50px;
    text-align: right;
}

.arsenal-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* Nuclear Events */
.nuclear-event-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: background 0.15s;
}

.nuclear-event-item:hover {
    background: rgba(245, 158, 11, 0.03);
}

.nuclear-event-item:last-child {
    border-bottom: none;
}

.ne-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    padding-top: 2px;
}

.ne-content {
    flex: 1;
    min-width: 0;
}

.ne-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
}

.ne-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.ne-date {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}

/* Nuclear by Country */
.nbc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
}

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

.nbc-country {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.nbc-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
}

/* Treaties */
.treaty-item {
    padding: 10px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: background 0.15s;
}

.treaty-item:hover {
    background: rgba(0, 212, 255, 0.03);
}

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

.treaty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.treaty-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent, #00d4ff);
}

.treaty-fullname {
    font-size: 11px;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
}

.treaty-desc {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

.treaty-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

/* Nuclear Map */
#nuclearMapPanel {
    border-radius: 8px;
    overflow: hidden;
}

#nuclearMap {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    background: #0a0e1a;
}

.nuclear-event-marker {
    background: transparent;
    border: none;
}


/* ===== NOTIFICATION CENTER ===== */
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover {
    background: rgba(0, 212, 255, 0.03);
}

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

.notif-item.unread {
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid var(--accent, #00d4ff);
}

.notif-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
    padding-top: 2px;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 2px;
}

.notif-msg {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.3;
}

.notif-time {
    font-size: 9px;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}


/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, #0a192f 0%, #020817 100%);
    font-family: 'Inter', sans-serif;
}

.login-container {
    width: 420px;
    max-width: 90vw;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: #000;
    margin-bottom: 12px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 3px;
    margin: 0;
}

.login-logo .subtitle {
    font-size: 10px;
    letter-spacing: 3px;
    color: #64748b;
    margin-top: 4px;
}

.login-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 24px 0;
    text-align: center;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-field input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.login-field input::placeholder {
    color: #475569;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ef4444;
    font-size: 12px;
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #64748b;
}

.login-footer a {
    color: #00d4ff;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-info {
    text-align: center;
    margin-top: 24px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.login-info strong {
    color: #e2e8f0;
}


/* ===== THREAT BAR (shared) ===== */
.threat-bar {
    height: 6px;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 3px;
    overflow: hidden;
    flex: 1;
}

.threat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.threat-bar-fill.critical { background: linear-gradient(90deg, #ef4444, #dc2626); }
.threat-bar-fill.high { background: linear-gradient(90deg, #f97316, #ea580c); }
.threat-bar-fill.medium { background: linear-gradient(90deg, #f59e0b, #d97706); }
.threat-bar-fill.low { background: linear-gradient(90deg, #10b981, #059669); }


/* ===== PDF EXPORT BUTTON ===== */
.btn-pdf-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-pdf-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}


/* ===== RESPONSIVE for v4.1 ===== */
@media (max-width: 900px) {
    .countries-layout {
        grid-template-columns: 1fr;
    }
    .cp-stats-grid,
    .nuclear-stats-row,
    .country-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .country-profile-header {
        flex-wrap: wrap;
    }
    .cp-flag { font-size: 30px; }
}

@media (max-width: 640px) {
    .cp-stats-grid,
    .nuclear-stats-row,
    .country-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .login-card {
        padding: 24px 20px;
    }
    .timeline-card-header {
        flex-direction: column;
    }
    .country-search-row {
        flex-direction: column;
    }
    #nuclearMap {
        height: 280px;
    }
}
