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

/* ŠKODA Branding Color System */
:root {
    --skoda-primary: #4CAF50;        /* ŠKODA green */
    --skoda-primary-dark: #45a049;  /* Darker green */
    --skoda-primary-light: #66BB6A; /* Lighter green */
    --skoda-secondary: #2c3e50;     /* Charcoal */
    --skoda-secondary-light: #34495e; /* Lighter charcoal */
    --skoda-light: #ecf0f1;         /* Light gray */
    --skoda-white: #ffffff;         /* Pure white */
    --skoda-background: #f8f9fa;    /* Very light gray */
    --skoda-shadow: rgba(0, 0, 0, 0.1);  /* Subtle shadows */
    --skoda-shadow-hover: rgba(0, 0, 0, 0.15); /* Hover shadows */
    --skoda-border: #dee2e6;        /* Light borders */
    --skoda-border-dark: #ced4da;   /* Darker borders */
    --skoda-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --skoda-font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    --skoda-transition: all 0.2s ease;
    --skoda-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

body {
    font-family: var(--skoda-font-primary);
    background-color: var(--skoda-background);
    color: var(--skoda-secondary);
    line-height: 1.4;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--skoda-white) 0%, var(--skoda-light) 100%);
    box-shadow: 0 2px 8px var(--skoda-shadow);
    background-color: var(--skoda-background);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--skoda-border);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--skoda-secondary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1::before {
    content: "";
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--skoda-primary) 0%, var(--skoda-primary-dark) 100%);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 3s ease-in-out infinite;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--skoda-secondary-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.bucket-selector {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.bucket-selector label {
    font-size: 0.8rem;
    color: var(--skoda-secondary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.bucket-select-dropdown {
    padding: 0.5rem 0.5rem;
    border: 2px solid var(--skoda-border);
    border-radius: var(--border-radius);
    background-color: var(--skoda-white);
    font-size: 0.8rem;
    font-family: var(--skoda-font-primary);
    font-weight: 500;
    min-width: 180px;
    cursor: pointer;
    transition: var(--skoda-transition);
    box-shadow: 0 2px 4px var(--skoda-shadow);
}

.bucket-select-dropdown:hover {
    border-color: var(--skoda-primary-light);
    box-shadow: 0 4px 8px var(--skoda-shadow-hover);
    transform: translateY(-1px);
}

.bucket-select-dropdown:focus {
    outline: none;
    border-color: var(--skoda-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

.bucket-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.bucket-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.bucket-status-indicator.bucket-default {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.bucket-status-indicator.bucket-accessible {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bucket-status-indicator.bucket-inaccessible {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bucket-status-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.bucket-status-text .bucket-default {
    color: #856404;
}

.bucket-status-text .bucket-accessible {
    color: #155724;
}

.bucket-status-text .bucket-inaccessible {
    color: #721c24;
}

/* Disable state for inaccessible buckets in select */
.bucket-select-dropdown option:disabled {
    color: #999;
    background-color: #f8f9fa;
}

/* Responsive adjustments for bucket selector */
@media (max-width: 768px) {
    .bucket-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .bucket-select-wrapper {
        width: 100%;
    }
    
    .bucket-select-dropdown {
        flex: 1;
        min-width: 120px;
    }
}

/* Main Content */
.main {
    padding: 10px 0;
    min-height: calc(100vh - 80px);
}

/* Breadcrumb */
.breadcrumb {
    padding: 5px 0;
    margin-bottom: 10px;
    color: #666;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2980b9;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, var(--skoda-white) 0%, var(--skoda-light) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 12px var(--skoda-shadow);
    border: 1px solid var(--skoda-border);
    backdrop-filter: blur(10px);
}

.toolbar-left {
    display: flex;
    gap: 10px;
}

.toolbar-right {
    color: var(--skoda-secondary-light);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 5px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--skoda-font-primary);
    transition: var(--skoda-transition-smooth);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--skoda-shadow);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.8rem;
}

.btn::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:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px var(--skoda-shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--skoda-primary) 0%, var(--skoda-primary-dark) 100%);
    color: var(--skoda-white);
    border: 2px solid var(--skoda-primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--skoda-primary-dark) 0%, var(--skoda-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--skoda-shadow-hover);
    border-color: var(--skoda-primary-dark);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--skoda-white) 0%, var(--skoda-light) 100%);
    color: var(--skoda-secondary);
    border: 2px solid var(--skoda-border);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--skoda-light) 0%, var(--skoda-white) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--skoda-shadow-hover);
    border-color: var(--skoda-primary-light);
    color: var(--skoda-primary-dark);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: var(--skoda-white);
    border: 2px solid #e74c3c;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
    border-color: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    text-transform: none;
    letter-spacing: normal;
}

.btn-active {
    background: linear-gradient(135deg, var(--skoda-primary) 0%, var(--skoda-primary-dark) 100%);
    color: var(--skoda-white);
    border-color: var(--skoda-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--skoda-shadow-hover);
}

.badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* Error Message */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* File List */
.file-list {
    background: linear-gradient(135deg, var(--skoda-white) 0%, var(--skoda-light) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 12px var(--skoda-shadow);
    overflow: hidden;
    border: 1px solid var(--skoda-border);
    backdrop-filter: blur(10px);
}

.loading, .empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--skoda-border);
    transition: var(--skoda-transition-smooth);
    cursor: pointer;
    position: relative;
    background: var(--skoda-white);
}

.file-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(135deg, var(--skoda-primary) 0%, var(--skoda-primary-dark) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.file-item:hover {
    background: linear-gradient(135deg, var(--skoda-white) 0%, var(--skoda-light) 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px var(--skoda-shadow-hover);
}

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

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

.file-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-size {
    width: 100px;
    text-align: right;
    color: #666;
    font-size: 0.9rem;
}

.file-date {
    width: 150px;
    text-align: right;
    color: #666;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--skoda-border);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Form Elements */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 8px;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Utility Classes */
.warning {
    color: #e67e22;
    font-weight: 500;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-left {
        justify-content: center;
    }
    
    .file-item {
        flex-wrap: wrap;
    }
    
    .file-size, .file-date {
        display: none;
    }
    
    .file-actions {
        margin-left: auto;
    }
}

/* Upload Modal Styles */
.modal-large {
    max-width: 90%;
    width: 900px;
}

/* Upload Drop Zone */
.upload-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-drop-zone:hover,
.upload-drop-zone.dragging {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.upload-area-content .upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.upload-area-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-area-content p {
    color: #666;
    margin: 10px 0;
}

.upload-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 20px;
}

/* Upload Queue */
.upload-queue {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

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

.queue-header h4 {
    margin: 0;
    color: #2c3e50;
}

.queue-actions {
    display: flex;
    gap: 10px;
}

/* Upload Progress */
.upload-overall-progress {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

/* Upload List */
.upload-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}

.upload-item {
    border-bottom: 1px solid #eee;
    padding: 15px;
}

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

.upload-item.upload-completed {
    background-color: #f8fff8;
}

.upload-item.upload-error {
    background-color: #fff8f8;
}

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-file-info .file-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.file-details {
    flex: 1;
}

.file-details .file-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.file-details .file-size {
    font-size: 0.85rem;
    color: #666;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.status-icon {
    font-size: 1rem;
}

.status-text {
    text-transform: capitalize;
    color: #666;
}

.upload-progress {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
}

.upload-error {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff8f8;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-success {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8fff8;
    border-radius: 4px;
    color: #27ae60;
    font-size: 0.85rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.notification-success {
    background-color: #27ae60;
}

.notification-error {
    background-color: #e74c3c;
}

.notification-info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Download Panel Styles */
.download-panel {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 400px;
    max-height: 60vh;
    background-color: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    overflow: hidden;
    transition: all 0.3s ease;
}

.download-panel.minimized {
    height: 50px;
    max-height: 50px;
}

.download-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.download-panel-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

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

.download-panel-content {
    max-height: calc(60vh - 60px);
    overflow-y: auto;
    padding: 15px 20px;
}

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

.download-section:last-child {
    margin-bottom: 0;
}

.download-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
}

.download-list {
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

.download-item {
    border-bottom: 1px solid #eee;
    padding: 12px;
    background-color: white;
    transition: background-color 0.2s;
}

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

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

.download-item.download-completed {
    background-color: #f8fff8;
}

.download-item.download-error {
    background-color: #fff8f8;
}

.download-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.download-file-info .file-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.download-file-info .file-details {
    flex: 1;
    min-width: 0;
}

.download-file-info .file-name {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-file-info .file-size {
    font-size: 0.85rem;
    color: #666;
}

.download-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    margin-right: 8px;
}

.download-actions {
    display: flex;
    gap: 5px;
}

.download-progress {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.download-paused,
.download-pending {
    margin-top: 8px;
    padding: 8px;
    background-color: #fff3cd;
    border-radius: 4px;
    color: #856404;
    font-size: 0.85rem;
}

.download-error {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8d7da;
    border-radius: 4px;
    color: #721c24;
    font-size: 0.85rem;
}

.download-success {
    margin-top: 8px;
    padding: 8px;
    background-color: #d4edda;
    border-radius: 4px;
    color: #155724;
    font-size: 0.85rem;
}

.empty-downloads {
    text-align: center;
    padding: 30px;
    color: #666;
}

.empty-downloads p {
    margin-bottom: 8px;
}

.empty-downloads p:last-child {
    font-size: 0.9rem;
    color: #999;
}

/* Download Progress Animations */
.download-progress .progress-fill {
    transition: width 0.3s ease;
}

/* Download Status Pulsing for Active Downloads */
.download-item.download-downloading .status-icon {
    animation: pulse 2s infinite;
}

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

/* Download Counter Animation */
.badge {
    animation: badge-pulse 1s ease-out;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Additional button and selection styles */
.btn-active {
    background-color: #3498db;
    color: white;
}

.badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.file-select {
    margin-right: 8px;
}

.file-select-checkbox {
    cursor: pointer;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 0.9rem;
}

.selection-controls {
    display: flex;
    gap: 5px;
}

/* Responsive Design for Download Panel */
@media (max-width: 768px) {
    .download-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 8px 8px 0 0;
    }
    
    .download-panel-content {
        max-height: calc(50vh - 60px);
        padding: 10px 15px;
    }
    
    .download-file-info {
        flex-wrap: wrap;
    }
    
    .download-file-info .file-details {
        min-width: 200px;
    }
    
    .download-status {
        width: 100%;
        margin-top: 5px;
    }
    
    .selection-controls {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .toolbar-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .download-panel {
        max-height: 70vh;
    }
    
    .download-panel-header {
        padding: 12px 15px;
    }
    
    .download-panel-header h3 {
        font-size: 0.9rem;
    }
    
    .download-panel-controls {
        gap: 5px;
    }
    
    .download-panel-content {
        max-height: calc(70vh - 50px);
        padding: 8px 12px;
    }
    
    .file-select {
        display: none;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .file-size, .file-date {
        display: none;
    }
}

/* Upload Button Loading State */
.upload-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design for Upload Modal */
@media (max-width: 768px) {
    .modal-large {
        max-width: 95%;
        width: auto;
        margin: 10px;
    }
    
    .upload-drop-zone {
        padding: 30px 15px;
    }
    
    .upload-area-content .upload-icon {
        font-size: 3rem;
    }
    
    .queue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .queue-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .upload-file-info {
        flex-wrap: wrap;
    }
    
    .upload-file-info .file-details {
        min-width: 200px;
    }
    
    .upload-status {
        width: 100%;
        margin-top: 5px;
    }
}

/* Progress Dashboard Styles */
.progress-dashboard-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 450px;
    max-height: calc(100vh - 100px);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 998;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.progress-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #2c3e50;
    color: white;
    cursor: move;
}

.progress-dashboard-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

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

.progress-dashboard-controls .btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    padding: 4px 8px;
    transition: all 0.2s;
}

.progress-dashboard-controls .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.progress-dashboard-content {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 20px;
}

.progress-dashboard-section {
    margin-bottom: 25px;
}

.progress-dashboard-section:last-child {
    margin-bottom: 0;
}

.progress-dashboard-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Network Quality Indicator */
.network-quality-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
}

.network-quality-indicator.network-EXCELLENT {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
}

.network-quality-indicator.network-GOOD {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
}

.network-quality-indicator.network-FAIR {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
}

.network-quality-indicator.network-POOR {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
}

.quality-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.quality-info {
    flex: 1;
}

.quality-label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 2px;
}

.bandwidth-usage {
    font-size: 0.85rem;
    color: #666;
}

/* Transfer Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

/* Active Transfers */
.transfers-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.transfer-item {
    border-bottom: 1px solid #f1f3f4;
    padding: 12px;
    transition: background-color 0.2s;
    position: relative;
}

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

.transfer-item:hover {
    background-color: #f8f9fa;
}

.transfer-item.transfer-upload {
    border-left: 3px solid #27ae60;
}

.transfer-item.transfer-download {
    border-left: 3px solid #3498db;
}

.transfer-priority-HIGH {
    background-color: rgba(231, 76, 60, 0.05);
}

.transfer-priority-NORMAL {
    background-color: rgba(255, 255, 255, 1);
}

.transfer-priority-LOW {
    background-color: rgba(149, 165, 166, 0.05);
}

.transfer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transfer-type-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.transfer-details {
    flex: 1;
    min-width: 0;
}

.transfer-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transfer-progress {
    margin-bottom: 4px;
}

.transfer-progress .progress-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-bottom: 4px;
}

.transfer-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
}

.transfer-progress .progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}

.transfer-priority {
    margin-right: 8px;
}

.priority-select {
    font-size: 0.75rem;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
}

.transfer-speed {
    font-size: 0.8rem;
    color: #666;
    min-width: 60px;
    text-align: right;
    font-weight: 500;
}

.transfer-actions {
    display: flex;
    gap: 3px;
}

/* Transfer History */
.history-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.history-item {
    border-bottom: 1px solid #f1f3f4;
    padding: 10px;
    transition: background-color 0.2s;
}

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

.history-item:hover {
    background-color: #f8f9fa;
}

.history-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-type-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #666;
}

.history-success {
    color: #27ae60;
    font-weight: 500;
}

.history-error {
    color: #e74c3c;
    font-weight: 500;
}

.history-cancelled {
    color: #f39c12;
    font-weight: 500;
}

.history-time {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

/* Empty State */
.empty-progress-dashboard {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-progress-dashboard p {
    margin-bottom: 8px;
}

.empty-progress-dashboard p:first-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
}

/* Progress Dashboard Animations */
.transfer-item.transfer-active {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Progress bar animations for active transfers */
.transfer-item.transfer-active .progress-fill {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 50%, #3498db 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Network quality pulse animation */
.network-quality-indicator {
    animation: networkPulse 3s ease-in-out infinite;
}

@keyframes networkPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Transfer completion animation */
.transfer-item.transfer-completed {
    animation: completionPulse 0.5s ease-out;
}

@keyframes completionPulse {
    0% {
        background-color: rgba(39, 174, 96, 0.2);
    }
    100% {
        background-color: rgba(39, 174, 96, 0);
    }
}

/* Responsive Design for Progress Dashboard */
@media (max-width: 1200px) {
    .progress-dashboard-panel {
        width: 400px;
    }
}

@media (max-width: 992px) {
    .progress-dashboard-panel {
        width: 350px;
        right: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .progress-dashboard-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        z-index: 9999;
    }
    
    .progress-dashboard-content {
        max-height: calc(100vh - 80px);
        padding: 15px;
    }
    
    .transfer-info {
        flex-wrap: wrap;
    }
    
    .transfer-details {
        min-width: 200px;
    }
    
    .transfer-speed {
        width: 100%;
        text-align: left;
        margin-top: 5px;
    }
    
    .history-info {
        flex-wrap: wrap;
    }
    
    .history-details {
        min-width: 200px;
    }
    
    .history-time {
        width: 100%;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .progress-dashboard-header {
        padding: 12px 15px;
    }
    
    .progress-dashboard-controls {
        gap: 5px;
    }
    
    .progress-dashboard-controls .btn {
        padding: 3px 6px;
        font-size: 0.75rem;
    }
    
    .progress-dashboard-content {
        padding: 10px;
    }
    
    .transfer-actions {
        gap: 2px;
    }
    
    .transfer-actions .btn {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
}

/* Image Preview Modal Styles */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.image-preview-modal .modal-content {
    background: transparent;
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow: hidden;
    padding: 0;
    box-shadow: none;
}

.image-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.image-preview-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.image-preview-viewport.panning {
    cursor: grabbing;
}

.image-preview-viewport.zoom-mode {
    cursor: zoom-in;
}

.image-preview-viewport.zoom-out-mode {
    cursor: zoom-out;
}

.image-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    transform-origin: center center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Image Preview Controls */
.image-preview-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    color: white;
}

.image-preview-info {
    flex: 1;
    min-width: 0;
}

.image-title {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.image-size, .image-dimensions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.image-preview-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.image-preview-controls:hover {
    opacity: 1;
}

.image-preview-controls .btn {
    background-color: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
    font-size: 18px;
    position: relative;
}

.image-preview-controls .btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.image-preview-controls .btn:active {
    transform: scale(0.95);
    background-color: rgba(52, 152, 219, 0.2);
}

.image-preview-controls .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.image-preview-controls .btn:disabled:hover {
    background-color: transparent;
    color: #2c3e50;
}

.image-preview-controls .btn-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.image-preview-controls .btn:hover .btn-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 4px;
    padding: 0 8px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.zoom-level-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

/* Navigation Controls */
.nav-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.nav-controls.left {
    left: 20px;
}

.nav-controls.right {
    right: 20px;
}

.nav-controls .nav-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.nav-controls .nav-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nav-controls .nav-btn:active {
    transform: scale(0.95);
}

.nav-controls .nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-controls .nav-btn:disabled:hover {
    transform: none;
}

/* Image Information Panel */
.image-info-panel {
    position: absolute;
    right: -400px;
    top: 80px;
    bottom: 20px;
    width: 380px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.image-info-panel.active {
    right: 0;
}

.image-info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 8px 0 0 0;
}

.image-info-panel-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.image-info-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.image-info-section {
    margin-bottom: 25px;
}

.image-info-section:last-child {
    margin-bottom: 0;
}

.image-info-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 6px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.info-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-value {
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.image-thumbnail {
    width: 100%;
    border-radius: 6px;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading State */
.image-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 5;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

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

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

/* Error State */
.image-preview-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    z-index: 5;
}

.error-icon {
    font-size: 48px;
    color: #e74c3c;
}

.error-message {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.error-details {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

/* Keyboard Shortcuts Modal */
.keyboard-shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.keyboard-shortcuts-modal.active {
    opacity: 1;
    visibility: visible;
}

.shortcuts-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.keyboard-shortcuts-modal.active .shortcuts-modal-content {
    transform: scale(1) translateY(0);
}

.shortcuts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.shortcuts-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
}

.shortcuts-modal-body {
    padding: 24px;
}

.shortcuts-section {
    margin-bottom: 24px;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section h4 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.shortcut-description {
    color: #2c3e50;
    font-size: 0.95rem;
}

.shortcut-keys {
    display: flex;
    gap: 6px;
    align-items: center;
}

.key-badge {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-plus {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0 4px;
}

/* Transform Animations */
.image-transform-transition {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-animation {
    animation: zoomPulse 0.3s ease-out;
}

@keyframes zoomPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.rotate-animation {
    animation: rotateTransition 0.3s ease-in-out;
}

@keyframes rotateTransition {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(90deg);
    }
}

/* Touch Gesture Indicators */
.gesture-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
    z-index: 1000;
    transition: opacity 0.2s ease;
}

.gesture-indicator.active {
    opacity: 1;
}

/* Focus Indicators */
.image-preview-controls .btn:focus-visible,
.nav-controls .nav-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .image-preview-modal {
        background-color: black;
    }
    
    .image-preview-controls {
        background-color: white;
        border: 2px solid black;
    }
    
    .nav-controls .nav-btn {
        background-color: white;
        border: 2px solid black;
    }
    
    .image-info-panel {
        background-color: white;
        border: 2px solid black;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .image-preview-modal,
    .image-preview-controls,
    .nav-controls .nav-btn,
    .image-info-panel,
    .keyboard-shortcuts-modal,
    .shortcuts-modal-content,
    .image-preview-content {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .zoom-animation,
    .rotate-animation {
        animation: none;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .image-info-panel {
        width: 320px;
    }
    
    .nav-controls .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .image-preview-controls {
        top: 10px;
        padding: 6px;
        gap: 2px;
        border-radius: 6px;
    }
    
    .image-preview-controls .btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .zoom-controls {
        padding: 0 6px;
    }
    
    .zoom-level-display {
        font-size: 12px;
        min-width: 40px;
    }
    
    .nav-controls.left {
        left: 10px;
    }
    
    .nav-controls.right {
        right: 10px;
    }
    
    .nav-controls .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .image-info-panel {
        top: 60px;
        width: 100%;
        right: -100%;
        border-radius: 0;
    }
    
    .image-info-panel.active {
        right: 0;
    }
    
    .shortcuts-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .shortcuts-modal-header,
    .shortcuts-modal-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .image-preview-controls {
        top: 5px;
        padding: 4px;
    }
    
    .image-preview-controls .btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .image-preview-controls .btn-tooltip {
        display: none;
    }
    
    .zoom-controls {
        padding: 0 4px;
    }
    
    .zoom-level-display {
        font-size: 11px;
        min-width: 35px;
    }
    
    .nav-controls {
        gap: 8px;
    }
    
    .nav-controls.left {
        left: 5px;
    }
    
    .nav-controls.right {
        right: 5px;
    }
    
    .nav-controls .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .image-info-panel-header {
        padding: 16px;
    }
    
    .image-info-panel-content {
        padding: 16px;
    }
    
    .shortcuts-modal-content {
        width: 98%;
    }
    
    .shortcuts-modal-header,
    .shortcuts-modal-body {
        padding: 12px;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .shortcut-keys {
        align-self: flex-end;
    }
}

/* Performance Optimizations */
.image-preview-content {
    backface-visibility: hidden;
    perspective: 1000px;
    transform: translateZ(0);
}

.image-preview-content img {
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Additional Image Preview Elements */
.image-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90%;
    transform-origin: center center;
    /* Centering handled by JavaScript transform */
    position: absolute;
    top: 50%;
    left: 50%;
}

.image-wrapper .preview-image {
    /* Ensure image is centered within wrapper */
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 5;
    color: white;
}

.image-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    z-index: 5;
}

.image-navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    z-index: 10;
}

.image-counter {
    font-weight: 500;
}

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

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-prev, .nav-next {
    position: static;
    transform: none;
    box-shadow: none;
}

.image-preview-toolbar {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 8px;
}

.gesture-indicators {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.keyboard-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.keyboard-help-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.control-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.close-preview-btn {
    margin-left: 8px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.path-text {
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

/* Print Styles */
@media print {
    .image-preview-modal,
    .keyboard-shortcuts-modal {
        display: none !important;
    }
}