* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 10px;
    margin: 0;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1 {
    margin: 0 0 20px 0;
    color: #2196F3;
    text-align: center;
    font-size: 24px;
}

h2 {
    font-size: 18px;
    margin: 20px 0 10px 0;
    color: #333;
}

/* File Input Styling */
.file-input-container {
    margin-bottom: 20px;
}

#fileInput {
    width: 100%;
    padding: 12px;
    border: 2px dashed #2196F3;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 16px;
    cursor: pointer;
}

#fileInput:focus {
    outline: none;
    border-color: #1976D2;
}

/* Button Styling */
#uploadBtn {
    width: 100%;
    padding: 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    touch-action: manipulation;
}

#uploadBtn:hover:not(:disabled) {
    background: #1976D2;
}

#uploadBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Progress Styling */
.progress { 
    width: 100%;
    background: #eee;
    margin: 8px 0;
    border-radius: 6px;
    overflow: hidden;
    height: 24px;
}

.progress-bar { 
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

#progressSection {
    display: none;
    background: linear-gradient(135deg, #909599, #4a5e6e);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid #2196F3;
    color: #ffffff;
}

.progress-text {
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Status indicators */
.connection-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.online {
    background: #d4edda;
    color: #155724;
}

.offline {
    background: #f8d7da;
    color: #721c24;
}

/* Log Styling */
#log {
    background: white;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.log-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.log-item:last-child {
    border-bottom: none;
}

.status {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.speed-indicator {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    background: #2196f31a;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
    color: #d6edff;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
    padding: 5px;
    }
    
    .container {
    padding: 15px;
    border-radius: 8px;
    }
    
    h1 {
    font-size: 20px;
    }
    
    #uploadBtn {
    padding: 14px;
    font-size: 16px;
    }
    
    .progress {
    height: 20px;
    }
    
    .speed-indicator {
    font-size: 11px;
    padding: 2px 4px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
    background: #121212;
    color: white;
    }
    
    .container {
    background: #1e1e1e;
    color: white;
    }
    
    #fileInput {
    background: #2a2a2a;
    color: white;
    border-color: #2196F3;
    }
    
    #log {
    background: #2a2a2a;
    color: white;
    }
    
    .speed-indicator {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
    }
}