/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 106, 0, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.5);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 106, 0, 0.3) rgba(0, 0, 0, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(25, 135, 84, 0); }
}

@keyframes orangeGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0d0d0d 0%, #0a0a0a 40%, #050505 100%);
    border-right: 1px solid rgba(255, 106, 0, 0.15);
    flex-shrink: 0;
    position: relative;
    transition: width 0.3s ease;
    z-index: 10;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 106, 0, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

/* Sidebar logo area */
.sidebar > a:first-child {
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    background: rgba(255, 106, 0, 0.08);
    border: 1px solid rgba(255, 106, 0, 0.2);
    transition: all 0.3s;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.sidebar > a:first-child:hover {
    background: rgba(255, 106, 0, 0.14);
    border-color: rgba(255, 106, 0, 0.35);
}

.sidebar > a:first-child i {
    color: #ff6a00;
    filter: drop-shadow(0 0 8px rgba(255, 106, 0, 0.6));
}

.sidebar > a:first-child span {
    color: #ff8c00;
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.3);
}

/* Sidebar server name */
.sidebar-server-name {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 106, 0, 0.35);
    padding-left: 0.75rem;
    position: relative;
    border-left: 2px solid rgba(255, 106, 0, 0.25);
    margin-left: 0.75rem;
    line-height: 1.4;
}

/* Sidebar nav links */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.55);
    border-radius: 4px;
    margin-bottom: 2px;
    padding: 0.55rem 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    border-left: 2px solid transparent;
}

.sidebar .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 106, 0, 0.06);
    border-left-color: rgba(255, 106, 0, 0.4);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 106, 0, 0.2) 0%, rgba(255, 106, 0, 0.05) 100%);
    border-left-color: #ff6a00;
    box-shadow: -2px 0 12px rgba(255, 106, 0, 0.2);
}

.sidebar .nav-link.active i {
    color: #ff6a00;
    filter: drop-shadow(0 0 4px rgba(255, 106, 0, 0.5));
}

/* Sidebar bottom user area */
.sidebar hr {
    border-color: rgba(255, 106, 0, 0.12);
}

/* Main content */
.main-content {
    background-color: #060609;
    background-image:
        /* Grid */
        linear-gradient(rgba(255, 106, 0, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.025) 1px, transparent 1px),
        /* Large grid accent */
        linear-gradient(rgba(255, 106, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.04) 1px, transparent 1px),
        /* Radial glow top-right */
        radial-gradient(ellipse at 85% 5%, rgba(255, 106, 0, 0.06) 0%, transparent 50%),
        /* Radial glow bottom-left */
        radial-gradient(ellipse at 10% 90%, rgba(255, 60, 0, 0.03) 0%, transparent 40%),
        /* Vignette */
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px, 100% 100%, 100% 100%, 100% 100%;
    overflow-y: auto;
    animation: fadeInUp 0.35s ease-out;
    position: relative;
}

/* Scanline overlay */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* "HARBOR OF HOPE" watermark */
.main-content::after {
    content: 'HARBOR OF HOPE';
    position: fixed;
    bottom: 20px;
    right: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: rgba(255, 106, 0, 0.15);
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 20px rgba(255, 106, 0, 0.08);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-badge.running {
    background: rgba(25, 135, 84, 0.15);
    color: #75b798;
    border: 1px solid rgba(25, 135, 84, 0.3);
    animation: subtlePulse 2.5s ease-in-out infinite;
}

.status-badge.running .bi-circle-fill {
    color: #198754;
}

.status-badge.stopped {
    background: rgba(220, 53, 69, 0.15);
    color: #ea868f;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Cards */
.info-card {
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 106, 0, 0.1);
    border-radius: 4px;
    padding: 1.25rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6a00, #ff8c00, transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.info-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid rgba(255, 106, 0, 0.2);
    border-right: 2px solid rgba(255, 106, 0, 0.2);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.info-card:hover {
    border-color: rgba(255, 106, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 106, 0, 0.06);
}

.info-card:hover::before {
    opacity: 1;
}

.info-card:hover::after {
    opacity: 1;
}

.info-card .card-icon {
    font-size: 1.5rem;
    opacity: 0.6;
    color: #ff6a00 !important;
    filter: drop-shadow(0 0 4px rgba(255, 106, 0, 0.3));
}

.info-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.info-card .card-label {
    font-size: 0.72rem;
    color: rgba(255, 106, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Dashboard card accent colors */
.row > .col-md-3:nth-child(1) .info-card::before { background: linear-gradient(90deg, #198754, #20c997, transparent); }
.row > .col-md-3:nth-child(2) .info-card::before { background: linear-gradient(90deg, #ff6a00, #ff8c00, transparent); }
.row > .col-md-3:nth-child(3) .info-card::before { background: linear-gradient(90deg, #ff8c00, #ffb347, transparent); }
.row > .col-md-3:nth-child(4) .info-card::before { background: linear-gradient(90deg, #ff4500, #ff6a00, transparent); }

/* Deploy action card accents */
.row > .col-md-4:nth-child(1) .info-card::before { background: linear-gradient(90deg, #ff6a00, #ff8c00, transparent); }
.row > .col-md-4:nth-child(2) .info-card::before { background: linear-gradient(90deg, #ff8c00, #ffb347, transparent); }
.row > .col-md-4:nth-child(3) .info-card::before { background: linear-gradient(90deg, #ff4500, #ff6a00, transparent); }

/* Log viewer */
.log-container {
    background: #050508;
    border: 1px solid rgba(255, 106, 0, 0.1);
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
    position: relative;
}

.log-container .log-line {
    padding: 2px 4px;
    border-radius: 2px;
    margin: 0 -4px;
    border-left: 2px solid transparent;
}

.log-container .log-line:hover {
    background: rgba(255, 106, 0, 0.04);
    border-left-color: rgba(255, 106, 0, 0.3);
}

.log-line .log-warn { color: #ffb347; text-shadow: 0 0 6px rgba(255, 179, 71, 0.2); }
.log-line .log-error { color: #ff4444; text-shadow: 0 0 6px rgba(255, 68, 68, 0.2); }
.log-line .log-info { color: #ff8c00; }

/* Env editor */
.env-group {
    background: rgba(15, 15, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 106, 0, 0.08);
    border-radius: 4px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.25s ease;
}

.env-group:hover {
    border-color: rgba(255, 106, 0, 0.18);
}

.env-group h6 {
    color: rgba(255, 106, 0, 0.6);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.env-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.env-row:last-child {
    border-bottom: none;
}

.env-key {
    width: 240px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #ff8c00;
    flex-shrink: 0;
}

.env-value {
    flex: 1;
}

.env-value input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 106, 0, 0.12);
    color: #ddd;
    border-radius: 3px;
    padding: 0.3rem 0.6rem;
    font-family: monospace;
    font-size: 0.85rem;
    width: 100%;
}

.env-value input:focus {
    border-color: #ff6a00;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2), 0 0 12px rgba(255, 106, 0, 0.08);
}

/* Deploy output */
.deploy-output {
    background: #050508;
    border: 1px solid rgba(255, 106, 0, 0.1);
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
    color: #ff8c00;
}

/* Bot overview tables */
.bot-table {
    background: rgba(15, 15, 20, 0.7);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 106, 0, 0.08);
}

.bot-table table {
    margin-bottom: 0;
}

.bot-table th {
    background: rgba(255, 106, 0, 0.06);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 106, 0, 0.5);
    border-bottom: 1px solid rgba(255, 106, 0, 0.12);
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.bot-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    padding: 0.65rem 1rem;
    transition: all 0.15s ease;
}

.bot-table tbody tr {
    transition: all 0.15s ease;
}

.bot-table tbody tr:hover {
    background: rgba(255, 106, 0, 0.04);
}

.bot-table tbody tr:hover td {
    border-bottom-color: rgba(255, 106, 0, 0.08);
}

.bot-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.bot-table tbody tr:nth-child(even):hover {
    background: rgba(255, 106, 0, 0.04);
}

/* Profile */
.profile-card {
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 106, 0, 0.1);
    border-radius: 4px;
    padding: 1.5rem;
    transition: all 0.25s ease;
}

.profile-card:hover {
    border-color: rgba(255, 106, 0, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.profile-avatar {
    font-size: 2.5rem;
    color: #ff6a00;
    filter: drop-shadow(0 0 6px rgba(255, 106, 0, 0.3));
}

.pw-badge {
    font-size: 0.82rem;
    padding: 4px 12px;
}

/* Modal dark overrides */
.modal-content.bg-dark {
    background: rgba(10, 10, 15, 0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 106, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 106, 0, 0.05);
}

.modal-content.bg-dark .form-control,
.modal-content.bg-dark .form-select {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 106, 0, 0.12);
    color: #ddd;
}

.modal-content.bg-dark .form-control:focus,
.modal-content.bg-dark .form-select:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}

.modal-header.border-secondary {
    border-bottom-color: rgba(255, 106, 0, 0.1) !important;
}

.modal-footer.border-secondary {
    border-top-color: rgba(255, 106, 0, 0.1) !important;
}

/* Button overrides - orange primary */
.btn-primary {
    background: linear-gradient(135deg, #ff6a00, #ff8c00);
    border-color: #ff6a00;
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff7b1a, #ff9a1a);
    border-color: #ff7b1a;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 106, 0, 0.35);
}

.btn-outline-primary {
    border-color: #ff6a00;
    color: #ff6a00;
}

.btn-outline-primary:hover {
    background: #ff6a00;
    border-color: #ff6a00;
    color: #000;
}

/* Button hover enhancements */
.btn {
    transition: all 0.2s ease;
    border-radius: 3px;
}

.btn-success:hover, .btn-warning:hover, .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-outline-light:hover, .btn-outline-secondary:hover,
.btn-outline-info:hover, .btn-outline-warning:hover,
.btn-outline-danger:hover {
    transform: translateY(-1px);
}

/* Form control focus */
.form-control, .form-select {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}

/* Heading polish */
h4, .fs-5 {
    letter-spacing: 0.02em;
    color: #fff;
}

h4 i {
    color: #ff6a00;
    filter: drop-shadow(0 0 4px rgba(255, 106, 0, 0.3));
}

/* Badge overrides */
.badge.bg-primary {
    background: linear-gradient(135deg, #ff6a00, #ff8c00) !important;
    color: #000;
    font-weight: 600;
}

/* Links */
a.text-primary, .text-primary {
    color: #ff8c00 !important;
}

/* Alert styling */
.alert {
    border-radius: 4px;
    border-left: 3px solid;
}

/* ============================================================
   HUD Dashboard Elements
   ============================================================ */

/* HUD Card - corner brackets */
.hud-card {
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(255, 106, 0, 0.1);
    border-radius: 0;
    padding: 1.25rem;
    position: relative;
    transition: all 0.25s ease;
    overflow: visible;
}

.hud-card::before,
.hud-card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.hud-card::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid #ff6a00;
    border-left: 2px solid #ff6a00;
}

.hud-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid #ff6a00;
    border-right: 2px solid #ff6a00;
}

.hud-card:hover {
    border-color: rgba(255, 106, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.06);
}

.hud-card:hover::before,
.hud-card:hover::after {
    width: 24px;
    height: 24px;
}

/* Additional corners via inner wrapper */
.hud-corners::before,
.hud-corners::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.hud-corners::before {
    top: -1px;
    right: -1px;
    border-top: 2px solid rgba(255, 106, 0, 0.4);
    border-right: 2px solid rgba(255, 106, 0, 0.4);
}

.hud-corners::after {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid rgba(255, 106, 0, 0.4);
    border-left: 2px solid rgba(255, 106, 0, 0.4);
}

/* HUD Label */
.hud-label {
    font-size: 0.68rem;
    color: rgba(255, 106, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.hud-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 106, 0, 0.3), transparent);
}

/* HUD Value */
.hud-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    line-height: 1;
}

.hud-value.glow {
    text-shadow: 0 0 15px rgba(255, 106, 0, 0.3);
}

/* Latency colors */
.latency-good { color: #20c997; text-shadow: 0 0 10px rgba(32, 201, 151, 0.3); }
.latency-warn { color: #ff8c00; text-shadow: 0 0 10px rgba(255, 140, 0, 0.3); }
.latency-bad { color: #ff4444; text-shadow: 0 0 10px rgba(255, 68, 68, 0.3); }

/* Latency graph container */
.latency-graph {
    position: relative;
    height: 80px;
    background:
        linear-gradient(rgba(255, 106, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid rgba(255, 106, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.latency-graph canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.graph-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 106, 0, 0.4);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* Live indicator */
@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ff6a00;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #ff6a00;
    border-radius: 50%;
    animation: liveBlink 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 106, 0, 0.5);
}

/* Refresh timer */
.refresh-timer {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}

/* Detail row for service info */
.detail-row {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-key {
    color: rgba(255, 255, 255, 0.4);
    width: 130px;
    flex-shrink: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-val {
    color: #ddd;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}

/* HUD divider */
.hud-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 106, 0, 0.3), rgba(255, 106, 0, 0.05), transparent);
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 0.5rem !important;
    }
    .sidebar .nav-link span,
    .sidebar a span,
    .sidebar > a > span,
    .sidebar hr ~ div span,
    .sidebar-server-name {
        display: none;
    }
    .sidebar .nav-link i {
        margin: 0 !important;
        font-size: 1.2rem;
    }
    .sidebar > a:first-child {
        padding: 0.5rem;
        justify-content: center;
        clip-path: none;
    }
    .env-key {
        width: 140px;
    }
    .main-content::before {
        left: 60px;
    }
}
