/* ==========================================================================
   Antigravity Design System — Kiosk Management Panel Style Sheet
   Aesthetics: Deep Space Dark Mode, Glassmorphism, Neon Accents, Micro-animations
   ========================================================================== */

/* Variables */
:root {
    --bg-base: #0a0b10;
    --bg-surface: #12131e;
    --bg-card: rgba(22, 24, 38, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(0, 168, 255, 0.4);
    
    --text-primary: #f5f6fa;
    --text-secondary: #a0a5c0;
    --text-muted: #6b708d;
    
    --accent-blue: #00a8ff;
    --accent-purple: #9c27b0;
    --accent-purple-light: #ab47bc;
    --accent-green: #4cd137;
    --accent-red: #ff4757;
    --accent-orange: #ffa502;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-neon: 0 0 15px rgba(0, 168, 255, 0.2);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 10% 10%, rgba(156, 39, 176, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(0, 168, 255, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(18, 19, 30, 0.8);
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand-section {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 24px;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.5);
    animation: pulse 3s infinite alternate;
}

.brand-name {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.menu-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 16px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.menu-item-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.menu-item-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.menu-item-link.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.15), rgba(156, 39, 176, 0.05));
    border-left: 3px solid var(--accent-blue);
    box-shadow: var(--shadow-neon);
}

.menu-item-link.active i {
    color: var(--accent-blue);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-display-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 10px;
    color: var(--accent-blue);
    font-weight: 500;
    text-transform: uppercase;
}

.logout-btn {
    color: var(--text-muted);
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-width: 0;
}

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

.header-title-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.header-title-section p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Dashboard Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

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

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon-wrapper.blue {
    background: rgba(0, 168, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 168, 255, 0.2);
}

.stat-icon-wrapper.purple {
    background: rgba(156, 39, 176, 0.1);
    color: var(--accent-purple-light);
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.stat-icon-wrapper.green {
    background: rgba(76, 209, 55, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(76, 209, 55, 0.2);
}

.stat-icon-wrapper.orange {
    background: rgba(255, 165, 2, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 165, 2, 0.2);
}

.stat-data-section {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 4px;
}

/* Premium Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a5c0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 168, 255, 0.45);
    filter: brightness(1.1);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: var(--accent-red);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
    background: #ff5e6c;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.premium-table th {
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    color: var(--text-primary);
    vertical-align: middle;
}

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

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
    color: #fff;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(76, 209, 55, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(76, 209, 55, 0.25);
}

.badge-danger {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 71, 87, 0.25);
}

.badge-warning {
    background: rgba(255, 165, 2, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 165, 2, 0.25);
}

.badge-info {
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 168, 255, 0.25);
}

/* Login Page Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(156, 39, 176, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 168, 255, 0.1) 0%, transparent 40%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 40px;
    color: var(--accent-blue);
    text-shadow: 0 0 15px rgba(0, 168, 255, 0.6);
    margin-bottom: 16px;
    animation: rotate-pulse 4s infinite linear;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes rotate-pulse {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.08);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s infinite linear;
}

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

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: var(--text-secondary);
}

.auth-error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

.error-card {
    text-align: center;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-icon {
    font-size: 48px;
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255, 165, 2, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Cards & Grid for products */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-img-wrapper {
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    position: relative;
}

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

.product-no-img {
    font-size: 40px;
    color: var(--text-muted);
}

.product-price-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(18, 19, 30, 0.85);
    backdrop-filter: blur(5px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    border: 1px solid rgba(0, 168, 255, 0.25);
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.product-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

/* Custom switch for toggling availabilities */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(0, 168, 255, 0.2);
    border-color: var(--accent-blue);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent-blue);
}

/* Toolbar & Filters */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 500px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding-left: 44px;
}

/* Image Upload Widget */
.image-upload-widget {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: var(--transition-fast);
}

.image-upload-widget:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 168, 255, 0.02);
}

.image-upload-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Details Page (Config tabs) */
.tab-headers {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-header-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.tab-header-btn:hover {
    color: var(--text-primary);
}

.tab-header-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}
