body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glass panel — main container */
.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Glass card — grid items */
.glass-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.glass-card:hover::before {
    transform: scaleX(1);
}

/* Background decoration circles */
.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    filter: blur(40px);
    z-index: 0;
}

/* Auth form within glass panel */
.auth-form {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.auth-form .input-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.auth-form input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255,255,255,0.6);
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255,255,255,0.9);
}

.btn-gradient {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

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

/* Toast / message */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.toast.success {
    background: rgba(39, 174, 96, 0.9);
    color: white;
}

.toast.info {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

/* Page transition */
.page-enter { animation: fadeIn 0.35s ease-out forwards; }
.page-exit { animation: fadeOut 0.2s ease-in forwards; }

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

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

/* Dashboard logout button */
.logout-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Freepractice: problem panel ── */
.problem-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.5));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

.problem-panel.collapsed {
    transform: translateX(-100%);
    width: 0 !important;
    min-width: 0 !important;
}

/* ── Editor container ── */
.editor-container {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    overflow: hidden;
}

/* ── Toolbar buttons ── */
.toolbar-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    border: 1px solid rgba(255,255,255,0.8);
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* ── Import bar ── */
.import-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ── Dropdown menu ── */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── Markdown content ── */
.markdown-content {
    line-height: 1.6;
    color: #1e293b;
}

.markdown-content h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; color: #1e293b; }
.markdown-content h2 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.75rem; color: #334155; }
.markdown-content h3 { font-size: 1rem; font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; color: #475569; }
.markdown-content p { margin-bottom: 0.75rem; }
.markdown-content code { background: rgba(99, 102, 241, 0.1); padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-family: 'Consolas', 'Monaco', monospace; }
.markdown-content pre { background: rgba(30, 41, 59, 0.05); padding: 1rem; border-radius: 0.5rem; margin: 1rem 0; overflow-x: auto; }
.markdown-content pre code { background: transparent; padding: 0; }
.markdown-content blockquote { border-left: 4px solid #6366f1; padding-left: 1rem; margin: 1rem 0; color: #64748b; }
.markdown-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.markdown-content table th, .markdown-content table td { border: 1px solid #e2e8f0; padding: 0.5rem 0.75rem; }
.markdown-content table th { background: rgba(99, 102, 241, 0.1); font-weight: 600; }

/* ── I/O Resizer ── */
.io-resizer {
    height: 8px;
    cursor: ns-resize;
    background: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.io-resizer:hover {
    background: rgba(99, 102, 241, 0.25);
}
.io-resizer-handle {
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
}
.io-panel {
    flex-shrink: 0;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.3);
}
