/* Dashboard Layout */
.dashboard-container {
    display: none;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
}

.nav-item:hover {
    background: rgba(77, 77, 229, 0.08);
    border-left-color: #4D4DE5;
    color: #1f2937;
}

.nav-item.active {
    background: rgba(77, 77, 229, 0.12);
    border-left-color: #4D4DE5;
    color: #4D4DE5;
    font-weight: 600;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: #374151;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: #1f2937;
}

/* Mobile Header */
.mobile-header {
    display: none;
    background: white;
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.mobile-toggle {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.mobile-toggle:hover {
    background: #f9fafb;
}

.mobile-logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
    overflow: hidden;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    height: 100vh;
    overflow-y: auto;
    background: #f9fafb;
}

.content-header {
    padding: 30px 40px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.content-description {
    color: #6b7280;
    font-size: 16px;
    font-weight: 400;
}

.content-body {
    padding: 40px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Tool Content */
.tool-content {
    display: none;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4D4DE5;
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: #4D4DE5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 24px;
    color: white;
}

.tool-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.tool-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.tool-btn {
    width: 100%;
    padding: 12px;
    background: #4D4DE5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #3d3db8;
    transform: translateY(-1px);
}

.add-tool-card {
    background: #4D4DE5;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.add-tool-card:hover {
    background: #3d3db8;
    border-color: rgba(255, 255, 255, 0.6);
}

.add-icon {
    font-size: 48px;
    margin-bottom: 10px;
    color: white;
    opacity: 0.9;
}

/* Fix Add New Tool text visibility */
.add-tool-card .tool-title {
    color: white !important;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 150;
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for mobile */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-header {
        padding: 20px;
    }

    .content-body {
        padding: 20px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .content-title {
        font-size: 24px;
    }

    .content-description {
        font-size: 14px;
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 140;
    }

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

    /* Mobile sidebar adjustments */
    .sidebar-header {
        padding: 15px 20px;
    }

    .sidebar-nav {
        padding: 15px 0;
        /* Ensure nav doesn't take up too much space on mobile */
        max-height: calc(100vh - 200px);
        max-height: calc(100dvh - 200px);
    }

    .sidebar-footer {
        padding: 15px 20px;
        /* Ensure footer is always visible */
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 2px solid #e5e7eb;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    /* Make logout button more prominent on mobile */
    .logout-btn {
        padding: 14px 12px;
        font-size: 15px;
        font-weight: 600;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .sidebar-nav {
        max-height: calc(100vh - 180px);
        max-height: calc(100dvh - 180px);
    }
    
    .sidebar-header {
        padding: 12px 15px;
    }
    
    .sidebar-footer {
        padding: 12px 15px;
    }
}