:root {
    color-scheme: light;
    --aex-bg: #f8f9fa;
    --aex-panel: #ffffff;
    --aex-border: #dee2e6;
    --aex-primary: #0d6efd;
    --aex-primary-hover: #0b5ed7;
    --aex-primary-dark: #0a58ca;
    --aex-secondary: #6c757d;
    --aex-success: #198754;
    --aex-danger: #dc3545;
    --aex-warning: #ffc107;
    --aex-info: #0dcaf0;
    --aex-light: #f8f9fa;
    --aex-dark: #212529;
    --aex-muted: #6c757d;
    --aex-white: #ffffff;
    --aex-gray-100: #f8f9fa;
    --aex-gray-200: #e9ecef;
    --aex-gray-300: #dee2e6;
    --aex-gray-400: #ced4da;
    --aex-gray-500: #adb5bd;
    --aex-gray-600: #6c757d;
    --aex-gray-700: #495057;
    --aex-gray-800: #343a40;
    --aex-gray-900: #212529;
    --aex-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --aex-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --aex-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --aex-border-radius: 0.375rem;
    --aex-border-radius-sm: 0.25rem;
    --aex-border-radius-lg: 0.5rem;
    --aex-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --aex-font-size-base: 1rem;
    --aex-font-size-sm: 0.875rem;
    --aex-font-size-lg: 1.25rem;
    --aex-font-weight-normal: 400;
    --aex-font-weight-medium: 500;
    --aex-font-weight-semibold: 600;
    --aex-font-weight-bold: 700;
    --aex-line-height-base: 1.5;
    --aex-transition: all 0.15s ease-in-out;
}

/* Base Styles */
.aex-body {
    margin: 0;
    font-family: var(--aex-font-family);
    font-size: var(--aex-font-size-base);
    font-weight: var(--aex-font-weight-normal);
    line-height: var(--aex-line-height-base);
    background: linear-gradient(135deg, var(--aex-gray-100) 0%, var(--aex-gray-200) 100%);
    color: var(--aex-gray-900);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Container for narrow layout */
.aex-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    width: calc(100% - 2rem);
    background: var(--aex-white);
    min-height: calc(100vh - 2rem);
    border-radius: var(--aex-border-radius-lg);
    box-shadow: var(--aex-shadow-lg);
}

/* Introduction Section */
.aex-intro-section {
    background: var(--aex-white);
    color: var(--aex-gray-700);
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    border-radius: var(--aex-border-radius-lg);
    border: 1px solid var(--aex-border);
    box-shadow: var(--aex-shadow);
}

.aex-intro-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.aex-intro-title {
    font-size: 1.75rem;
    font-weight: var(--aex-font-weight-semibold);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    color: var(--aex-gray-900);
}

.aex-intro-description {
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    color: var(--aex-gray-600);
    line-height: 1.5;
}

.aex-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.aex-feature-item {
    text-align: center;
    padding: 1rem 0.5rem;
    background: transparent;
    border-radius: var(--aex-border-radius-sm);
    transition: var(--aex-transition);
    border: 1px solid transparent;
}

.aex-feature-item:hover {
    background: var(--aex-gray-100);
    border-color: var(--aex-border);
}

.aex-feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--aex-primary);
}

.aex-feature-item h3 {
    font-size: 0.875rem;
    font-weight: var(--aex-font-weight-medium);
    margin: 0 0 0.25rem 0;
    color: var(--aex-gray-800);
}

.aex-feature-item p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--aex-gray-600);
}

/* Main Shell */
.aex-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header */
.aex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.aex-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: var(--aex-font-weight-semibold);
    color: var(--aex-gray-800);
}

.aex-subtitle {
    margin: 0;
    color: var(--aex-muted);
    font-size: var(--aex-font-size-base);
}

.aex-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Main Layout */
.aex-main {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 1.5rem;
}

@media (max-width: 980px) {
    .aex-main {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.aex-panel {
    background: var(--aex-white);
    border-radius: var(--aex-border-radius-lg);
    border: 1px solid var(--aex-border);
    padding: 1.5rem;
    box-shadow: var(--aex-shadow);
    overflow: hidden;
    margin-bottom: 1rem;
}

.aex-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--aex-border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.aex-panel-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: var(--aex-font-weight-semibold);
    color: var(--aex-gray-900);
}

.aex-panel-heading p {
    margin: 0.25rem 0 0 0;
    color: var(--aex-muted);
    font-size: var(--aex-font-size-sm);
}

.aex-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Dropzone */
.aex-dropzone {
    border: 2px dashed var(--aex-primary);
    border-radius: var(--aex-border-radius-lg);
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, var(--aex-gray-50) 100%);
    transition: var(--aex-transition);
    cursor: pointer;
    text-align: center;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.aex-dropzone:hover {
    border-color: var(--aex-primary);
    background: rgba(13, 110, 253, 0.05);
}

.aex-dropzone.dragover {
    border-color: var(--aex-primary);
    background: rgba(13, 110, 253, 0.1);
    transform: scale(1.02);
}

.aex-drop-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--aex-muted);
    text-align: center;
    justify-content: center;
}

.aex-drop-icon {
    font-size: 2.5rem;
    color: var(--aex-primary);
    font-weight: var(--aex-font-weight-bold);
}

.aex-drop-title {
    margin: 0;
    font-weight: var(--aex-font-weight-semibold);
    color: var(--aex-gray-800);
    font-size: 1.25rem;
}

.aex-drop-hint {
    margin: 0.25rem 0 0 0;
    font-size: var(--aex-font-size-sm);
    color: var(--aex-muted);
}

/* File List */
.aex-file-list {
    margin-top: 1.25rem;
    border: 1px solid var(--aex-border);
    border-radius: var(--aex-border-radius);
    max-height: 300px;
    overflow-y: auto;
    background: var(--aex-white);
}

.aex-file-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--aex-border);
    transition: var(--aex-transition);
}

.aex-file-row:hover {
    background: var(--aex-gray-100);
}

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

.aex-file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aex-file-name {
    margin: 0;
    font-weight: var(--aex-font-weight-medium);
    color: var(--aex-gray-900);
}

.aex-file-path {
    margin: 0;
    font-size: var(--aex-font-size-sm);
    color: var(--aex-muted);
    word-break: break-all;
}

.aex-file-size,
.aex-file-duration {
    font-size: var(--aex-font-size-sm);
    color: var(--aex-muted);
    font-weight: var(--aex-font-weight-medium);
}

.aex-file-remove {
    border: none;
    background: transparent;
    padding: 0.5rem;
    border-radius: var(--aex-border-radius-sm);
    color: var(--aex-danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--aex-transition);
}

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

.aex-file-remove svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

/* Form Elements */
.aex-form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aex-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: var(--aex-font-weight-medium);
    color: var(--aex-gray-700);
}

.aex-form-select,
.aex-form-input {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: var(--aex-font-size-base);
    font-weight: var(--aex-font-weight-normal);
    line-height: var(--aex-line-height-base);
    color: var(--aex-gray-900);
    background: var(--aex-white);
    border: 1px solid var(--aex-border);
    border-radius: var(--aex-border-radius);
    transition: var(--aex-transition);
    appearance: none;
}

.aex-form-select:focus,
.aex-form-input:focus {
    outline: 0;
    border-color: var(--aex-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.aex-form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.aex-input-group {
    display: flex;
    gap: 0.5rem;
}

.aex-input-group .aex-form-input {
    flex: 1;
}

.aex-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.aex-form-checkbox {
    width: auto !important;
    margin: 0 !important;
}

/* Buttons (Bootstrap-like styles) */
.aex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--aex-font-weight-medium);
    line-height: var(--aex-line-height-base);
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: var(--aex-font-size-base);
    border-radius: var(--aex-border-radius);
    transition: var(--aex-transition);
    gap: 0.25rem;
}

.aex-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.aex-btn:active {
    transform: translateY(0);
}

.aex-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Primary Button */
.aex-btn-primary {
    color: var(--aex-white);
    background: var(--aex-primary);
    border-color: var(--aex-primary);
}

.aex-btn-primary:hover {
    background: var(--aex-primary-hover);
    border-color: var(--aex-primary-hover);
}

/* Secondary Button */
.aex-btn-secondary {
    color: var(--aex-white);
    background: var(--aex-secondary);
    border-color: var(--aex-secondary);
}

.aex-btn-secondary:hover {
    background: #5c636a;
    border-color: #565e64;
}

/* Outline Button */
.aex-btn-outline {
    color: var(--aex-primary);
    background: transparent;
    border-color: var(--aex-primary);
}

.aex-btn-outline:hover {
    color: var(--aex-white);
    background: var(--aex-primary);
    border-color: var(--aex-primary);
}

/* Light Button */
.aex-btn-light {
    color: var(--aex-gray-900);
    background: var(--aex-light);
    border-color: var(--aex-gray-300);
}

.aex-btn-light:hover {
    background: var(--aex-gray-200);
    border-color: var(--aex-gray-400);
}

/* Link Button */
.aex-btn-link {
    color: var(--aex-primary);
    background: transparent;
    border-color: transparent;
    text-decoration: none;
}

.aex-btn-link:hover {
    color: var(--aex-primary-hover);
    text-decoration: underline;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

/* Progress Section */
.aex-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--aex-border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.aex-progress-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: var(--aex-font-weight-semibold);
    color: var(--aex-gray-900);
}

.aex-progress-header p {
    margin: 0.25rem 0 0 0;
    color: var(--aex-muted);
    font-size: var(--aex-font-size-sm);
}

.aex-progress-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.aex-progress-list {
    border: 1px solid var(--aex-border);
    border-radius: var(--aex-border-radius);
    max-height: 400px;
    overflow-y: auto;
    background: var(--aex-white);
}

.aex-progress-card {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--aex-border);
    transition: var(--aex-transition);
}

.aex-progress-card:hover {
    background: var(--aex-gray-100);
}

.aex-progress-card:last-child {
    border-bottom: none;
}

.aex-progress-card.success {
    background: rgba(25, 135, 84, 0.1);
    border-left: 4px solid var(--aex-success);
}

.aex-progress-card.error {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--aex-danger);
}

.aex-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.aex-progress-name {
    margin: 0;
    font-weight: var(--aex-font-weight-medium);
    color: var(--aex-gray-900);
    font-size: var(--aex-font-size-base);
}

.aex-progress-status {
    margin: 0.25rem 0 0 0;
    font-size: var(--aex-font-size-sm);
    color: var(--aex-muted);
}

.aex-progress-bar {
    height: 0.5rem;
    background: var(--aex-gray-200);
    border-radius: var(--aex-border-radius-sm);
    overflow: hidden;
}

.aex-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--aex-primary), var(--aex-primary-hover));
    border-radius: var(--aex-border-radius-sm);
    transition: width 0.3s ease;
}

/* Empty State */
.aex-empty {
    text-align: center;
    color: var(--aex-muted);
    font-size: var(--aex-font-size-sm);
    margin: 2rem 0;
    padding: 1rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aex-container {
        padding: 0 15px;
    }
    
    .aex-intro-title {
        font-size: 2rem;
    }
    
    .aex-intro-description {
        font-size: 1rem;
    }
    
    .aex-features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .aex-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .aex-header-actions {
        justify-content: center;
    }
    
    .aex-panel-heading {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .aex-panel-actions {
        justify-content: center;
    }
    
    .aex-drop-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .aex-file-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .aex-progress-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .aex-progress-actions {
        justify-content: center;
    }
    
    .aex-progress-top {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .aex-shell {
        padding: 1rem 0 2rem;
    }
    
    .aex-panel {
        padding: 1rem;
    }
    
    .aex-btn {
        padding: 0.5rem 1rem;
        font-size: var(--aex-font-size-sm);
    }
}

/* Scrollbar Styling */
.aex-file-list::-webkit-scrollbar,
.aex-progress-list::-webkit-scrollbar {
    width: 6px;
}

.aex-file-list::-webkit-scrollbar-track,
.aex-progress-list::-webkit-scrollbar-track {
    background: var(--aex-gray-200);
    border-radius: var(--aex-border-radius-sm);
}

.aex-file-list::-webkit-scrollbar-thumb,
.aex-progress-list::-webkit-scrollbar-thumb {
    background: var(--aex-gray-400);
    border-radius: var(--aex-border-radius-sm);
}

.aex-file-list::-webkit-scrollbar-thumb:hover,
.aex-progress-list::-webkit-scrollbar-thumb:hover {
    background: var(--aex-gray-500);
}
