/* TalkToMeet Super Admin Dashboard Styles */

:root {
    --bg-dark: #1A1A24;
    --bg-card: #23232f;
    --bg-sidebar: #1e1e28;
    --accent-gold: #DDAF6D;
    --accent-gold-hover: #E6B757;
    --text-main: #F2F2F7;
    --text-muted: #8E8E93;
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
    --blue: #007AFF;
    --purple: #AF52DE;
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Login View */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 30%, #2a2a35 0%, var(--bg-dark) 70%);
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 50px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header .gold {
    color: var(--accent-gold);
}

.badge {
    display: inline-block;
    background: rgba(221, 175, 109, 0.15);
    color: var(--accent-gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge.small {
    padding: 2px 8px;
    font-size: 9px;
}

.login-subtitle {
    color: var(--text-muted);
    margin: 20px 0 30px;
    font-size: 14px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: white;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.login-note {
    margin-top: 25px;
    font-size: 12px;
    color: var(--text-muted);
}

.error-message {
    display: none;
    background: rgba(255, 59, 48, 0.1);
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 20px;
    display: inline;
}

.sidebar-header .gold {
    color: var(--accent-gold);
}

.sidebar-header .badge {
    margin-left: 10px;
    vertical-align: middle;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(221, 175, 109, 0.1);
    color: var(--accent-gold);
}

.nav-item svg {
    flex-shrink: 0;
}

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

.user-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 15px;
    word-break: break-all;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 15px;
    background: rgba(255, 59, 48, 0.1);
    color: var(--error);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 59, 48, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.page-header h1 {
    font-size: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(0, 122, 255, 0.15);
    color: var(--blue);
}

.stat-icon.green {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(175, 82, 222, 0.15);
    color: var(--purple);
}

.stat-icon.gold {
    background: rgba(221, 175, 109, 0.15);
    color: var(--accent-gold);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.stat-highlight {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Montserrat', sans-serif;
}

.mt-4 {
    margin-top: 24px;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 300px;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table.small th,
.data-table.small td {
    padding: 10px 12px;
    font-size: 13px;
}

.loading-cell,
.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.restaurant-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.restaurant-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.restaurant-logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(221, 175, 109, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Status Badges */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--success);
}

.status-dot.paused {
    background: var(--warning);
}

.status-dot.warning {
    background: var(--error);
}

.status-dot.inactive {
    background: var(--text-muted);
}

.badge.plan-free {
    background: rgba(142, 142, 147, 0.15);
    color: var(--text-muted);
}

.badge.plan-basic {
    background: rgba(0, 122, 255, 0.15);
    color: var(--blue);
}

.badge.plan-premium {
    background: rgba(221, 175, 109, 0.15);
    color: var(--accent-gold);
}

.badge.status-active {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.badge.status-ended {
    background: rgba(142, 142, 147, 0.15);
    color: var(--text-muted);
}

.badge.status-pending_extension {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Detail Page */
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--text-muted);
    font-size: 13px;
}

.detail-row span:last-child {
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* Map */
.map-container {
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#locations-map {
    height: 100%;
    width: 100%;
    background: var(--bg-card);
}

.map-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.legend-dot.active {
    background: var(--success);
}

.legend-dot.inactive {
    background: var(--text-muted);
}

/* Map Popup */
.map-popup {
    font-size: 13px;
    line-height: 1.5;
}

.map-popup strong {
    font-size: 14px;
}

.map-popup .popup-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-muted);
    margin: 5px 0;
}

.map-popup .popup-status.active {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success);
}

/* Leaflet overrides for dark theme */
.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: var(--bg-card);
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted);
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast-error {
    border-color: var(--error);
    background: rgba(255, 59, 48, 0.1);
}

.toast-success {
    border-color: var(--success);
    background: rgba(52, 199, 89, 0.1);
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar-nav {
        display: flex;
        padding: 10px;
        overflow-x: auto;
    }
    
    .nav-item {
        white-space: nowrap;
        margin-bottom: 0;
        margin-right: 5px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
