/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content */
main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

/* Upload section */
.upload-section {
    margin-bottom: 30px;
}

/* Target URLs section */
.target-urls-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.target-urls-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

#targetUrls {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

#targetUrls:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-count {
    margin-top: 10px;
    text-align: left;
    color: #667eea;
    font-weight: bold;
    font-size: 0.9rem;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 20px;
    border: 3px dashed #ddd;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-text {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.file-hint {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.upload-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status section */
.status-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border-right: 4px solid #667eea;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-header h3 {
    color: #333;
}

.job-id {
    font-family: monospace;
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Progress bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    text-align: center;
    color: #666;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Notification toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-weight: bold;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    text-align: center;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast::before {
    content: '🎉';
    margin-left: 8px;
    font-size: 1.2em;
}

/* Enhanced status details */
.status-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.status-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.status-item .label {
    font-weight: bold;
    color: #333;
}

.status-item .value {
    color: #667eea;
    font-weight: bold;
}

/* Progress history chart */
.progress-history {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-history h4 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.progress-chart {
    height: 60px;
    background: #f8f9ff;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

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

.progress-chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Speed indicator */
.speed-indicator {
    display: inline-block;
    background: #e8f5e8;
    color: #28a745;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

/* ETA indicator */
.eta-indicator {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

/* Enhanced progress bar with glow effect */
.progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    border-radius: 6px;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress milestones */
.progress-milestones {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
}

.milestone {
    position: relative;
    text-align: center;
}

.milestone::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #e9ecef;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.milestone.active::before {
    background: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.milestone.completed::before {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

/* Result section */
.result-section {
    text-align: center;
    padding: 30px;
    background: #d4edda;
    border-radius: 10px;
    border: 1px solid #c3e6cb;
}

.success-message h3 {
    color: #155724;
    margin-bottom: 10px;
}

.success-message p {
    color: #155724;
    margin-bottom: 20px;
}

.download-section {
    margin-bottom: 30px;
}

.download-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.output-info {
    text-align: right;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #c3e6cb;
}

.output-info h4 {
    color: #155724;
    margin-bottom: 15px;
}

.output-info ul {
    list-style: none;
    padding: 0;
}

.output-info li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    color: #333;
}

.output-info li:last-child {
    border-bottom: none;
}

.output-info strong {
    color: #667eea;
}

.example {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    text-align: right;
    line-height: 1.6;
}

.example strong {
    color: #667eea;
}

/* Error section */
.error-section {
    text-align: center;
    padding: 30px;
    background: #f8d7da;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
}

.error-message h3 {
    color: #721c24;
    margin-bottom: 10px;
}

.error-message p {
    color: #721c24;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    main {
        padding: 20px;
    }
    
    .status-details {
        grid-template-columns: 1fr;
    }
    
    .status-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .target-urls-section {
        padding: 15px;
    }
    
    #targetUrls {
        min-height: 60px;
    }
}
