/* Root Variables */
:root {
    --primary-color: #0066cc;
    --secondary-color: #f8f9fa;
    --accent-color: #28a745;
    --danger-color: #dc3545;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 12px;
}

/* Global Styles */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Ad Sections */
.ad-banner-top {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 20px;
}

.ad-banner-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 30px;
}

.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: #adb5bd;
    background: #e9ecef;
}

.ad-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-ad {
    padding: 20px 0;
}

.sidebar-ad .ad-placeholder {
    min-height: 300px;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Logo Styling */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.brand-name {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Upload Section */
.upload-section {
    margin: 40px 0;
}

.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    transform: translateY(-2px);
}

.drop-zone.dragover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 204, 0.1);
    border-radius: var(--border-radius);
}

.drop-zone-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Conversion Settings */
.conversion-settings {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.conversion-settings select {
    cursor: pointer;
    z-index: 11;
}

.conversion-settings:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Mobile-specific drop zone improvements */
@media (max-width: 768px) {
    .drop-zone {
        padding: 2rem 1rem;
        min-height: 200px;
        border-width: 3px;
    }
    
    .drop-zone h4 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .drop-zone p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
        min-height: 48px; /* Better touch target */
    }
    
    .main-content {
        padding: 20px 10px;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .drop-zone {
        border-color: var(--primary-color);
        background: rgba(0, 102, 204, 0.08);
    }
    
    .drop-zone:active {
        transform: scale(0.98);
        background: rgba(0, 102, 204, 0.15);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Mobile upload optimizations */
.mobile-upload {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.mobile-upload.touched {
    background: rgba(0, 102, 204, 0.12);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* File List Styling */
.file-list {
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item.converted {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.file-icon.pdf { background: #dc3545; }
.file-icon.doc { background: #0066cc; }
.file-icon.docx { background: #0066cc; }
.file-icon.rtf { background: #6f42c1; }

/* Animated Conversion Spinner */
.conversion-spinner {
    position: relative;
    display: inline-block;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.spinner-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    z-index: 2;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

/* Conversion Log */
.conversion-log {
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
}

.log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.log-entry.success { color: var(--accent-color); }
.log-entry.error { color: var(--danger-color); }

/* Tooltips */
.tooltip {
    font-size: 0.8rem;
}

/* Batch conversion info */
.batch-info {
    display: flex;
    align-items: center;
}

/* Remove button for file items */
.remove-file {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-file:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* File Info */
.file-info {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
}

/* Info Cards */
.info-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

/* Cards */
.card {
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0052a3 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1e7e34 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-light);
}

/* Footer */
.footer-section {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

.footer-content {
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 10px;
    }
    
    .drop-zone {
        padding: 40px 15px;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .brand-name {
        font-size: 2.5rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .ad-banner-top,
    .ad-banner-footer {
        margin: 10px 0;
    }
    
    .file-info {
        text-align: center;
    }
    
    .file-info .d-flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .drop-zone {
        padding: 30px 10px;
    }
    
    .main-content {
        padding: 15px 5px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .brand-name {
        font-size: 2rem;
    }
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Smooth Transitions */
* {
    transition: all 0.3s ease;
}

/* Hide scrollbar for better mobile experience */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus States for Accessibility */
.btn:focus,
.drop-zone:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation for successful upload */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    animation: slideInUp 0.5s ease;
}

/* Print Styles */
@media print {
    .ad-banner-top,
    .ad-banner-footer,
    .sidebar-ad {
        display: none !important;
    }
}

/* Enhanced Animated Loading Spinner */
.conversion-spinner {
    position: relative;
    display: inline-block;
}

.spinner-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.spinner-logo {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    border: 4px solid rgba(0, 123, 255, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-top: 2px solid #28a745;
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

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

/* Document Preview Thumbnails */
.file-preview {
    width: 60px;
    height: 80px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    position: relative;
    overflow: hidden;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.file-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.file-preview .file-type-icon {
    font-size: 24px;
    color: #6c757d;
}

.file-preview.pdf {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border-color: #dc3545;
}

.file-preview.pdf .file-type-icon {
    color: white;
}

.file-preview.doc, .file-preview.docx {
    background: linear-gradient(145deg, #4285f4, #3367d6);
    border-color: #007bff;
}

.file-preview.doc .file-type-icon, .file-preview.docx .file-type-icon {
    color: white;
}

.file-preview.rtf {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    border-color: #fd7e14;
}

.file-preview.rtf .file-type-icon {
    color: white;
}

.file-preview-text {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: bold;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced File List Item */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #007bff;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.file-item:hover::before {
    transform: scaleY(1);
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.file-item.converted {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.file-item.converted::before {
    background: #28a745;
    transform: scaleY(1);
}

.file-details {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-meta {
    margin-left: 16px;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 16px;
}

.file-size {
    color: #6c757d;
    font-size: 14px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Progress Indicator Enhancements */
.progress {
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #007bff, #28a745);
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Conversion Log */
.conversion-log {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-align: left;
}

.log-entry {
    margin-bottom: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    animation: fadeInLog 0.3s ease;
}

.log-entry.success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 3px solid #28a745;
}

.log-entry.error {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 3px solid #dc3545;
}

.log-entry.info {
    background: rgba(0, 123, 255, 0.1);
    color: #004085;
    border-left: 3px solid #007bff;
}

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

/* Enhanced Conversion Progress Animations */
.progress-container {
    position: relative;
    margin: 20px 0;
}

.progress-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #007bff 0%, #28a745 100%);
    padding: 10px;
    margin: 0 auto 20px;
    position: relative;
    animation: progressGlow 2s ease-in-out infinite alternate;
}

.progress-circle::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #333;
    z-index: 10;
}

@keyframes progressGlow {
    0% { box-shadow: 0 0 20px rgba(0, 123, 255, 0.3); }
    100% { box-shadow: 0 0 30px rgba(40, 167, 69, 0.5), 0 0 40px rgba(0, 123, 255, 0.3); }
}

.conversion-stage {
    text-align: center;
    margin: 20px 0;
}

.stage-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 80px;
}

.stage-step .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.stage-step.active .step-icon {
    background: linear-gradient(135deg, #007bff, #28a745);
    color: white;
    border-color: #fff;
    animation: pulse 1.5s ease-in-out infinite;
}

.stage-step.completed .step-icon {
    background: #28a745;
    color: white;
    transform: scale(1.1);
}

.stage-step .step-label {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

.stage-step.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.stage-step.completed .step-label {
    color: #28a745;
    font-weight: 600;
}

.stage-connector {
    width: 30px;
    height: 2px;
    background: #e9ecef;
    margin: 0 5px;
    margin-top: -25px;
    transition: background 0.3s ease;
}

.stage-connector.completed {
    background: linear-gradient(90deg, #28a745, #007bff);
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* File Processing Animation */
.file-processing {
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.2) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.2) 75%);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Time Estimation Display */
.time-estimate {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
}

.time-estimate .time-value {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.time-estimate .time-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* Success Animation */
.conversion-success {
    animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Individual File Progress */
.file-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

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

/* File Processing States */
.file-item.file-processing {
    background: linear-gradient(45deg, transparent 25%, rgba(0,123,255,0.1) 25%, rgba(0,123,255,0.1) 50%, transparent 50%, transparent 75%, rgba(0,123,255,0.1) 75%);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
    border-left: 4px solid #007bff;
}

.file-item.converted {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    animation: successPulse 0.5s ease-out;
}

.file-item.conversion-failed {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

@keyframes successPulse {
    0% { transform: scale(1); background: rgba(40, 167, 69, 0.3); }
    50% { transform: scale(1.02); background: rgba(40, 167, 69, 0.2); }
    100% { transform: scale(1); background: rgba(40, 167, 69, 0.1); }
}

/* Additional progress enhancement styles */
.progress-circle {
    transition: background 0.5s ease-in-out;
}

.progress-percentage {
    transition: all 0.3s ease;
}

.stage-step {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.file-preview {
    transition: transform 0.3s ease;
}

.file-item:hover .file-preview {
    transform: scale(1.05);
}

/* Ad blocker detection CSS completely removed */
