/* OUTDOOR24H - Clean Modern Dashboard Style - No Radius, No Shadows */

:root {
    --primary: #8b5cf6;
    --secondary: #6366f1;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --text: #111827;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --bg-secondary: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --black: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg-light);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    background: var(--bg-light);
}

/* Clean Header */
.app-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: center;
}

.app-logo {
    height: 48px;
    max-width: 100%;
    object-fit: contain;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px);
    overflow: hidden;
}

/* State Management */
.state {
    display: none;
    width: 100%;
    max-width: 480px;
    height: 100%;
    animation: fadeIn 0.4s ease-out;
}

.state.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Card Container - No Border Radius, No Shadows */
.state-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    height: auto;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.state-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.state-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.state-header p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.state-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Upload Zone - No Border Radius */
.upload-zone {
    border: 2px dashed var(--border);
    /* padding: 4rem 2rem; */
    padding: 2rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* File List Accordion */
.file-list {
    margin-top: 1.5rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.file-list-accordion {
    border: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.file-list-header {
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.file-list-header:hover {
    background: var(--border-light);
}

.file-list-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.file-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.file-list-toggle {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.file-list-toggle.expanded {
    transform: rotate(180deg);
}

.file-list-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 0;
}

.file-list-content.expanded {
    flex: 1;
    overflow-y: auto;
    max-height: 100px;
    min-height: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.125rem;
}

.file-details {
    min-width: 0;
    flex: 1;
}

.file-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-remove {
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Action Bar */
.action-bar {
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Black Buttons as in Screenshot */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--black);
    color: white;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    background: #333333;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text);
}

/* Processing State */
.processing-content {
    text-align: center;
}

.processing-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.processing-icon i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-container {
    margin: 2rem 0;
}

.progress-bar {
    position: relative;
    background: var(--bg-secondary);
    height: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.current-stage {
    background: var(--bg-secondary);
    padding: 1rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-light);
}

.current-stage span {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Results State */
.results-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--success);
    font-size: 1.5rem;
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0rem 0 2rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

.summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.download-section {
    margin: 2rem 0;
}

.btn-download {
    background: var(--black);
    color: white;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.btn-download:hover {
    background: #333333;
}

/* Error State */
.error-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--error);
    font-size: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.05);
    color: #991b1b;
    padding: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin: 1.5rem 0;
    font-size: 0.875rem;
    text-align: center;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .app-main {
        padding: 1rem;
    }

    .state {
        max-width: 100%;
    }

    .state-header,
    .state-content {
        padding: 1.5rem;
    }

    .upload-zone {
        padding: 3rem 1.5rem;
    }

    .results-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .action-bar {
        flex-direction: column;
    }

    .error-actions {
        flex-direction: column;
    }
}

/* Desktop optimizations */
@media (min-width: 768px) {
    .error-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Large desktop - single screen */
@media (min-width: 1024px) {
    .app-container {
        height: 100vh;
        overflow: hidden;
    }

    .state {
        max-width: 560px;
    }
}