/**
 * FocoTime Styles
 * Main stylesheet for the Focus Time application
 * Updated: Clean Modern Dark Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Core Colors - Refined Modern Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #121218;
    --bg-tertiary: #1a1a24;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #5a5a6a;
    
    /* Accent Colors - Softer, More Professional */
    --accent-primary: #6366f1;     /* Indigo */
    --accent-secondary: #22d3ee;   /* Cyan */
    --accent-success: #10b981;     /* Emerald */
    --accent-warning: #f59e0b;     /* Amber */
    --accent-danger: #ef4444;      /* Red */
    --accent-purple: #a855f7;      /* Purple */
    
    /* Legacy support */
    --bg-color: var(--bg-primary);
    --text-color: var(--text-secondary);
    --neon-green: var(--accent-success);
    --neon-blue: var(--accent-secondary);
    --neon-pink: #ec4899;
    --neon-yellow: var(--accent-warning);
    
    --glass-bg: rgba(18, 18, 24, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background-color: var(--bg-primary); 
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================
   NAVIGATION ACTIVE STATES
   ========================= */
.nav-item { 
    transition: all 0.2s ease; 
}

.nav-active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent-primary) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* =========================
   GLASSMORPHISM COMPONENTS
   ========================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* =========================
   NEON EFFECTS - Updated
   ========================= */
.neon-text {
    color: var(--accent-primary);
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.neon-border:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.btn-neon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* =========================
   CUSTOM SCROLLBAR
   ========================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* =========================
   TIMER COMPONENTS
   ========================= */
.tab-active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: bold;
}

/* =========================
   CHECKBOX STYLING
   ========================= */
.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-content: center;
}

.custom-checkbox::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--neon-green);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0,255,127,0.2);
}

.custom-checkbox:checked::before {
    transform: scale(1);
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.slide-in { animation: slideIn 0.3s ease-out forwards; }

.loading-spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--neon-green);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

@keyframes neuralPulse {
    0% { opacity: 0; transform: scale(0.95); }
    50% { opacity: 0.5; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}
.neural-pulse { animation: neuralPulse 0.5s ease-out forwards; }

/* =========================
   CANVAS / ROADMAP STYLES
   ========================= */
.canvas-grid {
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.grid-visible {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Free Draw Mode Indicator */
.draw-mode-active {
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.5) !important;
    border-color: var(--neon-pink) !important;
}

/* Pan Mode (Hand Tool) Indicator */
.pan-mode-active {
    cursor: grab !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4) !important;
    border-color: var(--neon-blue) !important;
}

.pan-mode-active canvas {
    cursor: grab !important;
}

.pan-mode-active:active canvas {
    cursor: grabbing !important;
}

/* Brush Size Slider */
.brush-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
}

.brush-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,255,127,0.5);
}

.brush-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0,255,127,0.5);
}

/* Pinned Object Indicator */
.pinned-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #ff007f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255,0,127,0.5);
}

/* Tool Button Active State */
.tool-active {
    background: rgba(255, 0, 127, 0.2) !important;
    color: var(--neon-pink) !important;
}

/* =========================
   EXPANDABLE NODE OVERLAY
   ========================= */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out forwards;
}

/* Custom scrollbar for overlay content */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Expansion indicator glow pulse */
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.expansion-indicator {
    animation: glowPulse 2s ease-in-out infinite;
}

/* =========================
   MISSING ANIMATIONS
   ========================= */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes float-slower {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

@keyframes tilt {
    0%, 50%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.animate-float-slower {
    animation: float-slower 8s ease-in-out infinite;
}

.animate-tilt {
    animation: tilt 10s linear infinite;
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}
/* =========================
   MOBILE RESPONSIVE DESIGN
   ========================= */

/* Mobile Navigation - Bottom Bar */
@media (max-width: 768px) {
    /* Hide desktop sidebar on mobile */
    .sidebar-desktop {
        display: none !important;
    }
    
    /* Show mobile bottom nav */
    .mobile-nav {
        display: flex !important;
    }
    
    /* Remove margin-left from main content */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-bottom: 80px !important;
    }
    
    /* Sidebar default hidden on mobile */
    aside:not(.mobile-nav) {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    aside.sidebar-open {
        transform: translateX(0);
    }
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(5, 5, 7, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav a,
.mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 10px;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav a:hover,
.mobile-nav button:hover,
.mobile-nav a.active {
    color: var(--neon-green);
}

.mobile-nav a.active {
    color: var(--neon-green);
}

.mobile-nav svg {
    width: 24px;
    height: 24px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.25rem !important; }
    .text-4xl { font-size: 1.75rem !important; }
    .text-3xl { font-size: 1.5rem !important; }
    .text-2xl { font-size: 1.25rem !important; }
}

/* Responsive Padding */
@media (max-width: 768px) {
    .p-10 { padding: 1rem !important; }
    .p-12 { padding: 1rem !important; }
    .p-8 { padding: 1rem !important; }
    .px-8 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .py-6 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .pt-12 { padding-top: 1rem !important; }
    .pr-12 { padding-right: 1rem !important; }
    .pb-12 { padding-bottom: 1rem !important; }
    .pl-12 { padding-left: 1rem !important; }
    .gap-8 { gap: 1rem !important; }
    .gap-10 { gap: 1rem !important; }
    .mb-12 { margin-bottom: 1.5rem !important; }
}

/* Responsive Grid */
@media (max-width: 768px) {
    .grid-cols-2 { grid-template-columns: 1fr !important; }
    .grid-cols-3 { grid-template-columns: 1fr !important; }
    .lg\:grid-cols-2 { grid-template-columns: 1fr !important; }
}

/* Responsive Timer Display */
@media (max-width: 640px) {
    #timer-display {
        font-size: 4rem !important;
    }
    
    .timer-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Responsive Tables */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .hide-mobile {
        display: none !important;
    }
}

/* Responsive Modals */
@media (max-width: 640px) {
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 1rem !important;
        padding: 1.5rem !important;
    }
}

/* Responsive Flex Layouts */
@media (max-width: 768px) {
    .flex-row-mobile {
        flex-direction: column !important;
    }
    
    .w-1\/2 {
        width: 100% !important;
    }
    
    /* Timer + Tasks side by side to stacked */
    #view-timer {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    #view-timer > div {
        width: 100% !important;
        min-height: 400px;
    }
}

/* Fix button overflow on mobile */
@media (max-width: 640px) {
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn, button {
        font-size: 0.7rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .tracking-widest {
        letter-spacing: 0.1em !important;
    }
}

/* Stats cards responsive */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Safe area for iOS notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}