/* Design System & Custom properties */
:root {
    --bg-main: #0a090d;
    --bg-sidebar: #0f0e13;
    --card-bg: rgba(24, 23, 31, 0.65);
    --card-border: rgba(255, 255, 255, 0.05);
    --text-primary: #f3f3f5;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    /* TaiP.io Theme terracotta and tech accents */
    --accent-orange: #d17856;
    --accent-orange-glow: rgba(209, 120, 86, 0.25);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.25);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.25);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.25);
    
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 0.15s ease;
    
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layout Framework */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background: radial-gradient(circle at 80% 20%, rgba(209, 120, 86, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

/* Sidebar Styling */
#sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    z-index: 10;
}

.brand-section {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 30px;
}

.brand-section .logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--accent-orange);
    text-shadow: 0 0 20px var(--accent-orange-glow);
}

.brand-section .subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-quick);
}

.nav-item svg {
    opacity: 0.6;
    transition: var(--transition-quick);
}

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

.nav-item:hover svg {
    opacity: 1;
}

.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(209, 120, 86, 0.12);
    border-left: 3px solid var(--accent-orange);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--accent-orange);
    opacity: 1;
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(209, 120, 86, 0.3);
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

#top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

#page-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(to right, #ffffff, #dcdcdf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Stat Badges */
.header-right {
    display: flex;
    gap: 16px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--card-border);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    min-width: 140px;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bar */
.progress-bar-container {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 35px;
    backdrop-filter: blur(12px);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar-outer {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange), #f3a27a);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(209, 120, 86, 0.4);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex-grow: 1;
}

.tab-panel.active-panel {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

/* Roadmap Grid */
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

/* Day Cards */
.day-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: transparent;
    transition: var(--transition-smooth);
}

/* Card States */
.day-card.status-active {
    border-color: rgba(209, 120, 86, 0.3);
    box-shadow: 0 4px 20px rgba(209, 120, 86, 0.06);
}

.day-card.status-active::before {
    background-color: var(--accent-orange);
}

.day-card.status-completed {
    border-color: rgba(16, 185, 129, 0.2);
}

.day-card.status-completed::before {
    background-color: var(--accent-green);
}

.day-card.status-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.day-card.status-locked:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Card hover animation */
.day-card:not(.status-locked):hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.day-card.status-active:hover {
    box-shadow: 0 10px 25px rgba(209, 120, 86, 0.12);
}

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

.card-day-num {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.day-card.status-active .card-day-num {
    color: var(--accent-orange);
}

.day-card.status-completed .card-day-num {
    color: var(--accent-green);
}

.card-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background-color: rgba(209, 120, 86, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(209, 120, 86, 0.2);
}

.badge-completed {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: var(--transition-quick);
}

.day-card:hover .card-title {
    color: white;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.task-progress-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.countdown-timer-small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modals / Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end; /* Drawer style from right */
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 600px;
    height: 100%;
    background-color: #0d0c10;
    border-left: 1px solid var(--card-border);
    padding: 40px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    position: relative;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-content {
    transform: translateX(0);
}

.close-modal-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-quick);
}

.close-modal-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-top: 10px;
}

.day-number-badge {
    background-color: rgba(209, 120, 86, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(209, 120, 86, 0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}

#modal-day-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Modal Sections */
.modal-body > div {
    margin-bottom: 35px;
}

.modal-body h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: white;
}

.section-desc p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Checklist task list */
.task-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-quick);
}

.task-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    flex-shrink: 0;
    transition: var(--transition-quick);
}

.task-checkbox-checked {
    border-color: var(--accent-green);
    background-color: var(--accent-green);
    color: white;
}

.task-checkbox svg {
    width: 12px;
    height: 12px;
}

.task-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: var(--transition-quick);
}

.task-item-completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* SOP Section Styles */
.section-sop {
    border-top: 1px solid var(--card-border);
    padding-top: 24px;
}

.sop-content {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.sop-content p {
    margin-bottom: 12px;
}

.sop-content strong {
    color: white;
}

.sop-content ul, .sop-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.sop-content li {
    margin-bottom: 6px;
}

.sop-content a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-quick);
}

.sop-content a:hover {
    text-decoration: underline;
}

.sop-alert {
    background-color: rgba(209, 120, 86, 0.08);
    border-left: 4px solid var(--accent-orange);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    margin: 16px 0;
}

.sop-alert p {
    margin-bottom: 0;
}

.sop-alert strong {
    color: var(--accent-orange);
    display: block;
    margin-bottom: 4px;
}

/* Homework Form */
#homework-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 0.95rem;
    transition: var(--transition-quick);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-orange);
    outline: none;
    box-shadow: 0 0 10px rgba(209, 120, 86, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition-quick);
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: white;
    box-shadow: 0 4px 15px var(--accent-orange-glow);
}

.btn-primary:hover {
    background-color: #df8865;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-orange-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-success {
    background-color: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.w-full {
    width: 100%;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Locked Overlay Content */
.section-locked {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lock-icon-large {
    font-size: 4rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    animation: pulseLock 2s infinite ease-in-out;
}

@keyframes pulseLock {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.countdown-timer-large {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent-orange);
    letter-spacing: 1px;
    background: rgba(209, 120, 86, 0.08);
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(209, 120, 86, 0.2);
    text-shadow: 0 0 20px var(--accent-orange-glow);
}

/* Agent Builder View Styles */
.playground-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    height: calc(100vh - 240px);
}

.config-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding: 24px;
}

.config-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.config-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 5px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green-glow);
}

.chat-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.chat-agent-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: rgba(0, 0, 0, 0.15);
}

.message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
    animation: messagePop 0.25s cubic-bezier(0.1, 0.8, 0.3, 1);
}

@keyframes messagePop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-message {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--card-border);
    align-self: flex-start;
}

.user-message {
    background-color: var(--accent-orange);
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
    box-shadow: 0 4px 12px var(--accent-orange-glow);
}

.chat-input-area {
    padding: 18px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 0.95rem;
}

.chat-input-area input:focus {
    border-color: var(--accent-orange);
    outline: none;
}

#btn-send-message {
    background-color: var(--accent-orange);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-quick);
}

#btn-send-message:hover {
    background-color: #df8865;
    transform: scale(1.03);
}

/* Profile Tab Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.stats-overview {
    padding: 24px;
}

.stats-overview h2, .submissions-log h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    text-align: center;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-orange);
    margin-bottom: 6px;
}

.stat-lbl {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.submissions-log {
    padding: 24px;
}

.log-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-log-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    padding: 30px 0;
}

.log-item {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
}

.log-day {
    font-weight: 700;
    color: var(--accent-green);
    font-size: 0.9rem;
}

.log-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.log-content-pair {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.log-field-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Floating Dev Tool & Dev Panel Styles */
#dev-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(209, 120, 86, 0.25);
    border: 2px solid var(--accent-orange);
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(209, 120, 86, 0.5);
    z-index: 9999;
    transition: var(--transition-quick);
}

#dev-trigger:hover {
    color: white;
    border-color: var(--accent-orange);
    transform: rotate(45deg);
}

.dev-panel-container {
    position: fixed;
    top: 100px;
    right: 40px;
    width: 340px;
    background-color: #0c0b0f;
    border: 1px solid rgba(239, 68, 68, 0.3); /* Slightly reddish for warning */
    border-radius: var(--border-radius-lg);
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    padding: 20px;
    display: none; /* Controlled by toggle */
    animation: panelSlideUp 0.3s cubic-bezier(0.1, 0.8, 0.3, 1);
}

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

.dev-panel-container.active {
    display: block;
}

.dev-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 8px;
}

.dev-panel-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ef4444; /* red */
}

.dev-panel-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
}

.dev-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
}

.dev-button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.dev-button-group .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    justify-content: flex-start;
}

.dev-status {
    font-size: 0.75rem;
    border-top: 1px solid var(--card-border);
    padding-top: 10px;
    color: var(--text-secondary);
}

#dev-time-offset-log {
    margin-top: 4px;
    font-family: monospace;
    color: #f59e0b; /* amber */
}

/* Glass card styling helper */
.glass-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Responsive Rules */
@media (max-width: 1024px) {
    #sidebar {
        width: 80px;
        padding: 16px 8px;
        align-items: center;
    }
    .brand-section {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
        width: 48px;
        height: 48px;
    }
    .nav-item span, .nav-item svg + text {
        display: none; /* Just show icons */
    }
    .nav-item {
        font-size: 0;
    }
    .sidebar-footer .user-info {
        display: none;
    }
    .playground-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .config-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 10px 20px;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        justify-content: space-between;
    }
    .nav-menu {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    .sidebar-footer {
        display: none;
    }
    #main-content {
        padding: 20px;
        height: calc(100vh - 60px);
    }
    #top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .modal-content {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Authentication & Syncing Styles --- */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top right, rgba(29, 38, 113, 0.92), rgba(8, 10, 20, 0.98));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.auth-overlay.active {
    display: flex;
}

.auth-box {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    background: rgba(18, 22, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(209, 120, 86, 0.05);
    text-align: center;
}

.auth-brand {
    margin-bottom: 30px;
}

.auth-brand .logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    color: white;
}

.auth-brand .logo-accent {
    background: linear-gradient(135deg, var(--accent-orange), #ff9f43);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand .subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-top: 4px;
}

#auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

#auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.4;
}

.auth-error-msg {
    color: #ff4a4a;
    background: rgba(255, 74, 74, 0.08);
    border-left: 3px solid #ff4a4a;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    border-radius: 4px;
    display: none;
    text-align: left;
    line-height: 1.4;
}

.auth-toggle {
    margin-top: 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: var(--transition-quick);
}

.auth-toggle a:hover {
    color: #ff9f43;
    text-decoration: underline;
}

.confirm-password-group {
    transition: all 0.3s ease;
}

/* User Badge Logout styling */
.user-badge {
    position: relative;
    width: 100%;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ff4d4d;
}

/* Sync Status Floating Indicator */
.sync-status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid transparent;
    transform: translateY(0);
    opacity: 1;
}

.sync-status-indicator.synced {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.sync-status-indicator.saving {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    animation: sync-pulse 1.5s infinite;
}

.sync-status-indicator.sync-failed {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.sync-status-indicator.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

@keyframes sync-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.animate-fade-in {
    animation: auth-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
