/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Generic Message Container */
.message-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* UploadRoom.com logo + titles */
.site-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.site-branding--upload {
    margin-bottom: 1.75rem;
}

.site-logo {
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.site-title {
    font-size: 2rem;
    color: #667eea;
    font-weight: 700;
}

.message-content .site-title {
    font-size: 2.5rem;
}

.site-brand-text .site-title {
    margin-bottom: 0.35rem;
}

.site-tagline {
    font-size: 1rem;
    color: #666;
}

.site-intro {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
}

/* Upload Interface Container */
.upload-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 800px;
    width: 100%;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #edf2f7;
}

/* Drag-over state - visual feedback when files are dragged over */
.drop-zone.drag-over {
    border-color: #667eea;
    background: #e6f0ff;
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    color: #667eea;
    margin-bottom: 10px;
}

.drop-zone-text {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.drop-zone-subtext {
    font-size: 0.9rem;
    color: #999;
}

.file-select-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

/* File Selection Button */
.file-select-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.file-select-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.file-select-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Progress Container */
.progress-container {
    margin-top: 30px;
    display: none; /* Hidden by default, shown when uploads start */
}

.progress-container.active {
    display: block;
}

.progress-header {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.queue-summary {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    background: #f8fafc;
    margin-bottom: 12px;
}

.queue-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.queue-status-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2d3748;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 4px 10px;
}

.queue-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.queue-stat {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.queue-stat-label {
    display: block;
    color: #718096;
    font-size: 0.75rem;
}

.queue-stat-value {
    display: block;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 700;
}

.queue-overall-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.queue-overall-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.25s ease;
}

.queue-summary-report {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #4a5568;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 45vh;
    overflow: auto;
    padding-right: 2px;
}

/* Individual Progress Item */
.progress-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.progress-item.queued {
    border-color: #cbd5e0;
    background: #f8fafc;
}

.progress-item.uploading {
    border-color: #667eea;
    background: #f0f4ff;
}

.progress-item.success {
    border-color: #48bb78;
    background: #f0fff4;
}

.progress-item.error {
    border-color: #f56565;
    background: #fff5f5;
}

.progress-item.cancelled {
    border-color: #ed8936;
    background: #fffaf0;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.progress-header-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.progress-actions {
    flex-shrink: 0;
}

.cancel-upload-button {
    border: 1px solid #e53e3e;
    background: #fff5f5;
    color: #c53030;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-upload-button:hover {
    background: #fed7d7;
}

.cancel-upload-button:disabled {
    cursor: default;
    opacity: 0.65;
}

.progress-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.progress-chip {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #2d3748;
    background: #edf2f7;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-bar.success {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.progress-bar.error {
    background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%);
}

/* Progress Details */
.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 6px;
    gap: 8px;
}

.progress-percentage {
    font-weight: 600;
    color: #667eea;
}

.progress-info {
    display: flex;
    gap: 15px;
}

.progress-speed,
.progress-time {
    color: #718096;
}

.progress-filename {
    font-weight: 600;
    color: #333;
    font-size: 0.92rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.progress-size {
    font-size: 0.75rem;
    color: #718096;
    white-space: nowrap;
}

/* Status Text */
.status-text {
    font-size: 0.8rem;
    color: #4a5568;
}

.status-success {
    color: #22543d;
    font-weight: 600;
}

.status-error {
    color: #742a2a;
    font-weight: 600;
}

.status-cancelled {
    color: #9c4221;
    font-weight: 600;
}

/* Success Indicator */
.success-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #48bb78;
    font-weight: 600;
    font-size: 0.9rem;
}

.success-indicator::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
}

/* Error Container */
.error-container {
    margin-top: 30px;
    display: none; /* Hidden by default, shown when errors occur */
}

.error-container.active {
    display: block;
}

.error-header {
    font-size: 1.3rem;
    color: #e53e3e;
    margin-bottom: 15px;
    font-weight: 600;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Error Message */
.error-message {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-left: 4px solid #e53e3e;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.error-icon {
    color: #e53e3e;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-file-name {
    font-weight: 600;
    color: #742a2a;
    margin-bottom: 4px;
}

.error-description {
    font-size: 0.9rem;
    color: #c53030;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .message-container,
    .upload-container {
        padding: 30px 20px;
    }

    .message-content .site-title,
    .site-title {
        font-size: 1.8rem;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .progress-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .progress-details {
        flex-direction: column;
        gap: 5px;
    }

    .queue-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .queue-summary-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-list {
        max-height: 50vh;
    }

    .progress-info {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .message-content .site-title,
    .site-title {
        font-size: 1.5rem;
    }

    .drop-zone-text {
        font-size: 1rem;
    }

    .file-select-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}
