/* Custom styles for the kasirkedai app */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&display=swap');

/* ========== GLOBAL RESET ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    transition: none;
    position: relative;
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* ========== LOGIN STYLES ========== */
#judul-form {
    font-family: 'Binals Coffee', 'Playfair Display', serif;
    font-weight: 900;
    font-size: 48px;
    color: #000000;
    background-color: transparent;
    display: block;
    text-align: center;
    padding: 0;
    border-radius: 0;
    letter-spacing: 1px;
    margin: 30px auto;
}

#tab-login {
    font-family: 'Binals Coffee', 'Playfair Display', serif;
    font-weight: 700;
}

.bg-binals {
    background-color: #000000;
    min-height: 100vh;
}

.login-card {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    position: relative;
    z-index: 10 !important;
}

.login-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.login-card-logo {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-logo img { 
    width: 100%; 
    height: auto; 
    display: block; 
}

.login-card-content { 
    flex: 1; 
    width: 100%; 
}

.tabs-row {
    margin-bottom: 22px;
}

.login-card-content .form-control {
    padding: 12px 14px;
    height: auto;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: none;
    margin-bottom: 12px;
    width: 100%;
    max-width: 520px;
}

.login-card-content .form-control::placeholder { 
    color: #999; 
}

.login-card-content .btn-black {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    background-color: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
}

.login-card-content .btn-black:hover {
    background-color: #e6e6e6 !important;
    color: #000 !important;
}

.form-logo {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 6px auto;
}

/* Background running text */
.background-running {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    font-size: 150px;
    font-weight: 900;
    opacity: 0.06;
    color: black;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    animation: berjalan 18s linear infinite;
    font-family: 'Playfair Display', serif;
}

@keyframes berjalan {
    0% { transform: translate(100%, -50%); }
    100% { transform: translate(-100%, -50%); }
}

/* ========== BUTTON STYLES ========== */
.btn-black {
    color: #fff !important;
    background-color: #000 !important;
    border-color: #000 !important;
}

.btn-black:hover, .btn-black:focus {
    color: #fff !important;
    background-color: #111 !important;
    border-color: #111 !important;
}

.btn-black-outline {
    color: #f6efef !important;
    background-color: transparent !important;
    border-color: #000 !important;
}

.btn-black-outline:hover, .btn-black-outline:focus {
    color: #fff !important;
    background-color: #000 !important;
    border-color: #000 !important;
}

.btn-login {
    background-color: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 6px;
}

.btn-login:hover {
    background-color: #e6e6e6 !important;
    color: #000 !important;
}

/* ========== HEADER - FIXED ========== */
.top-header {
    background-color: #000 !important;
    color: #fff !important;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 60px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-header * {
    color: #fff !important;
}

.bi-list {
    color: white !important;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-size: 2rem;
    padding: 5px;
}

.bi-list:hover {
    transform: scale(1.1);
}

/* ========== SIDEBAR MENU - PUSH EFFECT ========== */
.sidebar-menu {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 60px);
    background-color: #000 !important;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-menu.active {
    left: 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 15px;
}

.sidebar-menu a {
    color: #fff !important;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.sidebar-menu a:hover {
    background-color: #333 !important;
    padding-left: 20px;
}

.sidebar-menu a i {
    margin-right: 10px;
    font-size: 18px;
}

/* ========== PAGE WRAPPER - PUSH EFFECT ========== */
.page-wrapper {
    transition: margin-left 0.3s ease;
    margin-left: 0;
    margin-top: 80px;
    margin-bottom: 30px;
    padding: 0 15px;
    min-height: calc(100vh - 110px);
}

.page-wrapper.shifted {
    margin-left: 250px;
}

/* ========== MENU GRID - RESPONSIVE ========== */
.menu-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.menu-card {
    width: 100%;
    margin: 0;
}

.menu-card .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.menu-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

/* ========== IMAGE CONTAINER WITH FALLBACK ========== */
.card-img-container {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 64px;
}

/* ========== FORM CONTROLS ========== */
.search-form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    justify-content: space-between;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

.search-form input {
    flex: 1;
    min-width: 150px;
}

.order-form-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.order-form-container input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

/* ========== TABLE STYLES ========== */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.card {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.card-header {
    font-weight: 600;
    padding: 12px 15px;
}

.card-body {
    padding: 15px;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Large screens (desktops) */
@media (max-width: 1400px) {
    .menu-row {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1200px) {
    .menu-row {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Medium screens (tablets landscape) */
@media (max-width: 992px) {
    .menu-row {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 15px;
    }
    
    /* On tablet and mobile, sidebar becomes overlay */
    .page-wrapper.shifted {
        margin-left: 0;
    }
    
    .sidebar-menu {
        z-index: 1001;
    }
    
    .card-img-container {
        height: 180px;
    }
    
    .form-logo { width: 140px; }
    
    .table-responsive .table {
        font-size: 14px;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 10px 8px;
    }
}

/* Small screens (tablets portrait) */
@media (max-width: 768px) {
    .menu-row {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .sidebar-menu {
        width: 220px;
        left: -220px;
    }
    
    .background-running {
        font-size: 80px;
    }
    
    .search-form-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    .order-form-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .order-form-container input,
    .order-form-container button {
        max-width: 100%;
        width: 100%;
    }
    
    .card-img-container {
        height: 160px;
    }
    
    .form-logo { width: 120px; }
    
    .table-responsive .table {
        font-size: 13px;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 8px 5px;
    }
}

/* Extra small screens (phones) */
@media (max-width: 576px) {
    #judul-form { 
        font-size: 36px; 
        padding: 8px 16px; 
    }
    
    .tabs-row { margin-bottom: 12px; }
    
    .login-card-inner { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .login-card-logo { 
        width: 100%; 
        text-align: center; 
    }
    
    .login-card-logo img { 
        width: 90px; 
        margin: 0 auto; 
    }
    
    .menu-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .background-running {
        font-size: 50px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-form button {
        width: 100%;
    }
    
    .card-img-container {
        height: 200px;
    }
    
    .card-img-fallback {
        font-size: 48px;
    }
    
    .top-header .h3 {
        font-size: 1.3rem;
    }
    
    .top-header .h3 .mx-3 {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .form-logo { width: 90px; }
    
    /* Mobile table stacking */
    .table-responsive .table thead {
        display: none;
    }
    
    .table-responsive .table,
    .table-responsive .table tbody,
    .table-responsive .table tr {
        display: block;
        width: 100%;
    }
    
    .table-responsive .table tr {
        margin-bottom: 15px;
        border: 2px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .table-responsive .table td {
        display: block;
        text-align: right;
        padding: 10px 15px;
        border: none;
        border-bottom: 1px solid #eee;
    }
    
    .table-responsive .table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
    
    .table-responsive .table td:last-child {
        border-bottom: none;
    }
}

/* ========== UTILITY CLASSES ========== */
.w-auto-mobile {
    width: auto;
}

@media (max-width: 576px) {
    .w-auto-mobile {
        width: 100% !important;
    }
}

.container {
    max-width: 100%;
}

/* Button groups responsive */
.btn-group-vertical {
    width: 100%;
}

@media (max-width: 576px) {
    .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Scrollbar styling */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}