:root {
    --primary-color: #6366F1;
    /* Modern Indigo */
    --primary-hover: #4F46E5;
    --secondary-color: #8B5CF6;
    /* Violet accent */
    --background-color: #F3F4F6;
    /* Cool Gray */
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --action-color: #EF4444;
    /* Red for actions */
    --success-color: #10B981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Fixed Navbar with Glassmorphism --- */
.top-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo-container {
    font-weight: 800;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Main Layout Wrapper --- */
.main-wrapper {
    display: flex;
    margin-top: 70px;
    /* Offset for fixed navbar */
    min-height: calc(100vh - 70px);
}

/* --- Sidebar Styling --- */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    padding: 25px;
    overflow-y: auto;
    position: fixed;
    height: calc(100vh - 70px);
    /* Fill remaining height */
    left: 0;
    bottom: 0;
    z-index: 900;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    /* Push content to right of fixed sidebar */
    padding: 30px;
    width: calc(100% - 280px);
    /* Prevent overflow */
    max-width: 1400px;
    /* Restrict ultra-wide screens */
}

/* --- Tool Cards & Grid --- */
.category-title {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 4px;
}

.tool-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.trackbtn {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    flex: 1 1 calc(25% - 20px);
    /* 4 columns */
    min-width: 200px;
    text-align: center;
}

.trackbtn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- Tool Pages (Compressor/Passport) --- */
.mainsec {
    display: flex;
    gap: 30px;
}

.maincont {
    flex: 2.5;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.maincont h1 {
    font-size: 2rem;
    background: linear-gradient(to right, #1F2937, #4B5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
    font-weight: 800;
}

.imagelabel {
    border: 3px dashed var(--primary-color);
    background: #F9FAFB;
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.imagelabel:hover {
    background: #EEF2FF;
}

.imgdimnst {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.sizbtna {
    padding: 4px 8px;
    margin-left: 5px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: #f3f4f6;
}

.sizbtna.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btnsel {
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: var(--radius);
    font-weight: 600;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
}

.bottomcont {
    background: #F9FAFB;
    padding: 30px;
    border-radius: var(--radius);
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.compressbtn {
    background: var(--action-color);
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.compressbtn:hover {
    transform: scale(1.05);
}

.sidecon {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Sidebar Tools List */
.sidebar-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin: 25px 0 10px;
    letter-spacing: 0.5px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Increased gap for icons */
    padding: 12px 15px;
    /* Bigger touch target */
    margin-bottom: 5px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-btn i {
    width: 20px;
    /* Fixed width for alignment */
    text-align: center;
    color: var(--primary-color);
}

.sidebar-btn.active i {
    color: white;
}

.sidebar-btn:hover {
    background: #EEF2FF;
    color: var(--primary-color);
}

.sidebar-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Original Grid Buttons (Keep for Main Content) */
.toolbtn {
    display: block;
    background: white;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.toolbtn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.toolbtn.highligncol {
    background: #EEF2FF;
    border-left: 5px solid var(--primary-color);
}

/* --- Mobile Responsiveness --- */
@media(max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        /* Full width on mobile */
        width: 100%;
        padding: 20px;
    }

    /* Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 850;
        /* Behind sidebar (900) but above content */
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        padding-right: 15px;
        color: var(--text-main);
        font-size: 1.5rem;
    }

    /* Remove old close styles if any remained */
    .close-sidebar {
        display: none !important;
    }

    .trackbtn {
        flex: 1 1 100%;
    }
}

/* Stack buttons */
}

/* Crop Popup Styles Removed - Using Bootstrap Modal */