/* Font Face Declarations */
@font-face {
    font-family: 'Indosat';
    src: url('../../includes/Font/IndosatRegular-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Indosat';
    src: url('../../includes/Font/IndosatMedium-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Indosat';
    src: url('../../includes/Font/IndosatBold-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

body {
    font-family: 'Indosat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    color: #4D4D4F;
    margin: 0;
}

/* Ensure all elements use Indosat font */
*, *::before, *::after,
h1, h2, h3, h4, h5, h6,
p, span, div, a, button, input, select, textarea, label,
table, thead, tbody, tr, th, td,
ul, ol, li,
nav, header, footer, aside, main, section {
    font-family: 'Indosat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    color: #4D4D4F;
    padding: 1rem 2rem;
    border-bottom: 2px solid #4D4D4F;
    box-shadow: 0 2px 4px rgba(77,77,79,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.navbar-title {
    font-size: 24px;
    font-weight: bold;
    color: #4D4D4F;
    margin: 0;
    padding: 0;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #4D4D4F;
    color: white;
    min-height: calc(100vh - 70px);
    padding: 1.5rem 0;
    box-shadow: 2px 0 4px rgba(77,77,79,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover {
    background-color: #32BCAD;
}

.sidebar-menu a.active {
    background-color: #EC008C;
    border-left: 4px solid #C6168D;
}

.sidebar-menu .icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Submenu Styles */
.sidebar-menu .menu-item-has-children {
    position: relative;
}

.sidebar-menu .menu-item-has-children > a {
    position: relative;
}

.sidebar-menu .menu-item-has-children .arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.sidebar-menu .menu-item-has-children.active .arrow {
    transform: rotate(180deg);
}

.sidebar-menu .submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #4D4D4F;
}

.sidebar-menu .submenu.active {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}

.sidebar-menu .submenu li {
    margin: 0;
}

.sidebar-menu .submenu a {
    padding: 0.75rem 1.5rem 0.75rem 3rem;
    display: flex;
    align-items: center;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu .submenu a:hover {
    background-color: #32BCAD;
}

.sidebar-menu .submenu a.active {
    background-color: #EC008C;
    border-left: 4px solid #C6168D;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    background-color: #ffffff;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    color: #4D4D4F;
    margin-bottom: 0.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

/* Form group dengan tombol - align buttons */
.form-group:has(button, .btn) {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Alternatif untuk browser yang tidak support :has() - gunakan class khusus */
.form-group.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4D4D4F;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #4D4D4F;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #32BCAD;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 2.75rem;
    min-height: 2.75rem;
    line-height: 1;
}

.btn-primary {
    background-color: #32BCAD;
    color: white;
}

.btn-primary:hover {
    background-color: #4D4D4F;
}

.btn-success {
    background-color: #32BCAD;
    color: white;
}

.btn-success:hover {
    background-color: #4D4D4F;
}

.btn-danger {
    background-color: #ED1C24;
    color: white;
}

.btn-danger:hover {
    background-color: #C6168D;
}

.btn-warning {
    background-color: #FFCB05;
    color: #4D4D4F;
}

.btn-warning:hover {
    background-color: #EC008C;
    color: white;
}

.btn-secondary {
    background-color: #4D4D4F;
    color: white;
}

.btn-secondary:hover {
    background-color: #32BCAD;
}

.btn-info {
    background-color: #EC008C;
    color: white;
}

.btn-info:hover {
    background-color: #C6168D;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background-color: #4D4D4F;
    color: white;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #4D4D4F;
}

table tbody tr:hover {
    background-color: transparent;
}

table tbody tr:hover td {
    color: #000000;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #32BCAD;
    color: white;
    border: 1px solid #4D4D4F;
}

.alert-error {
    background-color: #ED1C24;
    color: white;
    border: 1px solid #C6168D;
}

.alert-info {
    background-color: #EC008C;
    color: white;
    border: 1px solid #C6168D;
}

.alert-warning {
    background-color: #FFCB05;
    color: #4D4D4F;
    border: 1px solid #4D4D4F;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #4D4D4F;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #32BCAD;
}

/* Action buttons in table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.action-buttons > a,
.action-buttons > form {
    display: flex;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    height: 2.25rem;
    min-height: 2.25rem;
    max-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.action-buttons form {
    display: flex;
    margin: 0;
    height: 2.25rem;
    align-items: center;
}

.action-buttons form button.btn-sm {
    height: 2.25rem;
    min-height: 2.25rem;
    max-height: 2.25rem;
    width: auto;
    margin: 0;
}

/* Burger button (hanya tampil di mobile) */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-right: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.burger-btn:hover {
    background: rgba(77, 77, 79, 0.1);
}
.burger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #4D4D4F;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Backdrop mobile menu (hanya dipakai di mobile) */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}
body.mobile-menu-open {
    overflow: hidden;
}
@media (max-width: 768px) {
    .mobile-menu-backdrop {
        display: block;
    }
    .mobile-menu-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Footer - Satu tampilan untuk semua (kiosk & client): bawah halaman, center */
.page-footer {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: auto;
    text-align: center;
    background: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
}
.page-footer img.wms-footer-img,
.wms-footer-img {
    display: block;
    margin: 0 auto;
    max-width: 200px;
    width: auto;
    height: auto;
    max-height: 30px;
    object-fit: contain;
}

/* Responsive - mobile browser */
@media (max-width: 768px) {
    /* Prevent horizontal scroll: body & container fit viewport */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Navbar: full width of screen, compact */
    .navbar {
        width: 100%;
        max-width: 100vw;
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .navbar-left {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.5rem;
    }
    .navbar-right {
        flex: 0 0 auto;
        gap: 0.35rem;
        margin-right: 0;
    }
    .navbar-title {
        font-size: 0.9rem;
        white-space: normal;
        line-height: 1.25;
        max-width: 100%;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
    .logo {
        height: 36px;
    }

    .burger-btn {
        display: flex;
        width: 38px;
        height: 38px;
    }
    .burger-line {
        width: 20px;
    }

    /* Sidebar disembunyikan dari layout; jadi overlay drawer via burger */
    .sidebar {
        position: fixed;
        left: 0;
        top: 56px;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        min-height: auto;
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Main content & body area: fit screen width, no horizontal scroll */
    .main-content {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }
    .content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0.5rem 0.6rem;
        overflow-x: hidden;
    }

    /* Compact font size for mobile */
    html {
        font-size: 13px;
    }
    .content-header h1 {
        font-size: 1.15rem;
    }
    .content-header p {
        font-size: 0.8rem;
    }
    .card {
        padding: 0.75rem 0.6rem;
        font-size: 0.85rem;
    }
    .card h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .stat-card {
        padding: 0.75rem 0.6rem;
    }
    .stat-card h3 {
        font-size: 0.75rem;
    }
    .stat-card .value {
        font-size: 1.35rem;
    }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    table {
        font-size: 0.8rem;
        min-width: 100%;
    }
    table th,
    table td {
        padding: 0.4rem 0.35rem;
        white-space: nowrap;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        height: 2.25rem;
        min-height: 2.25rem;
    }
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
        height: 2rem;
        min-height: 2rem;
        max-height: 2rem;
    }
    /* Navbar right: username & logout text smaller */
    .navbar-right span,
    .navbar-right a {
        font-size: 0.75rem;
    }
    .navbar-right a[href="logout.php"] {
        padding: 0.35rem 0.6rem;
    }
    /* Controller status labels in navbar */
    .navbar-right [style*="font-size: 0.75rem"] {
        font-size: 0.65rem !important;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    background-color: #EC008C;
    color: white;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    opacity: 0.7;
}

.modal-body {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Footer - Bawah halaman (login): fixed bottom, style sama dengan page-footer */
.footer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
    padding: 0.75rem 1rem;
    text-align: center;
}
.footer-container img.wms-footer-img,
.footer-container .wms-footer-img {
    display: block;
    margin: 0 auto;
    max-width: 200px;
    width: auto;
    height: auto;
    max-height: 30px;
    object-fit: contain;
}

