/* Layout Container */
.workspace-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    flex: 1;
    width: 100%;
}

.main-content {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-width: 0;
    order: 1;
    /* Content on the left by default */
}

/* Sidebar Layout: Fixed Header, Scrollable List */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* Adjust height to fit viewport minus header */
    height: calc(100vh - 120px);
    position: sticky;
    top: 100px;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    order: 2;
    /* Sidebar on the right */
}

.sidebar-fixed {
    flex-shrink: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.sidebar-scrollable-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: 5px;
}

/* Sidebar Menu Styles */
.sidebar-search {
    margin-bottom: 1.5rem;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
}

.sidebar-search input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-search::before {
    content: "🔍";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #94a3b8;
}

.sidebar-menu h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 700;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li {
    margin-bottom: 0.5rem;
}

.menu-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.menu-list a:hover {
    background: #eff6ff;
    color: #2563eb;
}

.menu-list a.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* Mobile Sidebar behavior override */
@media (max-width: 1024px) {
    .workspace-container {
        flex-direction: column;
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        max-height: 500px;
        order: 2;
        /* Search/Sidebar on bottom for mobile */
    }

    .main-content {
        order: 1;
        padding: 1.5rem;
    }

    .sidebar-scrollable-list {
        max-height: 300px;
        /* Limit height on mobile */
    }
}

.tool-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.back-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tool-header p {
    flex-basis: 100%;
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.tool-title {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Ensure Logo size is consistent */
.logo-icon {
    width: 60px;
    /* Standardize size across tools */
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navbar */
.navbar {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #2563eb;
}

/* Footer */
footer,
#main-footer {
    background: #1e293b !important;
    color: #ffffff !important;
    padding: 0;
    margin-top: 4rem;
}

footer {
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #f1f5f9 !important;
}

.footer-section p,
.footer-section a {
    color: #ffffff !important;
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: #cbd5e1 !important;
}

.footer-bottom {
    max-width: 1600px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    text-align: center;
    color: #ffffff !important;
    font-size: 0.9rem;
    padding-bottom: 2rem;
}

/* Placeholder styles during loading */
#main-header,
#main-footer {
    min-height: 80px;
    /* Prevent collapse before load */
}