.navbar {
    background: linear-gradient(to right, #1e4c87, #2196f3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0;
    border: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: linear-gradient(to right, rgba(30, 76, 135, 0.98), rgba(33, 150, 243, 0.98));
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
    max-width: calc(100% - 60px);
    overflow: hidden;
}

.logo-svg {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-svg:hover {
    transform: scale(1.05);
}

.navbar-brand {
    text-decoration: none !important;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
}

.logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    margin-left: 4px;
}

.company-name {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.1;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
    flex: 1;
}

.logo-text .subtitle {
    font-size: 0.85rem;
    color: #ffd700;
    opacity: 0.8;
    line-height: 1;
    white-space: nowrap;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #ffd700 !important;
}

.navbar-nav .nav-link.active {
    color: #ffd700 !important;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: #ffd700;
    opacity: 0.8;
}

.navbar-nav .nav-link i {
    font-size: 0.9rem;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover i {
    transform: translateY(-1px);
}

/* Hilangkan border yang berkedip saat klik */
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:active,
.navbar-nav .nav-link:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.dropdown-toggle:focus,
.dropdown-toggle:active,
.dropdown-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.dropdown-item:focus,
.dropdown-item:active,
.dropdown-item:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Hilangkan semua efek tap highlight di mobile */
.navbar-nav .nav-link,
.dropdown-toggle,
.dropdown-item {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    position: relative;
    z-index: 1001;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dropdown Menu */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.98);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.dropdown-item {
    color: #2c3e50;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
    transform: translateX(5px);
}

.dropdown-item.active {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.dropdown-item:hover i {
    color: #2196f3;
    transform: scale(1.1);
}

.dropdown-divider {
    border-color: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

/* Language Switcher */
.language-switcher img {
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.language-switcher:hover img {
    transform: scale(1.1);
}

.language-switcher .active img {
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

/* Admin Badge */
.admin-badge {
    background: linear-gradient(45deg, #ffd700, #ffa000);
    color: #1a237e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 991.98px) {
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.95);
        margin-top: 0;
        border: none;
        box-shadow: none;
        padding: 0.25rem;
    }
    
    .dropdown-menu::before {
        display: none;
    }
    
    .dropdown-item {
        padding: 0.75rem;
        border-radius: 4px;
    }
    
    .dropdown-item:hover {
        transform: none;
    }
    
    .admin-badge {
        margin-left: 0;
        margin-right: 0.5rem;
    }
}

/* Navbar Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar.show-navbar {
    animation: slideDown 0.3s ease forwards;
}

/* Navbar Shadow on Scroll */
.navbar.shadow-on-scroll {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Active Link Animation */
.navbar-nav .nav-link.active::after {
    animation: linkActive 0.3s ease forwards;
}

@keyframes linkActive {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: calc(100% - 2rem);
        opacity: 1;
    }
}

/* Dropdown Animation */
.dropdown-menu.show {
    animation: fadeInUp 0.2s ease forwards;
}

@keyframes fadeInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hover Effects */
.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: #ffd700;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.navbar-nav .nav-link:hover::before {
    transform: scaleX(1);
}

/* Focus States */
.navbar-nav .nav-link:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: -2px;
    border-radius: 4px;
}

.dropdown-item:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: -2px;
}

@media (max-width: 991.98px) {
    .navbar-brand {
        margin-right: 0;
        flex: 1;
    }
    
    .logo-container {
        gap: 2px;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
    }
    
    .logo-img {
        width: 35px !important;
        height: 35px !important;
        flex-shrink: 0;
    }
    
    .logo-text {
        overflow: hidden;
        margin-left: 3px;
    }
    
    .company-name {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 80px);
    }
    
    .logo-text .subtitle {
        font-size: 0.7rem !important;
        white-space: nowrap;
    }
    
    .navbar-toggler {
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .navbar-collapse {
        background: linear-gradient(to right, rgba(30, 76, 135, 0.98), rgba(33, 150, 243, 0.98));
        margin: 1rem -1rem -0.75rem;
        padding: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .navbar-nav .nav-link.active::after {
        left: 1rem;
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-brand {
        max-width: calc(100% - 60px);
    }
    
    .logo-container {
        gap: 2px;
        overflow: hidden;
    }
    
    .logo-img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .logo-text {
        margin-left: 3px;
    }
    
    .company-name {
        font-size: 0.85rem !important;
        line-height: 1.1;
        max-width: calc(100vw - 70px);
    }
    
    .logo-text .subtitle {
        font-size: 0.65rem !important;
        line-height: 1;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        margin-left: 10px;
    }
}

@media (max-width: 576px) {
    .logo-img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .logo-text {
        margin-left: 2px;
    }
    
    .company-name {
        font-size: 0.8rem !important;
        max-width: calc(100vw - 60px);
    }
    
    .logo-text .subtitle {
        font-size: 0.65rem !important;
    }
    
    .navbar-brand {
        max-width: calc(100% - 50px);
    }
    
    .navbar-toggler {
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .company-name {
        font-size: 0.75rem !important;
        max-width: calc(100vw - 55px);
    }
    
    .logo-text .subtitle {
        font-size: 0.6rem !important;
    }
}

@media (max-width: 360px) {
    .logo-img {
        width: 28px !important;
        height: 28px !important;
    }
    
    .company-name {
        font-size: 0.7rem !important;
        max-width: calc(100vw - 50px);
    }
    
    .logo-text .subtitle {
        font-size: 0.55rem !important;
    }
}

/* Perbaikan khusus untuk administrator dan teks MTU */
@media (max-width: 1200px) {
    .navbar-brand {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 120px);
    }
    
    .logo-container {
        max-width: calc(100vw - 130px);
    }
    
    .company-name {
        max-width: calc(100vw - 150px) !important;
    }
}

/* Untuk layar admin pada tablet */
@media (max-width: 992px) and (min-width: 769px) {
    .company-name {
        font-size: 1rem !important;
        max-width: calc(100vw - 100px) !important;
    }
    
    .navbar-brand {
        max-width: calc(100% - 80px);
    }
}

/* Optimasi khusus untuk mencegah teks terpotong */
.navbar-brand:hover .company-name {
    text-overflow: clip;
    overflow: visible;
    white-space: nowrap;
    position: relative;
    z-index: 1000;
    background: rgba(30, 76, 135, 0.95);
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Reset hover effect untuk mobile */
@media (max-width: 768px) {
    .navbar-brand:hover .company-name {
        text-overflow: ellipsis;
        overflow: hidden;
        position: static;
        background: transparent;
        padding: 0;
        border-radius: 0;
    }
}

/* Perbaikan tambahan untuk memastikan teks tidak terpotong */
@media screen {
    .navbar-toggler {
        width: 40px !important;
        min-width: 40px !important;
        flex-shrink: 0 !important;
    }
    
    .navbar-brand {
        flex-grow: 1 !important;
        flex-basis: 0 !important;
        min-width: 0 !important;
    }
    
    .logo-container {
        width: 100% !important;
        max-width: none !important;
    }
    
    .company-name {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.2 !important;
    }
}

/* Khusus untuk mobile, tetap gunakan ellipsis */
@media (max-width: 768px) {
    .company-name {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: normal !important;
        max-width: calc(100vw - 70px) !important;
    }
}

/* Perbaikan jarak logo untuk semua ukuran layar */
@media screen {
    .logo-container {
        gap: 2px !important;
    }
    
    .logo-text {
        margin-left: 2px !important;
    }
    
    .logo-img {
        margin-right: 0 !important;
    }
} 