/* ==================== GLOBAL STYLES ==================== */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white) !important;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    margin: 0 5px;
    padding: 8px 15px !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.2);
    color: var(--white) !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.15);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    background: linear-gradient(180deg, var(--dark-color), #34495e);
    min-height: calc(100vh - 70px);
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin: 5px 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--primary-color), #c0392b);
    color: var(--white);
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Dashboard Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.info {
    border-left-color: var(--secondary-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
}

.stat-card .icon {
    font-size: 3rem;
    opacity: 0.3;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c0392b, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* ==================== TABLES ==================== */
.table {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--dark-color), #34495e);
    color: var(--white);
    border: none;
    padding: 15px;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
}

/* ==================== FORMS ==================== */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

/* ==================== BADGES ==================== */
.badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ==================== ALERTS ==================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: var(--white);
}

.alert-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: var(--white);
}

.alert-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: var(--white);
}

.alert-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: var(--white);
}

/* ==================== MENU & PAKET CARDS ==================== */
.menu-card, .paket-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

.menu-card:hover, .paket-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.menu-card img, .paket-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.menu-card .card-body, .paket-card .card-body {
    padding: 20px;
}

.menu-card .price, .paket-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* ==================== CART ==================== */
.cart-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--box-shadow);
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-summary {
    background: linear-gradient(135deg, var(--dark-color), #34495e);
    color: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    position: sticky;
    top: 20px;
}

/* ==================== PAGINATION ==================== */
.pagination .page-link {
    color: var(--primary-color);
    border: 2px solid #e0e0e0;
    margin: 0 2px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== FOOTER ==================== */
.footer {
    background: linear-gradient(135deg, var(--dark-color), #34495e);
    color: var(--white);
    padding: 30px 0;
    margin-top: 50px;
}

.footer a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-color);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    margin-bottom: 50px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .sidebar {
        min-height: auto;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .menu-card img, .paket-card img {
        height: 150px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid var(--white);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== IMAGE UPLOAD PREVIEW ==================== */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    margin-top: 10px;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* ==================== UTILITIES ==================== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.shadow-custom {
    box-shadow: var(--box-shadow) !important;
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Tablets and below (768px) */
@media (max-width: 768px) {
    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Sidebar full width on mobile */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    /* Sidebar backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    /* Content adjustments */
    .content-wrapper {
        padding: 15px;
    }
    
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Cards stack vertically */
    .card {
        margin-bottom: 1rem;
    }
    
    .menu-card,
    .paket-card {
        margin-bottom: 1.5rem;
    }
    
    /* Modal full screen */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Table responsive */
    .table-responsive {
        border: 0;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table thead {
        display: none;
    }
    
    table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 0.5rem;
    }
    
    table td {
        display: block;
        text-align: right;
        padding: 0.5rem;
        border: 0;
    }
    
    table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-align: left;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.8rem;
    }
    
    /* Form inputs larger for touch */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Grid adjustments */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Stats cards */
    .stat-card {
        margin-bottom: 1rem;
    }
    
    /* Footer adjustments */
    footer {
        padding: 15px 0;
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 1rem;
    }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
    /* Even smaller text */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Compact navbar */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Smaller cards */
    .card {
        margin-bottom: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Compact buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Form adjustments */
    .form-label {
        font-size: 0.875rem;
    }
    
    /* Price display */
    .price {
        font-size: 1.1rem;
    }
    
    /* Reduce spacing */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mt-4 {
        margin-top: 1rem !important;
    }
}

/* Landscape orientation tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }
    
    .content-wrapper {
        margin-left: 200px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    a, button, .btn, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    .card:hover {
        transform: none;
    }
    
    /* Better scrolling */
    .modal-body,
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* Print styles */
@media print {
    /* Hide unnecessary elements */
    .navbar,
    .sidebar,
    .btn,
    .no-print,
    footer,
    .alert,
    .modal {
        display: none !important;
    }
    
    /* Full width content */
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    /* Optimize tables */
    table {
        width: 100%;
        font-size: 0.85rem;
        border-collapse: collapse;
    }
    
    table thead {
        display: table-header-group;
    }
    
    table tr {
        page-break-inside: avoid;
    }
    
    /* Page breaks */
    .page-break {
        page-break-after: always;
    }
    
    /* Black text for better printing */
    body {
        color: #000 !important;
    }
    
    /* Remove backgrounds */
    .card,
    .table {
        background: #fff !important;
        box-shadow: none !important;
    }
}
