/* Enhanced Progress Tracking UI for Offline Mode */

/* Download Links Styling */
.download-links {
    margin: 10px 0;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 4px;
    font-size: 13px;
}

.download-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.download-links a:hover {
    text-decoration: underline;
}

.session-import-note {
    margin-top: 12px;
    padding: 8px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    font-size: 13px;
    color: #78350f;
    border-radius: 4px;
}

/* Download Progress Card */
.download-progress-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-progress-card h3 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 18px;
}

/* Overall Progress Bar */
.overall-progress {
    margin-bottom: 24px;
}

.overall-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b7280;
}

.overall-progress-bar {
    width: 100%;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Individual Component Progress */
.component-progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.component-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #d1d5db;
    transition: all 0.3s ease;
}

.component-progress-item.downloading {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.component-progress-item.completed {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.component-progress-item.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.component-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-info {
    flex: 1;
}

.component-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.component-status {
    font-size: 12px;
    color: #6b7280;
}

.component-progress-bar {
    width: 120px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.component-progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.component-progress-item.completed .component-progress-fill {
    background: #10b981;
}

.component-progress-item.error .component-progress-fill {
    background: #ef4444;
}

.component-size {
    font-size: 12px;
    color: #9ca3af;
    min-width: 60px;
    text-align: right;
}

/* Storage Usage Indicator */
.storage-usage-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.storage-usage-title {
    font-weight: 600;
    color: #1f2937;
}

.storage-usage-value {
    font-size: 14px;
    color: #6b7280;
}

.storage-usage-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.storage-usage-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.storage-usage-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.storage-usage-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.storage-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 13px;
}

.storage-item-label {
    color: #6b7280;
}

.storage-item-value {
    color: #1f2937;
    font-weight: 600;
}

/* Model Loading Status */
.model-status-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.model-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.model-status-icon {
    font-size: 32px;
}

.model-status-info h3 {
    margin: 0 0 4px 0;
    color: #1f2937;
}

.model-status-state {
    font-size: 14px;
    color: #6b7280;
}

.model-status-state.loading {
    color: #3b82f6;
}

.model-status-state.ready {
    color: #10b981;
}

.model-status-state.error {
    color: #ef4444;
}

.model-status-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.model-detail-item {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.model-detail-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.model-detail-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error Messages */
.status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-message.success {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.status-message.error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.status-message.warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.status-message.info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .component-progress-item {
        flex-wrap: wrap;
    }
    
    .component-progress-bar {
        width: 100%;
        margin-top: 8px;
    }
    
    .storage-usage-breakdown {
        grid-template-columns: 1fr;
    }
    
    .model-status-details {
        grid-template-columns: 1fr;
    }
}


/* Storage Warning Banner */
.storage-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.storage-warning .warning-icon {
    font-size: 24px;
}

.storage-warning .warning-text {
    flex: 1;
    color: #92400e;
    font-weight: 500;
}

/* BYO Recommended Badge */
.option-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(16, 185, 129, 0.5);
    }
}

.option-card {
    position: relative;
}

/* Mobile-specific option card styling */
.option-card[data-package="mobile"] {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.option-card[data-package="mobile"].recommended {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

/* Storage indicator on option cards */
.option-storage-warning {
    display: none;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 4px;
    font-size: 12px;
    color: #92400e;
}

.option-card.insufficient-storage .option-storage-warning {
    display: block;
}

.option-card.insufficient-storage {
    opacity: 0.7;
    border-color: #f59e0b;
}

/* Mobile-first responsive adjustments */
@media (max-width: 768px) {
    .storage-warning {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .option-badge {
        position: static;
        display: inline-block;
        margin-bottom: 8px;
    }
    
    .download-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .option-card {
        width: 100%;
    }
}
