/* The Date Room - Driver App Styles */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&display=swap');

/* Brand Colors */
:root {
    --primary-dark: #3c3c3b;
    --primary-gold: #85754e;
    --accent-bronze: #a08968;
    --bg-light: #faf8f5;
    --bg-white: #ffffff;
    --text-primary: #3c3c3b;
    --text-secondary: #6b6b6a;
    --success: #52a373;
    --warning: #d4a574;
    --danger: #d45774;
    --shadow: 0 2px 8px rgba(60, 60, 59, 0.08);
    --shadow-lg: 0 4px 16px rgba(60, 60, 59, 0.12);
}

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

body {
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Offline indicator */
body.offline::before {
    content: 'Offline Mode';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning);
    color: white;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    z-index: 9999;
}

/* App Container */
.app-container {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo img {
    height: 32px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gps-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: all 0.3s ease;
}

.gps-indicator.active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(82, 163, 115, 0.3);
}

.refresh-icon {
    font-size: 20px;
    color: var(--primary-gold);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

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

/* Tab Navigation */
.tab-nav {
    background: var(--bg-white);
    display: flex;
    border-bottom: 1px solid rgba(60, 60, 59, 0.1);
    position: sticky;
    top: 56px;
    z-index: 90;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

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

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gold);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

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

/* Delivery Cards */
.delivery-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.delivery-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.delivery-card:active {
    transform: scale(0.98);
}

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

.delivery-number {
    font-weight: 600;
    color: var(--primary-dark);
}

.delivery-time {
    font-size: 14px;
    color: var(--primary-gold);
}

.customer-info,
.address-info,
.phone-info {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.customer-info i,
.address-info i,
.phone-info i {
    color: var(--primary-gold);
    width: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.phone-info a {
    color: var(--primary-gold);
    text-decoration: none;
}

/* Delivery Actions */
.delivery-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    -webkit-appearance: none;
}

.btn-primary {
    background: var(--primary-gold);
    color: white;
    flex: 1;
}

.btn-primary:active {
    background: var(--accent-bronze);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    flex: 1;
}

.btn-success {
    background: var(--success);
    color: white;
    flex: 1;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.delivered {
    background: rgba(82, 163, 115, 0.1);
    color: var(--success);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    color: var(--primary-gold);
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(60, 60, 59, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

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

.modal-body {
    padding: 20px;
}

/* Camera Container */
.camera-container {
    position: relative;
    background: black;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

#camera-preview {
    width: 100%;
    display: block;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
}

.capture-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--primary-gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.capture-btn:active {
    transform: scale(0.9);
}

/* Photo Result */
.photo-result {
    display: none;
    margin-bottom: 16px;
}

#captured-photo {
    width: 100%;
    border-radius: 8px;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(60, 60, 59, 0.2);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(133, 117, 78, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Modal Footer */
.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(60, 60, 59, 0.1);
    display: flex;
    gap: 12px;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: -100px;
    left: 16px;
    right: 16px;
    background: var(--primary-dark);
    color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 2000;
    text-align: center;
}

.notification.show {
    bottom: 24px;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

.notification.warning {
    background: var(--warning);
}

/* Profile Tab */
.profile-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gold);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 16px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.profile-role {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-gold);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Canvas (hidden) */
#photo-canvas {
    display: none;
}

/* Responsive adjustments */
@media (max-height: 600px) {
    .app-header {
        padding: 8px 16px;
    }
    
    .tab-nav {
        top: 48px;
    }
    
    .tab-button {
        padding: 10px 16px;
    }
}