/**
 * Stok Cafe - Custom CSS
 * Style override untuk Bootstrap dan tema kustom
 */

/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #0D47A1;
    --primary-dark: #0a3d8a;
    --secondary: #1976D2;
    --accent: #42A5F5;
    --success: #2E7D32;
    --danger: #C62828;
    --warning: #F9A825;
    --light: #F5F7FA;
    --dark: #1a1a2e;
    --gray: #E8ECF1;
    --font: 'Poppins', sans-serif;
}

/* ===== GLOBAL STYLES ===== */
* {
    font-family: var(--font);
}

body {
    background-color: var(--light);
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* ===== GLASSMORPHISM ===== */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(13, 71, 161, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== CARD STYLES ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray);
    font-weight: 600;
}

/* ===== STAT CARD ===== */
.stat-card {
    padding: 1.5rem;
    border-radius: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.stat-card.primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.stat-card.success { background: linear-gradient(135deg, #2E7D32, #43A047); }
.stat-card.warning { background: linear-gradient(135deg, var(--warning), #FFB300); }
.stat-card.danger { background: linear-gradient(135deg, var(--danger), #E53935); }

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===== BUTTON STYLES ===== */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2E7D32, #43A047);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #C62828, #E53935);
    border: none;
}

/* ===== NAVBAR ===== */
.navbar-main {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 2px 20px rgba(13, 71, 161, 0.2);
}

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

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

/* ===== SIDEBAR ===== */
.sidebar {
    min-height: 100vh;
    background: white;
    border-right: 1px solid var(--gray);
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: #666;
    padding: 0.75rem 1.25rem;
    border-radius: 0 10px 10px 0;
    margin-right: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(13,71,161,0.1), rgba(25,118,210,0.05));
    color: var(--primary);
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ===== TABLE STYLES ===== */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.table thead th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(13, 71, 161, 0.03);
}

/* ===== BADGE STYLES ===== */
.badge-soft {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-soft-success {
    background: rgba(46, 125, 50, 0.15);
    color: #2E7D32;
}

.badge-soft-warning {
    background: rgba(249, 168, 37, 0.15);
    color: #F57F17;
}

.badge-soft-danger {
    background: rgba(198, 40, 40, 0.15);
    color: #C62828;
}

.badge-soft-primary {
    background: rgba(13, 71, 161, 0.15);
    color: var(--primary);
}

.badge-soft-secondary {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

/* ===== FORM STYLES ===== */
.form-control {
    border-radius: 10px;
    border: 1px solid var(--gray);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.15);
}

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-card .product-img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}

.product-card .product-body {
    padding: 1.25rem;
}

.product-card .product-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.product-card .product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.75rem;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="20" r="40" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="80" r="30" fill="rgba(255,255,255,0.03)"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.9);
    margin-top: 1rem;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NOTIFICATION TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--primary);
}

.toast-custom.success { border-left-color: var(--success); }
.toast-custom.error { border-left-color: var(--danger); }
.toast-custom.warning { border-left-color: var(--warning); }
.toast-custom.info { border-left-color: var(--secondary); }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== FOOTER ===== */
.footer-main {
    background: var(--dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 1rem;
}

.footer-main a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-main a:hover {
    color: white;
}

/* ===== KDS STYLES ===== */
.kds-card {
    border-radius: 16px;
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border-left: 5px solid var(--warning);
    transition: all 0.3s ease;
}

.kds-card.processing {
    border-left-color: var(--secondary);
}

.kds-card.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

.kds-card .order-time {
    font-size: 0.75rem;
    color: #888;
}

.kds-card .table-number {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ===== POS STYLES ===== */
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.pos-product-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.pos-product-card:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.pos-cart {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pos-cart-footer {
    border-top: 2px solid var(--gray);
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

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