﻿/* ============================================
   POS BILLIARD - MAIN STYLESHEET
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.auth-box {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: #1e3c72;
    font-size: 32px;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30,60,114,0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #1e3c72;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #15284f;
    transform: translateY(-2px);
}

.btn-success {
    background: #22c55e;
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-info {
    background: #3b82f6;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #1e3c72;
    border: 2px solid #1e3c72;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: #1e3c72;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

/* Dashboard */
.dashboard {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
}

.dashboard-header {
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.panel-title {
    font-size: 20px;
    color: #1e3c72;
    font-weight: bold;
}

/* Table Cards */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.table-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.table-card.active {
    border: 3px solid #22c55e;
    background: linear-gradient(to bottom, #f0fdf4, #fff);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-title {
    font-size: 20px;
    font-weight: bold;
    color: #1e3c72;
}

/* Status Badge */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-available {
    background: #dcfce7;
    color: #16a34a;
}

.status-occupied {
    background: #fee2e2;
    color: #dc2626;
}

.status-reserved {
    background: #fef3c7;
    color: #d97706;
}

/* Timer Display */
.timer-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.timer-display {
    font-size: 36px;
    font-weight: bold;
    color: #1e3c72;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
}

.timer-cost {
    font-size: 20px;
    font-weight: bold;
    color: #16a34a;
}

/* Light Indicator */
.light-indicator {
    text-align: center;
    margin: 20px 0;
    font-size: 72px;
    transition: all 0.3s;
}

.light-indicator.off {
    opacity: 0.3;
    filter: grayscale(100%);
}

/* Control Buttons */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.controls .btn {
    flex: 1;
}

/* Timer Select */
.timer-select {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.timer-option {
    flex: 1;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.timer-option:hover {
    border-color: #1e3c72;
}

.timer-option.selected {
    background: #1e3c72;
    color: #fff;
    border-color: #1e3c72;
}

/* F&B Section */
.fnb-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.fnb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fnb-title {
    font-weight: bold;
    color: #1e3c72;
}

.fnb-total {
    font-size: 18px;
    font-weight: bold;
    color: #16a34a;
}

.fnb-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.fnb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    color: #1e3c72;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.menu-item {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-item:hover {
    border-color: #1e3c72;
    transform: translateY(-3px);
}

.menu-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.menu-item-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.menu-item-price {
    font-weight: bold;
    color: #1e3c72;
}

/* Summary */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
    color: #1e3c72;
}

.summary-value.highlight {
    color: #16a34a;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
}

.alert-info {
    background: #dbeafe;
    color: #2563eb;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-display {
        font-size: 28px;
    }
}

/* Connection Status */
.connection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
}

.status-indicator.connected {
    background: #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #1e3c72;
}

.user-role {
    font-size: 12px;
    color: #666;
}

/* Settings Panel */
.settings-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-label {
    min-width: 120px;
    color: #666;
}

.setting-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}
