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

:root {
    --primary: #2563eb; /* Corporate Royal Blue */
    --primary-hover: #1d4ed8;
    --bg-app: #f8fafc;
    --bg-sidebar: #2563eb; /* Clean Blue Sidebar */
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #facc15; /* Silver/Gold Accent */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

code, pre, kbd, samp, .font-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace !important;
}

.sidebar {
    background-color: var(--bg-sidebar);
    width: 280px;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Standard Page Header Layout */
.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.05em;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Standard Action Button (Top Right) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.btn-action:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.2);
}

.btn-action:active {
    transform: translateY(0);
    scale: 0.95;
}

/* Sidebar Improvements */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.85); /* Brighter text */
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600; /* Bolder */
    transition: all 0.2s;
    margin: 0 0.75rem;
}

.sidebar-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.875rem;
    color: rgba(255, 255, 255, 0.6); /* Muted icons */
    transition: color 0.2s;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar-link:hover i {
    color: #ffffff;
}

.sidebar-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sidebar-link.active i {
    color: #ffffff;
}

.prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.type-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

/* Compact Card Styles */
.prompt-card.compact {
    padding: 0.75rem !important;
}

.prompt-card.compact h3 {
    font-size: 0.9375rem !important; /* 15px */
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem !important;
}

.prompt-card.compact .text-xs {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
}

/* Sidebar Submenu (Flyout on Desktop, Accordion on Mobile) */
@media (min-width: 1024px) {
    .sidebar-item-content {
        position: fixed; /* Use fixed to avoid clipping by sidebar overflow */
        left: 290px;
        top: 0;
        width: 260px;
        background: #ffffff;
        box-shadow: 10px 10px 40px rgba(0, 0, 0, 0.2);
        border-radius: 1.5rem;
        border: 1px solid #e2e8f0;
        padding: 0.75rem !important;
        opacity: 0;
        visibility: hidden;
        transform: translateX(15px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
        display: block !important;
        z-index: 5000;
        border-left: none;
        margin-top: 0;
    }

    .group\/menu:hover .sidebar-item-content {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .sidebar-item-content a {
        color: #475569 !important; /* Slate-600 */
        padding: 0.75rem 1rem !important;
        border-radius: 0.75rem;
        font-weight: 600;
        font-size: 0.8125rem !important;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .sidebar-item-content a:hover {
        background-color: #f1f5f9 !important; /* Slate-100 */
        color: #2563eb !important; /* Blue-600 */
    }

    .sidebar-item-content a i {
        color: #94a3b8 !important; /* Slate-400 */
        margin: 0 !important;
        width: 1rem;
        text-align: center;
    }

    .sidebar-item-content div span {
        color: #94a3b8 !important;
        font-size: 0.7rem !important;
    }
}

/* Accordion for Mobile remains in mobile media query below */
.sidebar-item-content {
    display: none;
}
.group\/menu.active .sidebar-item-content {
    display: block;
}

/* Modal Polish */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Inputs & Buttons */
input, select, textarea {
    border-radius: 0.5rem !important;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 2000; /* Even higher on mobile */
        box-shadow: 20px 0 50px rgba(0,0,0,0.4);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 90;
    }
    
    .sidebar-overlay.active {
        display: block;
    }

    /* Standard Accordion for all screens */
    .sidebar-item-content {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        margin-top: 0.25rem;
        border-left: 2px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }
    
    .group\/menu.active .sidebar-item-content {
        display: block;
    }
    
    .group\/menu.active .sidebar-link {
        background-color: rgba(255, 255, 255, 0.05);
        color: #ffffff;
    }
    
    .group\/menu.active .fa-chevron-right {
        transform: rotate(90deg);
    }
}

@media (pointer: coarse) {
    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
}

/* Compact Mode Styling */
.compact-mode #sidebar {
    transform: translateX(-100%) !important;
}

.compact-mode .lg\:pl-\[280px\] {
    padding-left: 0 !important;
}

.compact-mode .lg\:pr-\[280px\] {
    padding-right: 0 !important;
}

.compact-sub-header {
    height: 50px;
    z-index: 40;
}

.compact-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.compact-nav-link i {
    font-size: 0.9rem;
    opacity: 0.6;
}

.compact-nav-link:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

.compact-nav-link:hover i {
    opacity: 1;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Kanban Optimizations for Compact Mode */
.compact-mode .task-list {
    gap: 0.75rem !important;
}

.compact-mode .min-w-\[300px\] {
    min-width: 260px !important;
    max-width: 320px !important;
}
