/* style.css - Odah Kerondokan Design System & Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #06070b;
    --bg-card: rgba(20, 22, 37, 0.6);
    --bg-card-hover: rgba(30, 33, 54, 0.8);
    --border-card: rgba(255, 255, 255, 0.06);
    --border-card-active: rgba(139, 92, 246, 0.4);
    
    --color-primary: #8b5cf6;
    --color-primary-dark: #6d28d9;
    --color-secondary: #ec4899;
    --color-accent: #f59e0b;
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    --glass-blur: 16px;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Scrollbar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes alertGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Core Layouts & Components */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: rgba(6, 7, 11, 0.7);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-card);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

header .logo-area .logo-badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

header .logo-area h1 {
    font-size: 20px;
    background: linear-gradient(135deg, #f9fafb, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.role-owner { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.role-kasir { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.role-dapur { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Glass Cards */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-card);
    border-radius: 18px;
    box-shadow: var(--shadow-main);
    transition: var(--transition-normal);
}

.card-glass:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Form inputs & buttons */
.input-glass {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: var(--transition-fast);
}

.input-glass:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-premium {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-premium:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 7, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-card);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Grid & Cards (POS & Dashboard) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-details h3 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-details p {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

/* Lists and Tables */
.table-container {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border-card);
}

table.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.premium-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 16px;
    border-bottom: 1px solid var(--border-card);
}

table.premium-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-card);
    font-size: 14px;
    color: var(--text-main);
}

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

table.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 12px !important;
    }
    .cart-section {
        min-width: 280px !important;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
    .kitchen-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 16px !important;
        padding: 16px !important;
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    header {
        padding: 10px 12px;
    }
    header .logo-area h1 {
        font-size: 16px;
    }
    header .logo-area .logo-badge {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .user-info .username {
        display: none;
    }
    .theme-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
    .dashboard-grid {
        padding: 12px;
        gap: 12px;
    }
    .stat-card {
        padding: 16px !important;
        gap: 14px !important;
    }
    .stat-details p {
        font-size: 22px !important;
    }
    .card-glass {
        border-radius: 14px;
    }
    .modal-box {
        max-width: 100% !important;
        margin: 0 8px;
    }
    .modal-body {
        padding: 16px !important;
    }
    .modal-header {
        padding: 16px !important;
    }
    .modal-footer {
        padding: 12px 16px !important;
    }
    .owner-layout {
        padding: 12px !important;
    }
    .owner-nav-tabs {
        gap: 6px !important;
    }
    .tab-btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .owner-form-panel {
        padding: 16px !important;
    }
    .report-filters {
        flex-direction: column;
        align-items: stretch !important;
    }
    .table-container {
        font-size: 13px;
    }
    table.premium-table th,
    table.premium-table td {
        padding: 10px !important;
    }
    .login-card {
        padding: 28px 20px !important;
    }
    .login-logo {
        width: 50px !important;
        height: 50px !important;
        font-size: 22px !important;
    }
    .login-header h2 {
        font-size: 20px !important;
    }
}

/* Responsive: Small Mobile */
@media (max-width: 480px) {
    header .user-info {
        gap: 8px;
    }
    .role-tag {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .product-card .product-name {
        font-size: 13px !important;
    }
    .product-card .product-price {
        font-size: 12px !important;
    }
    .product-img-wrapper {
        height: 100px !important;
    }
    .kitchen-grid {
        grid-template-columns: 1fr !important;
    }
    .order-card .order-meta h3 {
        font-size: 15px !important;
    }
    .item-qty {
        width: 24px !important;
        height: 24px !important;
        font-size: 13px !important;
    }
    .empty-state {
        padding: 40px 16px !important;
    }
    .cash-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    .cash-btn {
        padding: 10px 6px !important;
        font-size: 11px !important;
    }
    .cart-items-wrapper {
        padding: 12px !important;
    }
    .cart-header {
        padding: 14px !important;
    }
    .cart-footer {
        padding: 14px !important;
    }
    .customer-inputs {
        flex-direction: column;
        gap: 8px !important;
    }
    .customer-inputs input {
        width: 100% !important;
    }
    .cart-actions {
        flex-direction: column;
    }
    .cart-actions button {
        width: 100%;
    }
    .btn-premium {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    .qty-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .filter-bar {
        flex-direction: column;
        gap: 8px !important;
    }
    .search-box-wrapper {
        min-width: 100% !important;
    }
    .category-pills {
        padding-bottom: 8px;
    }
    .pill {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
    .stat-card .stat-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    .owner-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ===== LIGHT MODE ===== */
.light-mode {
    --bg-main: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-card: rgba(0, 0, 0, 0.08);
    --border-card-active: rgba(139, 92, 246, 0.3);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

.light-mode body {
    background-image:
        radial-gradient(at 10% 10%, rgba(139, 92, 246, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
}

.light-mode header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.light-mode header .logo-area h1 {
    background: linear-gradient(135deg, #1f2937, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.light-mode ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.light-mode .input-glass {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1f2937;
}

.light-mode .input-glass:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
}

.light-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.light-mode .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

.light-mode .btn-danger {
    color: #dc2626;
}

.light-mode .modal-overlay {
    background: rgba(255, 255, 255, 0.9);
}

.light-mode .stat-icon {
    background: rgba(139, 92, 246, 0.1);
}

.light-mode table.premium-table th {
    background: rgba(0, 0, 0, 0.02);
    color: #6b7280;
}

.light-mode table.premium-table td {
    color: #1f2937;
}

.light-mode table.premium-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.light-mode .card-glass:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.light-mode .cart-section {
    background: rgba(255, 255, 255, 0.6);
}

.light-mode .cart-footer {
    background: rgba(255, 255, 255, 0.9);
}

.light-mode .pill {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #6b7280;
}

.light-mode .qty-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.light-mode .qty-btn:hover {
    background: var(--color-primary);
    color: white;
}

.light-mode .cash-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.light-mode .cash-btn:hover {
    color: white;
}

.light-mode .item-note-input {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
    color: #1f2937;
}

.light-mode .item-note-input:focus {
    border-color: var(--color-primary);
    background: rgba(0, 0, 0, 0.03);
}

.light-mode .order-header {
    background: rgba(0, 0, 0, 0.02);
}

.light-mode .item-row {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

.light-mode .order-footer {
    background: rgba(0, 0, 0, 0.01);
}

.light-mode .tab-btn {
    color: #6b7280;
}

.light-mode .tab-btn.active {
    color: var(--color-primary);
}

.light-mode .progress-bar-container {
    background: rgba(0, 0, 0, 0.06);
}

.light-mode select.input-glass {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.light-mode .empty-cart svg {
    stroke: rgba(0, 0, 0, 0.06);
}

.light-mode .empty-state svg {
    stroke: rgba(0, 0, 0, 0.06);
}

.light-mode .empty-state h3 {
    color: #1f2937;
}

.light-mode .audio-test {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #6b7280;
}

.light-mode .audio-test:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.06);
}

.light-mode .login-header h2 {
    background: linear-gradient(135deg, #1f2937, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.light-mode .credits {
    color: rgba(0, 0, 0, 0.3);
}

.light-mode .alert-success {
    color: #065f46;
}

.light-mode .alert-error {
    color: #991b1b;
}

.light-mode .role-owner { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.light-mode .role-kasir { background: rgba(236, 72, 153, 0.1); color: #be185d; }
.light-mode .role-dapur { background: rgba(245, 158, 11, 0.1); color: #b45309; }

.light-mode .receipt-pop-overlay {
    background: rgba(255, 255, 255, 0.9);
}

.light-mode #receipt-modal {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.light-mode .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Login page theme toggle */
.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}
