/* ===== MODERNE AUDIO CONVERTER STYLES - STEEL FROST DESIGN ===== */

/* ===== CSS CUSTOM PROPERTIES & DESIGN SYSTEM ===== */
:root {
    /* Steel Frost Farbpalette */
    --steelfrost-1: #F5F5F5;
    --steelfrost-2: #E3ECF0;
    --steelfrost-3: #B0C4DE;
    --steelfrost-4: #708090;
    --steelfrost-5: #1C1C1C;

    /* Light Mode Design System (mapped to Steel Frost) */
    --primary-color: var(--steelfrost-4);           /* #708090 */
    --primary-hover: var(--steelfrost-3);           /* #B0C4DE */
    --primary-active: var(--steelfrost-5);          /* #1C1C1C */
    --secondary-color: var(--steelfrost-2);         /* #E3ECF0 */
    --tertiary-color: var(--steelfrost-1);          /* #F5F5F5 */

    /* Background System */
    --background-color: linear-gradient(135deg, #F5F5F5, #E3ECF0, #B0C4DE, #708090, #1C1C1C);
    --card-background: rgba(255, 255, 255, 0.88);
    --surface-background: rgba(255, 255, 255, 0.65);
    --overlay-background: rgba(255, 255, 255, 0.96);

    /* Typography */
    --text-color: #1C1C1C;
    --text-secondary: #4c5a68; /* slightly darker than steelfrost-4 for contrast */
    --text-muted: #566675;
    --text-disabled: #8ea0b2;

    /* Interactive Elements */
    --border-color: var(--steelfrost-3);            /* #B0C4DE */
    --border-subtle: rgba(176, 196, 222, 0.35);
    --border-strong: rgba(176, 196, 222, 0.65);

    /* Status Colors */
    --success-color: #2e7d32;
    --success-bg: rgba(46, 125, 50, 0.12);
    --error-color: #c62828;
    --error-bg: rgba(198, 40, 40, 0.12);
    --warning-color: #ed6c02;
    --warning-bg: rgba(237, 108, 2, 0.12);
    --info-color: var(--steelfrost-4);
    --info-bg: rgba(112, 128, 144, 0.12);

    /* Effects */
    --shadow-color: rgba(16, 24, 40, 0.15);
    --shadow-strong: rgba(16, 24, 40, 0.28);
    --shadow-subtle: rgba(16, 24, 40, 0.08);

    /* Gradients */
    --accent-gradient: linear-gradient(135deg, #708090, #1C1C1C);
    --surface-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.75));
    --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));

    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography Scale */
    --font-xs: 0.75rem;
    --font-sm: 0.85rem;
    --font-base: 0.95rem;
    --font-lg: 1.1rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 2rem;

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-toast: 1050;
    --z-tooltip: 1060;
}

/* Dark Mode Design System */
[data-theme="dark"] {
    --primary-color: var(--steelfrost-3);           /* #B0C4DE */
    --primary-hover: var(--steelfrost-2);           /* #E3ECF0 */
    --primary-active: var(--steelfrost-4);          /* #708090 */
    
    --background-color: linear-gradient(135deg, #1C1C1C, #2a2a2a);
    --card-background: rgba(28, 28, 28, 0.92);
    --surface-background: rgba(28, 28, 28, 0.65);
    --overlay-background: rgba(28, 28, 28, 0.96);
    
    --text-color: #F5F5F5;
    --text-secondary: #B0C4DE;
    --text-muted: #A7B7C8;
    --text-disabled: #6c7a88;
    
    --border-color: rgba(176, 196, 222, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    --shadow-color: rgba(0, 0, 0, 0.35);
    --shadow-strong: rgba(0, 0, 0, 0.55);
    --shadow-subtle: rgba(0, 0, 0, 0.18);
    
    --accent-gradient: linear-gradient(135deg, #B0C4DE, #708090);
    --surface-gradient: linear-gradient(135deg, rgba(35, 35, 35, 0.95), rgba(35, 35, 35, 0.75));
    --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
    position: relative;
    transition: all var(--transition-base);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-color);
    z-index: -1;
    transition: background var(--transition-base);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== MAIN CONTAINER ===== */
.container {
    background: var(--card-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-subtle);
    box-shadow: 
        0 20px 40px var(--shadow-color),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 700px;
    width: 100%;
    padding: var(--space-3xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
    position: relative;
    transition: all var(--transition-base);
}

.container:hover {
    box-shadow: 
        0 24px 48px var(--shadow-strong),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ===== HEADER & NAVIGATION ===== */
.theme-toggle {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: var(--font-xl);
    cursor: pointer;
    padding: var(--space-md);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
    width: 48px;
    height: 48px;
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px var(--shadow-strong);
}

.theme-toggle:active {
    transform: translateY(-1px) scale(1.02);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* Home Link */
.home-link {
    position: absolute;
    top: var(--space-xl);
    left: var(--space-xl);
    background: var(--accent-gradient);
    color: white;
    font-size: var(--font-xl);
    padding: var(--space-md);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
    width: 48px;
    height: 48px;
}

.home-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px var(--shadow-strong);
    background: linear-gradient(135deg, #B0C4DE, #708090);
}

.home-link:active {
    transform: translateY(-1px) scale(1.02);
}

.home-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.home-link i {
    font-size: var(--font-lg);
    transition: transform var(--transition-fast);
}

.home-link:hover i {
    transform: scale(1.1);
}

/* Tooltip für Home Link */
.home-link::before {
    content: 'KodiniTools.top';
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--overlay-background);
    color: var(--text-color);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-subtle);
    z-index: var(--z-tooltip);
}

.home-link::after {
    content: '';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--overlay-background);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: calc(var(--z-tooltip) + 1);
}

.home-link:hover::before,
.home-link:hover::after,
.home-link:focus::before,
.home-link:focus::after {
    opacity: 1;
    visibility: visible;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: var(--font-3xl);
    font-weight: 500;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
    line-height: 1.2;
}

.subheading {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-base);
    font-weight: 300;
    margin-bottom: var(--space-xl);
    line-height: 1.4;
}

label {
    font-size: var(--font-base);
    font-weight: 500;
    margin-bottom: var(--space-md);
    display: block;
    color: var(--text-color);
    transition: color var(--transition-base);
}

/* ===== FORM ELEMENTS ===== */
input[type="file"] {
    display: none;
}

select {
    width: 100%;
    padding: var(--space-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-base);
    font-family: inherit;
    font-weight: 400;
    background: var(--card-background);
    color: var(--text-color);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23708090' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-lg) center;
    background-size: 1rem;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

select:hover {
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-subtle);
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(144, 144, 144, 0.1);
    transform: translateY(-1px);
}

/* Range Slider */
input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--steelfrost-5), var(--steelfrost-3));
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-strong);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px var(--shadow-color);
}

input[type="range"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== FILE UPLOAD AREA ===== */
.file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-2xl);
    background: var(--secondary-color);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-direction: column;
    gap: var(--space-xl);
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.file-upload::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.file-upload:hover::before {
    opacity: 1;
}

.file-upload i {
    font-size: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    z-index: 1;
    transition: transform var(--transition-base);
}

.file-upload:hover i {
    transform: scale(1.1);
}

.file-upload-text {
    font-weight: 500;
    font-size: var(--font-lg);
    z-index: 1;
    text-align: center;
}

.file-upload-subtext {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-weight: 300;
    z-index: 1;
    text-align: center;
    max-width: 80%;
}

.file-upload.dragover {
    background: var(--info-bg);
    border-color: var(--info-color);
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-color);
    animation: pulse 1s ease-in-out infinite;
}

.file-upload:hover {
    background: var(--surface-background);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-subtle);
}

.file-upload:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== FILE LIST ===== */
#file-list {
    margin-top: var(--space-lg);
    padding: var(--space-xl);
    background: var(--secondary-color);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

#file-list:hover {
    box-shadow: 0 4px 12px var(--shadow-subtle);
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.file-count {
    font-size: var(--font-base);
    font-weight: 500;
    color: var(--text-color);
}

#file-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

#file-list-items li {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--font-base);
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

#file-list-items li:hover {
    background: var(--surface-background);
    margin: 0 calc(-1 * var(--space-lg));
    padding: var(--space-lg);
    transform: translateX(4px);
}

#file-list-items li:last-child {
    border-bottom: none;
}

.file-item-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-weight: 400;
    transition: color var(--transition-fast);
}

.file-item-name:hover {
    color: var(--primary-color);
}

.file-item-size {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.file-item-remove {
    background: transparent;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: var(--font-lg);
    opacity: 0.7;
    transition: all var(--transition-fast);
    padding: var(--space-sm);
    border-radius: var(--radius-full);
}

.file-item-remove:hover {
    opacity: 1;
    background: var(--error-bg);
    transform: scale(1.1);
}

.file-item-remove:focus {
    outline: 2px solid var(--error-color);
    outline-offset: 2px;
}

/* ===== CONVERSION CONTROLS ===== */
.format-section,
.quality-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.quality-slider {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    font-weight: 400;
}

.quality-value {
    font-size: var(--font-base);
    font-weight: 500;
    width: 45px;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quality-info {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-background);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.quality-info small {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.4;
}

/* ===== BUTTONS ===== */
button {
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--font-base);
    font-weight: 500;
    font-family: inherit;
    color: white;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    box-shadow: 0 4px 15px var(--shadow-color);
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

button::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 var(--transition-slow);
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-strong);
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

button:disabled::before {
    display: none;
}

button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button i {
    font-size: var(--font-base);
}

/* Button Variants */
.clear-btn {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    box-shadow: none;
}

.clear-btn:hover {
    background: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
}

.download-all-btn {
    background: var(--accent-gradient);
}

#download-options-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#download-options-btn:hover {
    background: var(--primary-color);
    color: white;
}

#export-metadata-btn {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

#export-metadata-btn:hover {
    background: var(--warning-color);
    color: white;
}

/* ===== GLOBAL BUTTONS ===== */
.global-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.global-buttons button {
    flex: 1;
    min-width: 140px;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-sm);
}

/* ===== PROGRESS BARS ===== */
.progress-container {
    background: var(--secondary-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.progress-container:hover {
    box-shadow: 0 4px 12px var(--shadow-subtle);
    transform: translateY(-1px);
}

.progress-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.progress-file-name {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-file-size {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-right: var(--space-lg);
}

.progress-status {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--primary-color);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-lg);
    background: var(--surface-background);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width var(--transition-base);
    position: relative;
    min-width: 0;
}

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

.progress-text {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-color);
    min-width: 50px;
    text-align: center;
}

.progress-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-sm);
}

.progress-action-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-sm);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--primary-color);
    color: white;
    min-height: 36px;
}

.progress-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.progress-action-btn.download-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.progress-action-btn.download-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Progress States */
.progress-success .progress-bar-fill {
    background: var(--success-color);
}

.progress-error .progress-bar-fill {
    background: var(--error-color);
}

.progress-warning .progress-bar-fill {
    background: var(--warning-color);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--overlay-background);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    word-wrap: break-word;
}

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

.toast.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    flex: 1;
}

.toast-icon {
    font-size: var(--font-xl);
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success-color);
}

.toast-error .toast-icon {
    color: var(--error-color);
}

.toast-warning .toast-icon {
    color: var(--warning-color);
}

.toast-info .toast-icon {
    color: var(--info-color);
}

.toast-message {
    flex: 1;
    font-size: var(--font-base);
    line-height: 1.4;
    color: var(--text-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 4px;
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-top: calc(-1 * var(--space-xs));
    margin-right: calc(-1 * var(--space-xs));
}

.toast-close:hover {
    background: var(--surface-background);
    color: var(--text-color);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-subtle);
    overflow: hidden;
}

.toast-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    transition: none;
}

.toast-success .toast-progress-fill {
    background: var(--success-color);
}

.toast-error .toast-progress-fill {
    background: var(--error-color);
}

.toast-warning .toast-progress-fill {
    background: var(--warning-color);
}

.toast-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.toast-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toast-action-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* ===== STATUS MESSAGES ===== */
.completion-message,
.error-message {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: fadeIn 0.5s var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.completion-message {
    background: var(--success-bg);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.error-message {
    background: var(--error-bg);
    border-left: 4px solid var(--error-color);
    color: var(--error-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

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

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

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

/* Spinner */
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-subtle);
    border-radius: var(--radius-full);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: var(--space-md);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 5px;
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #B0C4DE, #708090);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    .global-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .global-buttons button {
        min-width: auto;
        font-size: var(--font-sm);
        padding: var(--space-md);
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--space-lg);
    }
    
    .container {
        padding: var(--space-2xl);
        gap: var(--space-xl);
        margin: 10px;
    }

    h1 {
        font-size: var(--font-2xl);
        margin-top: var(--space-lg);
    }
    
    .subheading {
        font-size: var(--font-sm);
    }

    .file-upload {
        padding: var(--space-2xl) var(--space-xl);
        min-height: 150px;
    }
    
    .file-upload i {
        font-size: 2.5rem;
    }
    
    .file-upload-text {
        font-size: var(--font-base);
    }

    .global-buttons {
        flex-direction: column;
    }

    .global-buttons button {
        width: 100%;
        min-width: auto;
    }

    .theme-toggle,
    .home-link {
        top: var(--space-lg);
        padding: var(--space-sm);
        width: 44px;
        height: 44px;
        font-size: var(--font-lg);
    }

    .theme-toggle {
        right: var(--space-lg);
    }

    .home-link {
        left: var(--space-lg);
    }
    
    .home-link i {
        font-size: var(--font-base);
    }
    
    .home-link::before {
        font-size: var(--font-xs);
        bottom: -40px;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        padding: var(--space-md);
    }
    
    .toast-message {
        font-size: var(--font-sm);
    }
    
    .progress-container {
        padding: var(--space-lg);
    }
    
    .progress-file-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .progress-file-name {
        min-width: auto;
        width: 100%;
    }
    
    .progress-actions {
        justify-content: center;
    }
    
    .progress-action-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }

    .quality-slider {
        gap: var(--space-lg);
    }
    
    .quality-slider span {
        font-size: var(--font-sm);
    }
}

@media (max-width: 640px) {
    .container {
        padding: var(--space-xl);
    }
    
    .file-upload {
        padding: var(--space-xl);
        gap: var(--space-lg);
    }
    
    .progress-file-header {
        gap: var(--space-xs);
    }
    
    .progress-actions {
        flex-direction: column;
    }
    
    .progress-action-btn {
        width: 100%;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .theme-toggle,
    .home-link,
    .toast-container {
        display: none;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-color: #000;
        --background-color: #fff;
    }
    
    [data-theme="dark"] {
        --border-color: #fff;
        --text-color: #fff;
        --background-color: #000;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== FOCUS MANAGEMENT ===== */
.toast:focus-within,
.progress-container:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES FOR STATES ===== */
.toast-paused .toast-progress-fill {
    animation-play-state: paused;
}

.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.is-success {
    border-color: var(--success-color);
    background: var(--success-bg);
}

.is-error {
    border-color: var(--error-color);
    background: var(--error-bg);
}

.is-warning {
    border-color: var(--warning-color);
    background: var(--warning-bg);
}