/* assets/dashboard.css - Main dashboard styles with responsive design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --sidebar-bg: #111827;
    --sidebar-hover: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --content-bg: #F3F4F6;
    --card-bg: #FFFFFF;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Breakpoints */
    --mobile: 640px;
    --tablet: 768px;
    --desktop: 1024px;
    --wide: 1280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--content-bg);
    color: #1F2937;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

/* Logo */
.logo {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    visibility: hidden;
}

/* Mobile Close Button */
.mobile-close {
    display: none;
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Menu */
.menu {
    padding: var(--spacing-md) 0;
}

.menu-section {
    margin-bottom: var(--spacing-xl);
}

.menu-title {
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-title {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
}

.menu-item {
    position: relative;
    margin: var(--spacing-xs) var(--spacing-sm);
}

.menu-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0.75rem var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.menu-link.active {
    background: var(--primary);
    color: white;
}

.menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
}

.menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.menu-text {
    white-space: nowrap;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    visibility: hidden;
}

.menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* Toggle Button */
.sidebar-toggle {
    position: absolute;
    right: -20px;
    top: 2rem;
    width: 40px;
    height: 40px;
    background: var(--sidebar-bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    background: var(--primary);
}



/* Content Area */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .content {
    margin-left: var(--sidebar-collapsed);
}



/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tool Container */
.tool-container {
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Tool iframe */
#toolFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Tool not found */
.tool-not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.not-found-icon {
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.tool-not-found h2 {
    color: var(--gray-900);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-not-found p {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.tool-not-found code {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.btn-primary {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}



/* Indicator animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.menu-indicator {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    margin-left: auto;
    animation: pulse 2s infinite;
}

/* Tooltip */
.tooltip {
    position: absolute;
    left: calc(100% + 1rem);
    top: 50%;
    transform: translateY(-50%);
    background: #1F2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.sidebar.collapsed .menu-link:hover .tooltip {
    opacity: 1;
}

.tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #1F2937;
}



/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-close {
        display: flex;
    }
    
    .sidebar-toggle {
        display: none;
    }
    

}

@media (max-width: 640px) {
    .tool-container {
        height: 100vh;
    }
}