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

/* Default Light Mode Variables */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --border-glass: #e2e8f0;
    
    --primary: #00b562;
    --primary-hover: #009e54;
    --primary-glow: rgba(0, 181, 98, 0.2);
    
    --accent: #ec4899;
    --accent-hover: #db2777;
    --accent-glow: rgba(236, 72, 153, 0.2);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --font-sans: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 4px 12px rgba(0,0,0,0.03);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
body.dark-theme {
    --bg-primary: #0a0e17;
    --bg-secondary: #121824;
    --bg-glass: rgba(18, 24, 36, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary-glow: rgba(0, 255, 102, 0.35);
    --accent-glow: rgba(236, 72, 153, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.03) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
body.dark-theme ::-webkit-scrollbar-thumb {
    background: #1f2937;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}
body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #374151;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--primary-hover);
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: var(--font-sans);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow), 0 4px 10px rgba(0, 181, 98, 0.15);
    border: 1px solid rgba(0, 255, 102, 0.15);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.65), 0 6px 14px rgba(0, 181, 98, 0.3);
    border-color: rgba(0, 255, 102, 0.3);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
body.dark-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #db2777);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}

/* Form inputs */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-normal);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder {
    color: var(--text-muted);
}

body.dark-theme .form-control {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.form-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Alert banners */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 400;
    border-left: 4px solid transparent;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-left-color: var(--success);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-left-color: var(--danger);
}

body.dark-theme .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
body.dark-theme .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* App Header & Layout */
.app-header {
    height: 70px;
    border-bottom: 1px solid var(--border-glass);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
body.dark-theme .app-logo {
    background: linear-gradient(135deg, #fff, var(--text-secondary));
}
.app-logo span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.app-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Grid layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Typography styles */
h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Card custom styles */
.card-header {
    border-bottom: 1px solid var(--border-glass);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}
.table th, .table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}
.table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}
body.dark-theme .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badge styles */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-free { background: rgba(107, 114, 128, 0.1); color: var(--text-secondary); }
.badge-basic { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.badge-standard { background: rgba(236, 72, 153, 0.1); color: #db2777; }
.badge-premium { background: rgba(245, 158, 11, 0.1); color: #d97706; }

body.dark-theme .badge-free { background: rgba(107, 114, 128, 0.2); color: var(--text-secondary); }
body.dark-theme .badge-basic { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
body.dark-theme .badge-standard { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
body.dark-theme .badge-premium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.badge-active { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-canceled { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-expired { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge-pending { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }

body.dark-theme .badge-active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
body.dark-theme .badge-canceled { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
body.dark-theme .badge-expired { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
body.dark-theme .badge-pending { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

/* Pricing Slider / Toggle */
.switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.08);
    transition: .4s;
    border-radius: 34px;
}
body.dark-theme .slider {
    background-color: rgba(255, 255, 255, 0.1);
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* ============================================
   RESPONSIVE — TABLET & MOBILE
   ============================================ */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
    .app-header {
        padding: 0 1.25rem;
        height: 60px;
    }
    .app-logo {
        font-size: 1.25rem;
    }
    .app-nav {
        gap: 0.75rem;
    }
    .app-container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }
    .app-logo {
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    .app-nav {
        gap: 0.5rem;
        overflow: hidden;
    }
    /* Hide restaurant name text on mobile — too cramped */
    .app-nav > span {
        display: none;
    }
    /* Shrink logout button */
    .app-nav .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    .app-container {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }
    /* Glass panel padding reduction on mobile */
    .card-body {
        padding: 1rem;
    }
    .card-header {
        padding: 1rem;
    }
    /* Table cell padding */
    .table th, .table td {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
    }
    /* Buttons in tables */
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }
}

/* Landing page hero responsive */
@media (max-width: 768px) {
    /* Landing h1 scale-down */
    h1[style*="3.25rem"] {
        font-size: 2.25rem !important;
        letter-spacing: -0.5px !important;
    }
}
@media (max-width: 480px) {
    h1[style*="3.25rem"] {
        font-size: 1.9rem !important;
    }
    /* Pricing grid stacks neatly */
    [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }
}

/* Helper rules to ensure inline padding and margin styles scale down on mobile viewports */
@media (max-width: 576px) {
    .glass-panel[style*="padding: 3rem"], 
    .glass-panel[style*="padding: 2.5rem"],
    div[style*="padding: 3rem"],
    div[style*="padding: 2.5rem"],
    div[style*="padding: 4rem"] {
        padding: 1.5rem 1rem !important;
    }
    div[style*="margin: 4rem"] {
        margin: 1.5rem auto !important;
    }
    div[style*="margin: 5rem"] {
        margin: 2rem auto !important;
    }
}

/* Modal Popups styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeInModal 0.25s ease;
}
.modal-content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-xl) !important;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleInModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

