/* ============================================================================
   ARRIVAL.CSS - Only loaded on /arrival/* pages
   ============================================================================ */

body {
    padding-bottom: 90px;
}

/* Layout */
.arrival-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.arrival-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px 15px;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Progress Navigation */
.progress-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.progress-step.complete .step-number {
    background: #52c41a;
    color: white;
}

.step-check {
    position: absolute;
    top: 0;
    right: -5px;
    background: #52c41a;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.step-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.progress-step.active .step-label {
    color: #667eea;
}

.progress-line {
    width: 50px;
    height: 3px;
    background: #e0e0e0;
    margin: 0 8px;
    transition: all 0.3s;
}

.progress-line.complete {
    background: #52c41a;
}

/* Bottom Nav for Arrival */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    transform: translateZ(0);
    will-change: transform;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    text-decoration: none;
    color: #666;
    transition: all 0.2s;
    border-radius: 10px;
    min-width: 60px;
    position: relative;
    min-height: 55px;
    justify-content: center;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #e0e0e0;
    color: #666;
    padding: 2px 5px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-item.active .nav-badge {
    background: #667eea;
    color: white;
}

.nav-item.completed .nav-badge {
    background: #52c41a;
    color: white;
}

/* Upload & Preview */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 15px;
    padding: 20px 15px;
    margin-bottom: 15px;
}

.preview-image,
.result-image {
    max-width: 100%;
    max-height: 40vh;
    border-radius: 10px;
    margin: 15px auto;
    cursor: pointer;
    object-fit: contain;
    display: block;
}

/* Stats Container */
.stats-container {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 18px;
    margin: 15px 0;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
}

.stat-label {
    min-width: 90px;
    font-weight: 600;
    font-size: 13px;
}

.stat-bar {
    flex: 1;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 0 8px;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.8s ease;
}

.stat-value {
    min-width: 30px;
    font-weight: bold;
    text-align: right;
    font-size: 13px;
}

.stat-total {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Discovery & Balance Panels */
.discovery-box,
.balance-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.balance-panel {
    padding: 20px;
}

.discovery-label,
.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.discovery-amount {
    font-size: 48px;
    font-weight: 700;
    margin: 20px 0;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
}

.discovery-message {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
}

.discovery-link,
.balance-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.2s;
    font-weight: 600;
}

.discovery-link:hover,
.balance-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.balance-link {
    padding: 8px 16px;
    font-size: 11px;
}

/* Commander Grid (for arrival/commander.html) */
.commander-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
}

.commander-card {
    background: white;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.commander-card:hover {
    transform: translateY(-4px);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.commander-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 6px;
}

.commander-card-name {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    word-break: break-word;
}

/* Story Panel */
.story-panel {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.story-text {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

/* Video Container */
.video-container {
    width: 100%;
    margin: 15px 0;
    border-radius: 15px;
    overflow: hidden;
}

.character-video {
    width: 100%;
    height: auto;
}

/* Progress Panel */
.progress-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.progress-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.progress-timer {
    font-size: 32px;
    font-weight: 700;
    font-family: monospace;
}

.progress-message {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 8px;
}

/* Auth Prompt */
.auth-prompt {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 13px;
    color: #666;
}

.auth-prompt a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Responsive */
@media (min-width: 480px) {
    .arrival-content {
        padding: 30px;
    }

    .commander-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .commander-card-name {
        font-size: 11px;
    }

    .step-label {
        font-size: 11px;
    }

    .progress-line {
        width: 50px;
    }
}

@media (min-width: 768px) {
    .commander-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .commander-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .step-label {
        font-size: 10px;
    }

    .progress-line {
        width: 30px;
    }
}