/* Bylands Driver Check-In - Mobile-first styles */

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1a237e;
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* Language Selector */
.lang-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 28px;
    padding: 6px 10px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1;
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.6);
}

.lang-btn:active {
    transform: scale(0.92);
}

.flag-img {
    width: 32px;
    height: 32px;
    display: block;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
}

.header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.85;
    letter-spacing: 1px;
}

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

.view.active {
    display: block;
}

/* Card */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Form */
.input-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-align: center;
}

.freight-input {
    display: block;
    width: 100%;
    padding: 18px 16px;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Segoe UI', monospace;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}

.freight-input:focus {
    border-color: #1a237e;
}

.freight-input::placeholder {
    color: #ccc;
    font-weight: 400;
}

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    background: #1a237e;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: #283593;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1a237e;
    background: #e8eaf6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #c5cae9;
}

/* Success View */
.success-card {
    text-align: center;
    border-top: 6px solid #4CAF50;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    line-height: 1;
}

.success-icon img {
    width: 60px;
    height: 60px;
    display: block;
}

.bay-display {
    margin: 20px 0;
}

.bay-label {
    display: block;
    font-size: 16px;
    color: #666;
    margin-bottom: 4px;
}

.bay-number {
    display: block;
    font-size: 72px;
    font-weight: 800;
    color: #1a237e;
    line-height: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 15px;
}

.detail-label {
    color: #999;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
}

.already-msg {
    margin-top: 16px;
    padding: 10px;
    background: #fff3e0;
    border-radius: 8px;
    color: #e65100;
    font-size: 14px;
    font-weight: 500;
}

/* Paperwork Notification */
.paperwork-notice {
    margin-top: 20px;
    padding: 20px;
    background: #ff9800;
    border-radius: 12px;
    text-align: center;
    animation: pulseNotice 1.5s ease-in-out infinite;
}

.paperwork-notice.completed {
    background: #4CAF50;
    animation: none;
}

.paperwork-notice.cancelled {
    background: #d32f2f;
    animation: pulseCancelled 1s ease-in-out infinite;
}

@keyframes pulseCancelled {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 0 25px rgba(211, 47, 47, 0.6); }
}

.notice-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

/* Twemoji image sizing */
.emoji-notice {
    width: 36px;
    height: 36px;
    display: inline-block;
    vertical-align: middle;
}

.emoji-xs {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

.notice-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

@keyframes pulseNotice {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 152, 0, 0.5); }
}

/* Pending Bay Assignment Notice */
.paperwork-notice.pending-bay {
    background: #ff9800;
    animation: pendingBayPulse 2s ease-in-out infinite;
}

@keyframes pendingBayPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 152, 0, 0); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 152, 0, 0.5); }
}

/* Bay Move Notification */
.bay-move-notice {
    margin-top: 16px;
    padding: 16px;
    background: #d32f2f;
    border: 3px solid #ff1744;
    border-radius: 12px;
    text-align: center;
    animation: bayMoveFlash 0.5s ease-in-out 6;
}

.bay-move-notice .notice-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes bayMoveFlash {
    0%, 100% { background: #d32f2f; box-shadow: 0 0 0 rgba(255, 23, 68, 0); }
    50% { background: #ff1744; box-shadow: 0 0 24px rgba(255, 23, 68, 0.7); }
}

.bay-number.bay-moved {
    animation: bayNumberPulse 0.5s ease-in-out 5;
}

@keyframes bayNumberPulse {
    0%, 100% { transform: scale(1); color: #1a237e; }
    50% { transform: scale(1.15); color: #d32f2f; }
}

/* Error View */
.error-card {
    text-align: center;
    border-top: 6px solid #f44336;
}

.error-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    line-height: 1;
}

.error-icon img {
    width: 60px;
    height: 60px;
    display: block;
}

.error-message {
    font-size: 16px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* Loading */
.spinner {
    width: 48px;
    height: 48px;
    margin: 40px auto 20px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* Connection Lost Banner */
.connection-lost {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #d32f2f;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    animation: connectionPulse 2s ease-in-out infinite;
}

.connection-lost-icon {
    font-size: 18px;
}

@keyframes connectionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enable Notifications Button */
.btn-notify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: #43a047;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    animation: notifyPulse 2s ease-in-out infinite;
}

.btn-notify .flag-img {
    width: 22px;
    height: 22px;
}

.btn-notify:disabled {
    animation: none;
    opacity: 0.8;
    cursor: default;
}

@keyframes notifyPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 12px 4px rgba(67, 160, 71, 0.3); }
}
