/* Mosquée de Puteaux - Administration Mobile-First Theme */
:root {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #374151;
    --border-color: rgba(255, 255, 255, 0.12);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #10b981;
    --primary-hover: #059669;
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;

    --status-online: #10b981;
    --status-offline: #ef4444;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    padding-bottom: 80px;
    line-height: 1.5;
}

/* Header */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-logo {
    width: 36px;
    height: 36px;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.header-subtitle {
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card);
    color: #ffffff;
}

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

/* Sections */
.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin: 24px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Global Controls Grid (Section 35 & 36) */
.global-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 400px) {
    .global-grid {
        grid-template-columns: 1fr;
    }
}

.btn-mode {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 14px;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-mode svg {
    width: 32px;
    height: 32px;
}

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

/* Active Mode Styling */
.btn-mode.active-global {
    border-color: var(--gold);
    background: linear-gradient(145deg, #1f2937 0%, #2e2613 100%);
    box-shadow: 0 0 16px var(--gold-glow);
}

.btn-mode.active-global svg {
    color: var(--gold);
}

.btn-mode-khotba {
    color: #34d399;
}
.btn-mode-khotba.active-global {
    border-color: #10b981;
    background: linear-gradient(145deg, #1f2937 0%, #064e3b 100%);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.btn-mode-black {
    color: #94a3b8;
}

/* Screen Cards (Section 35 & 37) */
.screens-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.screen-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.screen-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.screen-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.screen-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
}

.status-dot.offline {
    background-color: var(--status-offline);
}

.screen-mode-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.screen-mode-badge.override {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-manage {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-manage:hover {
    background-color: #374151;
    border-color: var(--gold);
}

/* Tabs & Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 12px;
    z-index: 100;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.nav-tab.active {
    color: var(--gold);
}

.nav-tab svg {
    width: 22px;
    height: 22px;
}

/* Form inputs */
.form-group {
    margin-bottom: 18px;
}

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

.form-input, .form-select {
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
    border-color: var(--gold);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.modal-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-confirm {
    flex: 1;
    background: var(--gold);
    border: none;
    color: #000000;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Override Drawer */
.override-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0 20px 0;
}

.btn-override-choice {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #ffffff;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-override-choice.selected {
    border-color: var(--gold);
    background: #2e2613;
    color: var(--gold);
}

.btn-reset-global {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: #38bdf8;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
