/*
 * Guest Mobile Pro - Professional Mobile-First Design
 * Optimized for touch, performance, and accessibility
 * Version: 2.0
 */

/* ============================================
   CSS VARIABLES - MOBILE OPTIMIZED
   ============================================ */
:root {
    /* Brand Colors - Navy & Gold */
    --gp-primary: #162a42;
    --gp-primary-light: #1e3a5f;
    --gp-primary-dark: #0f1c2d;
    --gp-accent: #b8973d;
    --gp-accent-light: #d4b25a;
    
    /* Semantic Colors */
    --gp-success: #0d7a5e;
    --gp-error: #b91c1c;
    --gp-warning: #b45309;
    --gp-info: #0369a1;
    
    /* Neutral Palette */
    --gp-text: #1a2332;
    --gp-text-secondary: #4a5568;
    --gp-text-muted: #8896a8;
    --gp-border: #e4e8ed;
    --gp-bg: #f7f8fa;
    --gp-surface: #ffffff;
    
    /* Spacing Scale (4px base) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    
    /* Typography Scale */
    --text-xs: 0.75rem;   /* 12px */
    --text-sm: 0.875rem;  /* 14px */
    --text-base: 1rem;    /* 16px - minimum for mobile */
    --text-lg: 1.125rem;  /* 18px */
    --text-xl: 1.25rem;   /* 20px */
    --text-2xl: 1.5rem;   /* 24px */
    --text-3xl: 1.875rem; /* 30px */
    
    /* Shadows - Subtle & Professional */
    --shadow-sm: 0 1px 3px rgba(22, 42, 66, 0.04);
    --shadow-md: 0 4px 16px rgba(22, 42, 66, 0.08);
    --shadow-lg: 0 8px 32px rgba(22, 42, 66, 0.12);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Touch Targets */
    --touch-min: 44px; /* iOS minimum */
    
    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   MOBILE BASE STYLES
   ============================================ */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--gp-text);
    background: var(--gp-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}

/* Arabic Font Support */
[lang="ar"] body,
[lang="ar"] * {
    font-family: 'Cairo', -apple-system, sans-serif;
}

/* Prevent zoom on input focus */
input, textarea, select {
    font-size: 16px !important;
}

/* ============================================
   MOBILE BUTTONS - TOUCH OPTIMIZED
   ============================================ */
.guest-btn,
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch-min);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
    touch-action: manipulation;
    width: 100%;
}

/* Primary Button - Gradient */
.guest-btn-primary,
.gp-btn-primary {
    background: linear-gradient(135deg, var(--gp-primary) 0%, var(--gp-primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.guest-btn-primary:active,
.gp-btn-primary:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.guest-btn-secondary,
.gp-btn-secondary {
    background: white;
    color: var(--gp-primary);
    border: 2px solid var(--gp-primary);
    box-shadow: var(--shadow-sm);
}

.guest-btn-secondary:active,
.gp-btn-secondary:active {
    background: var(--gp-bg);
    transform: scale(0.98);
}

/* Outline Button */
.guest-btn-outline {
    background: transparent;
    color: var(--gp-text);
    border: 1px solid var(--gp-border);
}

/* Icon Button */
.guest-btn-icon {
    width: var(--touch-min);
    height: var(--touch-min);
    padding: 0;
    border-radius: var(--radius-full);
}

/* Button Sizes */
.guest-btn-sm {
    min-height: 36px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.guest-btn-lg {
    min-height: 52px;
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Disabled State */
.guest-btn:disabled,
.gp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   MOBILE CARDS
   ============================================ */
.guest-card,
.gp-card {
    background: var(--gp-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    transition: transform var(--transition-fast);
}

.guest-card:active {
    transform: scale(0.98);
}

.guest-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gp-border);
}

.guest-card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gp-text);
    margin: 0;
}

.guest-card-body {
    color: var(--gp-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.guest-card-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--gp-border);
}

/* ============================================
   MOBILE FORMS - TOUCH FRIENDLY
   ============================================ */
.guest-form-group {
    margin-bottom: var(--space-5);
}

.guest-form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gp-text);
    margin-bottom: var(--space-2);
}

.guest-form-input,
.guest-form-select,
.guest-form-textarea {
    width: 100%;
    min-height: var(--touch-min);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--gp-text);
    background: var(--gp-surface);
    border: 2px solid var(--gp-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
}

.guest-form-input:focus,
.guest-form-select:focus,
.guest-form-textarea:focus {
    outline: none;
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px rgba(22, 42, 66, 0.1);
}

/* Input with Icon */
.guest-input-group {
    position: relative;
}

.guest-input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gp-text-muted);
    pointer-events: none;
    font-size: var(--text-base);
}

.guest-input-group .guest-form-input {
    padding-left: calc(var(--space-4) * 2.5);
}

/* RTL Support */
[dir="rtl"] .guest-input-icon {
    left: auto;
    right: var(--space-4);
}

[dir="rtl"] .guest-input-group .guest-form-input {
    padding-left: var(--space-4);
    padding-right: calc(var(--space-4) * 2.5);
}

/* Error State */
.guest-form-input.error,
.guest-form-select.error {
    border-color: var(--gp-error);
}

.guest-error {
    display: block;
    color: var(--gp-error);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

/* ============================================
   MOBILE HEADER - STICKY
   ============================================ */
.guest-header {
    position: sticky;
    top: 0;
    background: var(--gp-surface);
    border-bottom: 1px solid var(--gp-border);
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + var(--safe-top));
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.guest-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.guest-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-min);
    height: var(--touch-min);
    color: var(--gp-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.guest-header-back:active {
    background: var(--gp-bg);
}

.guest-header-title {
    flex: 1;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--gp-text);
    margin: 0;
}

/* ============================================
   MOBILE LISTS
   ============================================ */
.guest-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--gp-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.guest-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: var(--touch-min);
    padding: var(--space-4);
    border-bottom: 1px solid var(--gp-border);
    transition: background var(--transition-fast);
}

.guest-list-item:active {
    background: var(--gp-bg);
}

.guest-list-item:last-child {
    border-bottom: none;
}

.guest-list-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gp-bg);
    border-radius: var(--radius-md);
    color: var(--gp-primary);
    font-size: var(--text-lg);
}

.guest-list-content {
    flex: 1;
    min-width: 0;
}

.guest-list-title {
    font-weight: 600;
    color: var(--gp-text);
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
}

.guest-list-subtitle {
    font-size: var(--text-sm);
    color: var(--gp-text-secondary);
}

.guest-list-action {
    flex-shrink: 0;
    color: var(--gp-text-muted);
    font-size: var(--text-lg);
}

/* ============================================
   MOBILE BADGES
   ============================================ */
.guest-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.guest-badge-primary {
    background: rgba(22, 42, 66, 0.1);
    color: var(--gp-primary);
}

.guest-badge-success {
    background: rgba(13, 122, 94, 0.1);
    color: var(--gp-success);
}

.guest-badge-warning {
    background: rgba(180, 83, 9, 0.1);
    color: var(--gp-warning);
}

.guest-badge-error {
    background: rgba(185, 28, 28, 0.1);
    color: var(--gp-error);
}

.guest-badge-info {
    background: rgba(3, 105, 161, 0.1);
    color: var(--gp-info);
}

/* ============================================
   MOBILE ALERTS
   ============================================ */
.guest-alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    display: flex;
    gap: var(--space-3);
    border-left: 4px solid;
}

.guest-alert-icon {
    flex-shrink: 0;
    font-size: var(--text-xl);
}

.guest-alert-content {
    flex: 1;
}

.guest-alert-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
}

.guest-alert-success {
    background: rgba(13, 122, 94, 0.1);
    color: var(--gp-success);
    border-color: var(--gp-success);
}

.guest-alert-error {
    background: rgba(185, 28, 28, 0.1);
    color: var(--gp-error);
    border-color: var(--gp-error);
}

.guest-alert-warning {
    background: rgba(180, 83, 9, 0.1);
    color: var(--gp-warning);
    border-color: var(--gp-warning);
}

.guest-alert-info {
    background: rgba(3, 105, 161, 0.1);
    color: var(--gp-info);
    border-color: var(--gp-info);
}

/* ============================================
   MOBILE NAVIGATION - BOTTOM BAR
   ============================================ */
.guest-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gp-surface);
    border-top: 1px solid var(--gp-border);
    box-shadow: 0 -4px 16px rgba(22, 42, 66, 0.08);
    z-index: 1000;
    padding: var(--space-2) 0;
    padding-bottom: calc(var(--space-2) + var(--safe-bottom));
}

.guest-mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.guest-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
    color: var(--gp-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: 60px;
    position: relative;
}

.guest-mobile-nav-item:active {
    transform: scale(0.95);
}

.guest-mobile-nav-item.active {
    color: var(--gp-primary);
}

.guest-mobile-nav-icon {
    font-size: 1.25rem;
}

.guest-mobile-nav-label {
    font-size: var(--text-xs);
    font-weight: 500;
}

.guest-mobile-nav-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--gp-error);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Hide on tablet+ */
@media (min-width: 768px) {
    .guest-mobile-nav {
        display: none;
    }
}

/* ============================================
   MOBILE LOADING STATES
   ============================================ */
.guest-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    gap: var(--space-4);
}

.guest-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gp-border);
    border-top-color: var(--gp-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MOBILE UTILITIES
   ============================================ */
.guest-container {
    width: 100%;
    max-width: 100%;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    margin-left: auto;
    margin-right: auto;
}

.guest-divider {
    height: 1px;
    background: var(--gp-border);
    margin: var(--space-4) 0;
}

/* Spacing Utilities */
.guest-spacer-sm { height: var(--space-2); }
.guest-spacer-md { height: var(--space-4); }
.guest-spacer-lg { height: var(--space-6); }
.guest-spacer-xl { height: var(--space-8); }

/* Text Utilities */
.guest-text-center { text-align: center; }
.guest-text-left { text-align: left; }
.guest-text-right { text-align: right; }

.guest-text-primary { color: var(--gp-text); }
.guest-text-secondary { color: var(--gp-text-secondary); }
.guest-text-muted { color: var(--gp-text-muted); }

.guest-text-xs { font-size: var(--text-xs); }
.guest-text-sm { font-size: var(--text-sm); }
.guest-text-base { font-size: var(--text-base); }
.guest-text-lg { font-size: var(--text-lg); }
.guest-text-xl { font-size: var(--text-xl); }

.guest-font-bold { font-weight: 700; }
.guest-font-semibold { font-weight: 600; }
.guest-font-normal { font-weight: 400; }

/* Safe Area Utilities */
.guest-safe-top { padding-top: var(--safe-top); }
.guest-safe-bottom { padding-bottom: var(--safe-bottom); }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (min-width: 640px) {
    .guest-container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .guest-container {
        max-width: 768px;
    }
    
    .guest-btn,
    .gp-btn {
        width: auto;
    }
}

@media (min-width: 1024px) {
    .guest-container {
        max-width: 1024px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--gp-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .guest-mobile-nav,
    .guest-header-back,
    .guest-btn {
        display: none !important;
    }
}
