:root {
    /* GitHub Dark Theme Colors */
    --gh-bg: #0d1117;
    --gh-border: #30363d;
    --gh-text: #c9d1d9;
    --gh-text-muted: #8b949e;
    --gh-success: #238636;
    --gh-warning: #d29922;
    --gh-danger: #da3633;
    
    /* Liquid Glass iOS Colors */
    --glass-bg: rgba(22, 27, 34, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --bar-glow: 0 0 10px rgba(35, 134, 54, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body {
    background-color: var(--gh-bg);
    /* Subtle gradient to give depth to the liquid glass */
    background-image: radial-gradient(circle at 15% 50%, rgba(22, 27, 34, 1), transparent 50%),
                      radial-gradient(circle at 85% 30%, rgba(35, 134, 54, 0.05), transparent 50%);
    color: var(--gh-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    /* Strict dimensions for iPhone 14 Pro Max */
    width: 100vw;
    height: 100vh;
    max-width: 430px;
    max-height: 932px;
    margin: 0 auto; /* Center on larger screens for preview */
    overflow: hidden;
    position: relative;
}

#login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: rgba(30, 30, 32, 0.95);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 280px;
}

.login-box h2 {
    color: #fff;
    margin: 0;
    font-size: 20px;
    text-align: center;
}

#password-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 12px;
    font-size: 16px;
    outline: none;
    -webkit-appearance: none;
}

#password-input:focus {
    border-color: #0a84ff;
}

#login-btn {
    background: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

#login-btn:active {
    opacity: 0.8;
}

#login-error {
    color: #ff453a;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.dashboard-container {
    width: 100%;
    height: 100dvh;
    padding: 32px 12px 24px 12px; /* Extra top padding for iPhone status bar breathing room */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gh-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* System Stats Section */
.system-stats {
    flex: 0 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
}

.stat-label {
    color: var(--gh-text);
}

.stat-value {
    color: var(--gh-text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.progress-bar {
    height: 100%;
    background-color: var(--gh-success);
    border-radius: 2px;
    transition: width 0.5s ease-in-out, background-color 0.5s ease;
    box-shadow: var(--bar-glow);
}

.progress-bar.warning {
    background-color: var(--gh-warning);
    box-shadow: 0 0 8px rgba(210, 153, 34, 0.5);
}

.progress-bar.danger {
    background-color: var(--gh-danger);
    box-shadow: 0 0 8px rgba(218, 54, 51, 0.5);
}

/* Containers Section */
.containers-section {
    flex: 1 1 auto;
    overflow: hidden; /* No scroll outside */
}

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

.pulse-indicator {
    width: 6px;
    height: 6px;
    background-color: var(--gh-success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--gh-success);
    animation: pulse 2s infinite;
}

.containers-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Stretch to full width */
    gap: 8px;
    overflow-y: auto; /* Enable vertical scrolling */
    padding-bottom: 20px;
}

.container-card {
    width: 100%; /* Full width */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 10px;
    position: relative;
}

.card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.menu-container {
    display: flex;
    align-items: center;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--gh-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: all 0.2s;
}

.menu-btn:active, .menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.actions-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.3s ease, margin-right 0.3s ease;
}

.actions-slider.show {
    max-width: 150px;
    opacity: 1;
    margin-right: 6px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    width: 90%;
    max-width: 360px;
    background: var(--gh-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--gh-text);
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.action-btn:active {
    opacity: 0.7;
}

.action-btn.stop { color: #ff453a; }
.action-btn.start { color: #32d74b; }
.action-btn.restart { color: #0a84ff; }

.container-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
}

.container-stats {
    display: flex;
    gap: 8px;
    font-size: 9px;
    color: var(--gh-text-muted);
    font-variant-numeric: tabular-nums;
}

.container-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-running .container-dot {
    background-color: var(--gh-success);
    box-shadow: 0 0 5px var(--gh-success);
}

.status-exited .container-dot {
    background-color: var(--gh-text-muted);
}

.status-error .container-dot {
    background-color: var(--gh-danger);
    box-shadow: 0 0 5px var(--gh-danger);
}

.container-name {
    color: var(--gh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

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

.container-card {
    animation: fadeIn 0.3s ease forwards;
}
