﻿/*:root {
    --primary: #0070f3;
    --primary-foreground: #ffffff;
    --secondary: #f5f5f5;
    --secondary-foreground: #111111;
    --accent: #00a8ff;
    --accent-foreground: #ffffff;
    --background: #ffffff;
    --foreground: #111111;
    --card: #ffffff;
    --card-foreground: #111111;
    --border: #e5e5e5;
    --input: #ffffff;
    --ring: #0070f3;
}*/



/*.sidebar {
    width: 280px;
    min-width: 280px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 70px;
    min-width: 70px;
}*/


/*----------------------------------------------------------*/

/*.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background-color: #fff;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
    background-color: var(--background);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}*/

.sidebar {
    /* gaya sedia ada awak */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
    z-index: 1000;
    /*background-color: #004793;*/
    /*background: linear-gradient(135deg, #003366, #00BFFF);*/
    background: linear-gradient(135deg, #0099cc, #003366);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    /* scrollbar custom */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #c0c0c0 #f0f0f0; /* Firefox */
}

    /* Untuk Chrome, Edge dan lain-lain */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #f0f0f0;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background-color: #c0c0c0;
        border-radius: 10px;
        border: 1px solid transparent;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background-color: #999;
        }

    .sidebar.collapsed {
        width: 80px;
    }

        .sidebar.collapsed.nav-link {
            margin-left: 0rem; 
            margin-right: 0rem; 
        }

/*-------------------------------------------------------*/


.logo-container {
    background-color: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    height: 3.5rem;
}

.collapsed .logo-container a {
    display: none;
}

/*.nav-link {
    color: var(--foreground);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .nav-link:hover {
        background-color: var(--secondary);
        transform: translateX(5px);
    }

    .nav-link.active {
        background-color: var(--primary) !important;
        color: var(--primary-foreground) !important;
        border-left: 4px solid var(--accent);
    }*/

/*.submenu-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

    .submenu-link:hover {
        background-color: var(--secondary);
        color: var(--primary);
    }*/



/*.toggle-btn {
    color: var(--foreground);
    transition: all 0.3s ease;
}

    .toggle-btn:hover {
        color: var(--primary);
        transform: rotate(180deg);
    }*/





/* Teks menu utama */
.nav-link {
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    border-radius: 0;
}

    .nav-link.active,
    .nav-link.active:hover,
    .nav-link.active:focus,
    .nav-link.active:active {
        color: #003366;
        background-color: #E6F0FF;
        font-weight: bold;
        border-radius: 0.5rem;
    }


    .nav-link:hover {
        background-color: transparent;
        color:yellow;
        border-left: 4px solid var(--accent);
    }

    .nav-link:focus {
        background-color: transparent;
        color: white;
    }

    
    /*.nav-link.active {
        background-color: var(--accent);
        color: pink;
        border-left: 4px solid var(--primary);
    }*/
    /*.nav-link.active {
        color: var(--primary) !important;
        background-color: transparent !important;
        border-left: 4px solid var(--primary) !important;
    }*/

    .nav-link i {
        font-size: 1.2rem;
        
    }

/* Submenu design */
.submenu-link {
    padding: 0.45rem 1.5rem;
    /*background-color: #004793;*/
    color: white;
    font-size: 0.8rem;
    border-left: 2px solid transparent;
}

    .submenu-link:hover {
        background-color: transparent;
        color: yellow;
        border-left: 2px solid var(--accent);
    }

/* Collapse arrow spacing */
.nav-link .bi-chevron-down {
    margin-left: auto;
    font-size: 0.9rem;
}

/* Bullet dot untuk submenu */
/*.bullet-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-top: 6px;
}*/

/* Bullet default */
.bullet-dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Bila submenu active */
.submenu-link.active .bullet-dot {
    background-color: #003366;
}

/* Toggle button */
.toggle-btn {
    color: white;
    background-color: transparent;
    border: none;
}

    .toggle-btn:hover {
        color: white;
        transform: rotate(180deg);
        transition: all 0.3s ease;
    }









.btn-primary {
    /*background-color: #5c7eb0;*/
    background-color: #003366;
    /*border-color: #004793;*/
    color: white;
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        background-color: #0099cc;
        color: white;
       /* border-color: #87a0c5;*/
    }

.collapsed .nav-link span,
.collapsed .new-project-btn span
 {
    display: none;
}

.collapsed .nav-link i {
    font-size: 1.5rem;
    margin: 0 !important;
}

.collapsed #productsCollapse,
.collapsed #reportsCollapse {
    display: none !important;
}

.collapse {
    transition: all 0.3s ease-in-out;
}

    .collapse.show {
        opacity: 1;
    }

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--accent);
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/*@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        min-width: 70px;
    }

        .sidebar .logo-container h4,
        .sidebar .nav-link span,
        .sidebar .project-item span {
            display: none;
        }

        .sidebar .nav-link i {
            font-size: 1.5rem;
            margin: 0 !important;
        }

        .sidebar #productsCollapse,
        .sidebar #reportsCollapse,
        .sidebar .new-project-btn span {
            display: none;
        }
}*/

@media (max-width: 768px) {
    .sidebar {
        width: 280px; /* Sama macam desktop */
        min-width: 280px;
    }

        /* HANYA SEMBUNYIKAN bila collapsed */
        .sidebar.collapsed .logo-container h4,
        .sidebar.collapsed .nav-link span,
        .sidebar.collapsed .project-item span,
        .sidebar.collapsed #productsCollapse,
        .sidebar.collapsed #reportsCollapse,
        .sidebar.collapsed .new-project-btn span {
            display: none !important;
        }

        .sidebar.collapsed .nav-link i {
            font-size: 1.5rem;
            margin: 0 !important;
        }
}

@media (min-width: 769px) {
    .sidebar.collapsed .nav-link .bi-chevron-down {
        display: none !important;
    }
}



/* =================== MOBILE-FRIENDLY LAYOUT =================== */
@media (max-width: 768px) {
    .page {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        /*background-color: #fff;*/
        /*background: linear-gradient(135deg, #003366, #00BFFF);*/
        background: linear-gradient(135deg, #0099cc, #003366);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease-in-out;
        transform: translateX(0);
    }

        .sidebar.collapsed {
            transform: translateX(-100%);
        }

    main.main {
        margin-left: 0 !important;
        margin-top: 60px; /* Untuk bagi ruang atas */
        padding: 1rem;
        transition: margin-left 0.3s ease-in-out;
    }

    .top-row.auth {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: #f9f9f9;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 900;
        padding: 0 1rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .toggle-btn {
        display: block;
        font-size: 1.5rem;
        background: none;
        border: none;
        color: white;
    }

    /* Hide sidebar logo on collapse in mobile */
    .sidebar.collapsed .logo-container {
        display: none;
    }
}



