/* CSS Variables - TechTools Theme */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-hover: #232338;
    --border-color: #2a2a40;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-hover: #34d399;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 2;
    text-align: center;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.header h1 i {
    color: var(--accent-primary);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.back-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Upload Section */
.upload-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.upload-container {
    width: 100%;
    max-width: 800px;
}

.upload-area {
    width: 100%;
    padding: 4rem 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.upload-area h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-formats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Privacy Info Cards */
.privacy-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.privacy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.privacy-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.privacy-card i {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.privacy-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.privacy-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Results Section */
.results-section {
    flex: 1;
    padding: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.results-header h2 i {
    color: var(--success);
}

.results-actions {
    display: flex;
    gap: 0.75rem;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.stat-card.highlight {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card.highlight .stat-value {
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
}

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

.file-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-hover);
}

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

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-size-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-original {
    color: var(--text-muted);
    text-decoration: line-through;
}

.size-arrow {
    color: var(--accent-primary);
}

.size-clean {
    color: var(--accent-primary);
    font-weight: 500;
}

.file-saved {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 500;
}

.file-saved.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-card.neutral {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.stat-card.neutral .stat-value {
    color: var(--warning);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.file-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

/* Drop More Area */
.drop-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.drop-more:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.drop-more i {
    font-size: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem 3rem;
    text-align: center;
    min-width: 280px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

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

/* SEO Content Section */
.seo-content {
    max-width: 800px;
    margin: 3rem auto 2rem;
    padding: 0 1.5rem;
}

.seo-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.seo-article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.seo-article h3:first-child {
    margin-top: 0;
}

.seo-article p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.seo-article strong {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 900px) {
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .privacy-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .back-btn span,
    .privacy-badge span {
        display: none;
    }

    .btn span {
        display: none;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .results-actions {
        width: 100%;
    }

    .results-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .results-actions .btn span {
        display: inline;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .file-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 380px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }

    .seo-article {
        padding: 1.25rem;
    }

    .seo-article h3 {
        font-size: 1.1rem;
    }

    .seo-article p {
        font-size: 0.9rem;
    }
}
