
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --text-color: #555;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    margin: 0;
}

header {
    width: 100%;
    padding: 15px 0;
    text-align: center;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

#logo {
    max-height: 50px;
}

main {
    padding: 40px 20px;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto 40px auto;
}

.feature-group {
    margin-bottom: 40px;
}

.feature-group h2 {
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.feature-group.hidden {
    display: none;
}

.toggle-features-container {
    text-align: center;
    margin-top: 20px;
}

#toggle-features-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#toggle-features-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.feature-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover, .feature-card.active {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.feature-card > * {
    position: relative;
    z-index: 2;
}

.feature-card i {
    color: var(--primary-color);
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin: 0 0 10px 0;
    color: var(--dark-gray);
}

.feature-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.upload-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.upload-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.options {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.upload-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.file-queue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.file-card-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative; /* This is the key fix */
}

.file-thumbnail {
    height: 160px;
    width: 100%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 10px;
    word-break: break-all;
    flex-grow: 1;
}

.status-container {
    margin-top: auto;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-download-item {
    display: inline-block;
    width: 100%;
    padding: 10px;
    background-color: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-download-item:hover {
    background-color: #218838;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
}

.remove-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.progress-bar {
    width: 80%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.2s;
}

.processing-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.download-all-container {
    margin-top: 30px;
    text-align: center;
}

.btn-download-all {
    padding: 14px 28px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: inline-flex; /* To align icon and text */
    align-items: center;
}

.btn-download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-download-all i {
    margin-right: 8px;
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
}

/* AI Chat Sidebar Toggle Button */
.ai-chat-button {
    position: fixed;
    top: 50%;
    right: 20px; /* Consistent position */
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 50%; /* Circular shape */
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
}

.ai-chat-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 12px 35px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #5b21b6 0%, #8b5cf6 100%);
}

.ai-chat-button.active {
    right: 400px; /* Width of sidebar */
    border-radius: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: none;
}

.ai-chat-button .ai-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.ai-chat-button .ai-avatar svg {
    width: 24px;
    height: 24px;
}

.ai-chat-button-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
    margin-top: 2px;
}

.chat-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: block;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* AI Chat Sidebar */
.ai-chat-modal {
    position: fixed;
    top: 0;
    right: -400px; /* Start hidden */
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.ai-chat-modal.active {
    right: 0; /* Slide in */
}

.ai-chat-modal.minimized {
    right: -400px; /* Completely hide the sidebar */
    pointer-events: none; /* Disable interactions when minimized */
}

/* Show minimized indicator when chat is minimized */
.ai-chat-button.minimized-active {
    right: 20px; /* Same as initial position */
    transform: translateY(-50%); /* Same transform as initial */
    width: 60px; /* Same size as initial */
    height: 60px;
    border-radius: 50%; /* Same circular shape as initial */
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); /* Same color as initial */
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3); /* Same shadow as initial */
}

.ai-chat-button.minimized-active .chat-indicator {
    display: block !important;
    animation: pulse-dot 1.5s infinite;
}

/* Animate just the indicator dot for minimized state */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@keyframes chatSlideIn {
    from {
        right: -400px;
    }
    to {
        right: 0;
    }
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    flex-shrink: 0;
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar-header {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-avatar-header svg {
    width: 16px;
    height: 16px;
}

.ai-details h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.ai-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.minimize-btn,
.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.minimize-btn:hover,
.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.minimize-btn svg,
.close-btn svg {
    width: 16px;
    height: 16px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fafbfc;
    min-height: 0;
    max-height: calc(100vh - 200px); /* Ensure proper scrolling */
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.user-message .message-avatar {
    background: #e5e7eb;
    color: #6b7280;
}

.message-avatar svg {
    width: 16px;
    height: 16px;
}

.message-content {
    flex: 1;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    margin-left: auto;
    max-width: 80%;
}

.message-bubble p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Quick Actions */
.quick-actions {
    padding: 10px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0; /* Prevent from shrinking */
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #f3f4f6;
    border: none;
    border-radius: 16px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.quick-btn svg {
    width: 12px;
    height: 12px;
}

/* Chat Input */
.chat-input-area {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px 10px;
    flex-shrink: 0; /* Prevent from shrinking */
}

.input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    outline: none;
    border-color: #6366f1;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.input-footer {
    margin-top: 8px;
    text-align: center;
}

.ai-powered {
    font-size: 11px;
    color: #9ca3af;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.typing-indicator .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-button {
        width: 40px;
        height: 100px;
        right: 0;
        border-radius: 20px 0 0 20px;
    }
    
    .ai-chat-button .ai-avatar svg {
        width: 20px;
        height: 20px;
    }
    
    .ai-chat-button-text {
        font-size: 10px;
    }
    
    .ai-chat-button.active {
        right: 100%; /* Full width on mobile */
    }
    
    .ai-chat-modal {
        width: 100%;
        right: -100%;
        border-left: none;
        box-shadow: none;
    }
    
    .ai-chat-modal.active {
        right: 0;
    }
    
    .ai-chat-modal.minimized {
        right: -100%; /* Completely hide on mobile */
        pointer-events: none;
    }
    
    .chat-header {
        padding: 12px 16px;
        min-height: 56px;
    }
    
    .ai-details h3 {
        font-size: 14px;
    }
    
    .chat-messages {
        padding: 16px;
        max-height: calc(100vh - 180px);
    }
    
    .quick-actions {
        padding: 12px 16px;
    }
    
    .chat-input-area {
        padding: 12px 16px;
    }
    
    /* Show overlay on mobile */
    .sidebar-overlay {
        display: block;
    }
}

@media (min-width: 769px) {
    /* Hide overlay on desktop */
    .sidebar-overlay {
        display: none;
    }
}

/* Privacy Policy Section */
.privacy-policy {
    max-width: 900px;
    margin: 40px auto 0;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.privacy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    cursor: pointer;
}

.privacy-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.privacy-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: inherit;
}

.privacy-chevron {
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.privacy-policy.active .privacy-chevron {
    transform: rotate(180deg);
}

.privacy-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.privacy-policy.active .privacy-content {
    max-height: 500px; /* Adjust if content is taller */
    transition: max-height 0.5s ease-in;
}

.privacy-content-inner {
    padding: 0 30px 20px 30px;
    text-align: left;
    position: relative;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e9ecef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-shield'%3e%3cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 120px;
}

.privacy-content-inner p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 15px;
    text-indent: 2em;
    position: relative; /* Ensure text is on top of the background */
}

.privacy-content-inner strong {
    color: var(--dark-gray);
    font-weight: 600;
}

.privacy-content-inner a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.privacy-content-inner a:hover {
    text-decoration: underline;
}

/* Enhanced Upload and Interaction Styles */
.upload-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px dashed var(--border-color);
}

.upload-container.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.02);
}

.upload-description {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.upload-description p {
    margin: 5px 0;
    color: var(--text-color);
}

.file-types {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

.upload-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

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

.btn-upload {
    background: var(--primary-color);
    color: white;
}

.btn-clear {
    background: var(--error-color);
    color: white;
}

.btn-download-all {
    background: var(--success-color);
    color: white;
}

.btn-retry {
    background: var(--warning-color);
    color: var(--dark-gray);
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 5px;
    font-weight: 600;
}

.btn-retry:hover {
    background: #e0a800;
}

/* File queue styles */
.file-queue {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 4px;
}

.file-queue::-webkit-scrollbar {
    width: 6px;
}

.file-queue::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.file-queue::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.file-queue::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

.file-card-item {
    display: grid;
    grid-template-columns: 80px 1fr 140px;
    grid-template-areas: "thumbnail info actions";
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    min-height: 80px;
    align-items: center;
}

.file-card-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.file-thumbnail {
    grid-area: thumbnail;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    grid-area: info;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--dark-gray);
}

.file-meta {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
}

.status-container {
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.file-actions {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 120px;
    flex-shrink: 0;
    padding: 10px 15px;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: white;
    font-weight: bold;
}

/* Processing spinner */
.processing-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.processing-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.processing-text {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

.status-queued {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.status-processing {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.status-completed {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

/* Completed and error states */
.completed-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.error-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--error-color);
    font-size: 13px;
}

.file-size {
    font-size: 10px;
    color: var(--success-color);
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    display: inline-block;
}

.btn-download-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
    min-width: 100px;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-download-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-download-item:hover::before {
    left: 100%;
}

.btn-download-item:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea986 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-download-item i {
    width: 14px;
    height: 14px;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.remove-btn:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Range slider improvements */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: var(--transition);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .upload-container {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .file-card-item {
        grid-template-columns: 60px 1fr;
        grid-template-areas: 
            "thumbnail info"
            "actions actions";
        gap: 12px;
        padding: 12px;
    }
    
    .file-thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    
    .file-actions {
        justify-content: center;
        min-width: auto;
        flex-direction: row;
        width: 100%;
        gap: 12px;
    }
    
    .btn-download-item {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .remove-btn {
        top: 5px;
        right: 5px;
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .file-card-item {
        grid-template-columns: 50px 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .file-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .file-meta {
        font-size: 11px;
    }
    
    .file-card-item {
        padding: 10px;
    }
    
    .file-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .btn-download-item {
        padding: 6px 12px;
        font-size: 10px;
        min-width: 80px;
    }
    
    .file-size {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .remove-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}
