/* Custom Bootstrap 5 Overrides and Theme */
:root {
    --bg-dark: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #58a6ff;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

/* Navbar */
.navbar {
    background: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    color: var(--accent);
    font-size: 1.6rem;
}

.navbar-brand span {
    color: var(--accent);
    font-weight: 400;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent) !important;
    background: rgba(88, 166, 255, 0.1);
}

.nav-link i {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Navbar Dropdown */
.dropdown-menu {
    background: #161b22;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 10px !important;
    padding: 8px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.dropdown-divider {
    border-top: 1px solid var(--glass-border);
    margin: 8px 0;
}

/* Form Controls */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(13, 17, 23, 1);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

/* Buttons */
.btn-primary {
    background-color: #238636;
    border-color: #238636;
}

.btn-primary:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

.btn-secondary {
    background-color: #21262d;
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #30363d;
    border-color: #8b949e;
}

/* Text Colors */
.text-muted {
    color: var(--text-secondary) !important;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding: 2rem 0;
    color: var(--text-secondary);
}

/* Custom Badges */
.badge-time {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
}

.badge-count {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

/* --- Resizer Styles --- */
.resizer-h {
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    cursor: col-resize;
    transition: background 0.2s;
    z-index: 100;
    position: relative;
    border-left: 1px solid var(--glass-border);
    flex-shrink: 0;
}

/* Khi layout chuyển sang cột (Mobile/Stacked) */
@media (max-width: 991.98px) {
    .playground-container .resizer-h,
    .workspace .resizer-h {
        width: 100%;
        height: 4px;
        cursor: row-resize;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }
    .playground-container .resizer-h::after,
    .workspace .resizer-h::after {
        top: -6px; bottom: -6px; left: 0; right: 0;
        cursor: row-resize;
    }
}

.resizer-h:hover, .resizer-h.active {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.resizer-v {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    cursor: row-resize;
    transition: background 0.2s;
    z-index: 100;
    position: relative;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.resizer-v:hover, .resizer-v.active {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

/* Overlay & Resizing states */
#resize-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.resizing, .resizing * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

.resizer-h::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: -6px; right: -6px;
    cursor: col-resize;
    z-index: 10;
}

.resizer-v::after {
    content: "";
    position: absolute;
    top: -6px; bottom: -6px; left: 0; right: 0;
    cursor: row-resize;
    z-index: 10;
}
