/* ============================================
   BARBER PAYMENTS - CLEAN WHITE THEME
   App-like mobile experience
   ============================================ */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f5f5f5;
    --mid-gray: #e5e5e5;
    --border: #e0e0e0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #000000;
    --accent-soft: #333333;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
}

/* ============================================
   CLIENT APP - STEP WIZARD
   ============================================ */

.app {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease;
}

.app.loading {
    opacity: 0;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--light-gray);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 12.5%;
    transition: width 0.3s ease;
}

/* Steps */
.step {
    display: none;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 60px 24px 40px;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content {
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: -40px;
    left: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--light-gray);
}

.back-btn:active {
    background: var(--mid-gray);
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Option Buttons (Location, Barber selection) */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 20px 24px;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: left;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-btn:hover {
    border-color: var(--text-secondary);
}

.option-btn:active {
    background: var(--light-gray);
    transform: scale(0.98);
}

.option-btn.selected {
    border-color: var(--accent);
    background: var(--off-white);
}

.option-btn::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.2s;
}

.option-btn.selected::after {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 4px var(--white);
}

/* Big Input */
.input-wrapper {
    margin-bottom: 32px;
}

.big-input {
    width: 100%;
    padding: 20px 0;
    font-size: 1.5rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
    transition: border-color 0.2s;
    border-radius: 0;
}

.big-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.big-input::placeholder {
    color: var(--text-muted);
}

/* Amount Input */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 8px;
}

.amount-input {
    font-size: 3rem;
    font-weight: 700;
}

/* Continue Button */
.continue-btn {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.continue-btn:hover {
    background: var(--accent-soft);
}

.continue-btn:active {
    transform: scale(0.98);
}

.continue-btn:disabled {
    background: var(--mid-gray);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Card Input */
.card-input-wrapper {
    background: var(--off-white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.card-input-wrapper:focus-within {
    border-color: var(--accent);
}

#card-element {
    font-size: 18px;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 16px;
    min-height: 20px;
}

.hold-info {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.hold-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.hold-info p:first-child {
    margin-bottom: 4px;
}

/* Remembered Info Banner */
.remembered-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.remembered-info > span {
    color: var(--text-secondary);
}

.remembered-info #remembered-location,
.remembered-info #remembered-barber {
    color: var(--text-primary);
    font-weight: 500;
}

.remembered-info button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    flex-shrink: 0;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success */
.success-content {
    text-align: center;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
}

.success-icon svg {
    color: var(--success);
}

.success-details {
    background: var(--light-gray);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 32px;
}

.success-details p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.success-details p:last-child {
    margin-bottom: 0;
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

.admin-container header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.admin-container h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Navigation */
.admin-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.nav-btn {
    padding: 12px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.nav-btn:hover:not(.active) {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters select {
    padding: 12px 16px;
    font-size: 0.875rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

.filters select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Clients List */
.clients-list {
    display: grid;
    gap: 12px;
}

.client-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.client-card:hover {
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-lg);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.client-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.client-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 100px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-charged {
    background: #fee2e2;
    color: #991b1b;
}

.client-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    font-size: 0.875rem;
}

.client-detail {
    display: flex;
    gap: 8px;
}

.client-detail-label {
    color: var(--text-muted);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.settings-card.full-width {
    grid-column: 1 / -1;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

/* Form in Settings */
.settings-card .form-section {
    margin-bottom: 20px;
}

.settings-card label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.settings-card input,
.settings-card select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: var(--off-white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.settings-card input:focus,
.settings-card select:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-card input::placeholder {
    color: var(--text-muted);
}

.settings-card .btn-primary {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
}

/* Toggle */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-row label {
    margin-bottom: 0;
    text-transform: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-row:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mid-gray);
    border-radius: 32px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--success);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Barber Management */
.barber-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.barber-tab {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    color: var(--text-muted);
    border: 2px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}

.barber-tab.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.barber-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 44px;
}

.barber-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--light-gray);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
}

.barber-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mid-gray);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.barber-remove:hover {
    background: var(--danger);
    color: white;
}

.add-barber-row {
    display: flex;
    gap: 12px;
}

.add-barber-row input {
    flex: 1;
}

.add-barber-row button {
    width: auto;
    padding: 14px 28px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--mid-gray);
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-right: 40px;
}

.modal-details {
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-actions button {
    flex: 1;
    min-width: 120px;
    padding: 14px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: none;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: var(--accent-soft);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.completed-text {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px 0;
}

/* Loading & Empty */
.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        padding: 16px;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .stat {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .client-details {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters select {
        width: 100%;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* Desktop Admin Only - Hide client form on large screens */
@media (min-width: 769px) {
    .step h1 {
        font-size: 2.5rem;
    }
    
    .step-subtitle {
        font-size: 1.25rem;
    }
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 200;
    animation: slideUp 0.3s ease;
    cursor: pointer;
}

.install-banner.hidden {
    display: none;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.install-icon {
    width: 48px;
    height: 48px;
    background: var(--light-gray);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-icon svg {
    color: var(--accent);
}

.install-text {
    flex: 1;
    line-height: 1.3;
}

.install-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.install-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.install-close {
    width: 36px;
    height: 36px;
    background: var(--light-gray);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.install-close:hover {
    background: var(--mid-gray);
    color: var(--text-primary);
}

/* iOS Install Instructions Modal */
.ios-install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 300;
    animation: fadeIn 0.2s ease;
}

.ios-install-modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.ios-install-modal h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.ios-steps {
    text-align: left;
    margin-bottom: 24px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.ios-step:last-child {
    border-bottom: none;
}

.ios-step-num {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ios-step span {
    flex: 1;
    font-size: 0.95rem;
}

.ios-step svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.ios-got-it {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
