/* CSS Design System - Custom Modern Aesthetic */
:root {
    --bg-base: #0a0812;
    --bg-surface: rgba(18, 16, 28, 0.7);
    --bg-surface-solid: #12101c;
    --bg-card: rgba(28, 25, 45, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(147, 51, 234, 0.3);
    
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    
    --accent-purple: #a855f7;
    --accent-purple-glow: rgba(168, 85, 247, 0.4);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --sidebar-width: 260px;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface-solid);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.brand-icon {
    font-size: 28px;
    color: var(--accent-purple);
    text-shadow: 0 0 10px var(--accent-purple-glow);
}

.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 11px;
    color: var(--color-text-muted);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--color-text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-left: 3px solid var(--accent-purple);
    box-shadow: inset 0 0 8px rgba(168, 85, 247, 0.1);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.hackathon-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-amber);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    background-color: rgba(245, 158, 11, 0.08);
    border-radius: 6px;
}

/* Main Content Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    max-width: 1300px;
    width: calc(100% - var(--sidebar-width));
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* Metrics Dashboard */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.metric-info h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue-tint { background-color: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }
.bg-green-tint { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); }
.bg-red-tint { background-color: rgba(244, 63, 94, 0.1); color: var(--accent-rose); }
.bg-purple-tint { background-color: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }
.bg-cyan-tint { background-color: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }
.bg-orange-tint { background-color: rgba(245, 158, 11, 0.1); color: var(--accent-amber); }

/* Panels */
.panel-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 32px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.release-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title i {
    font-size: 18px;
    color: var(--accent-purple);
}

.panel-title h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Control & Console */
.control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.panel-body {
    padding: 24px;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-textarea {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}

.form-textarea {
    resize: vertical;
}

/* Status dropdown style inside table */
.status-select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--color-text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.status-select:focus {
    border-color: var(--accent-purple);
}

.status-select.status-open {
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
}

.status-select.status-progress {
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
}

.status-select.status-resolved {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.status-select option {
    background-color: var(--bg-surface-solid);
    color: var(--color-text-primary);
}

.console-panel {
    border-color: var(--border-glow);
}

.console-body {
    background-color: #050409;
    height: 280px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow-y: auto;
    color: #a7f3d0; /* Emerald green tint for console */
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.console-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    text-align: center;
}

.console-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
    color: var(--color-text-muted);
}

.console-log-line {
    margin-bottom: 6px;
    white-space: pre-wrap;
    animation: fade-in 0.1s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7e22ce 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Datastore Table */
.tickets-table-container {
    overflow-x: auto;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.tickets-table th, .tickets-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.tickets-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tickets-table tbody tr {
    transition: background-color 0.2s ease;
}

.tickets-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-empty {
    text-align: center;
    padding: 40px !important;
    color: var(--color-text-muted);
}

.table-empty i {
    font-size: 32px;
    margin-bottom: 12px;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-p1 { background-color: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.2); }
.badge-p2 { background-color: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-p3 { background-color: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-p4 { background-color: rgba(107, 114, 128, 0.15); color: var(--color-text-secondary); border: 1px solid rgba(107, 114, 128, 0.2); }

.badge-cluster {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background-color: rgba(168, 85, 247, 0.12);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.btn-detail {
    background: none;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-detail:hover {
    color: #22d3ee;
    text-decoration: underline;
}

/* Release Hub Layout */
.release-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-panel {
    padding: 24px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.release-notes-panel {
    display: flex;
    flex-direction: column;
}

.release-notes-content {
    background-color: rgba(255, 255, 255, 0.01);
    flex: 1;
    padding: 24px;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 400px;
    border-top: 1px solid var(--border-color);
}

.release-notes-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
}

.release-notes-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
}

.release-notes-content h1 { font-size: 20px; margin-bottom: 12px; font-weight: 700; color: #fff; }
.release-notes-content h2 { font-size: 16px; margin: 20px 0 10px 0; font-weight: 600; color: var(--accent-purple); }
.release-notes-content ul { padding-left: 20px; margin-bottom: 16px; }
.release-notes-content li { margin-bottom: 6px; }

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 4, 9, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 600px;
    max-width: 90%;
    z-index: 101;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: scale-up 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.detail-row {
    margin-bottom: 20px;
}

.detail-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 14px;
    color: var(--color-text-primary);
}

.text-italic {
    font-style: italic;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-code {
    background-color: #050409;
    font-family: var(--font-mono);
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #38bdf8;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* Animations & Helpers */
.hidden {
    display: none !important;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-up {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alert-warning-box {
    background-color: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    color: #fda4af;
}

/* Undo Toast Style */
.undo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(22, 27, 34, 0.96);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-color);
    border-radius: 8px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    z-index: 9999;
    min-width: 320px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.undo-toast.hidden {
    display: none !important;
}

.btn-undo {
    background: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-undo:hover {
    background: #9d4edd;
    transform: translateY(-1px);
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
