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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #363636;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --border: #404040;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #eab308;
    --male-color: #3b82f6;
    --female-color: #ec4899;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--accent);
}

.logo svg {
    width: 100%;
    height: 100%;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

.guide-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.guide-link:hover {
    background: var(--accent);
    color: white;
}

.guide-link svg {
    width: 16px;
    height: 16px;
}

/* Main Section */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Ped Selector */
.ped-selector {
    margin-top: 10px;
}

.ped-selector h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.ped-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ped-option {
    cursor: pointer;
}

.ped-option input {
    display: none;
}

.ped-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.ped-box svg {
    width: 24px;
    height: 24px;
}

.ped-option input:checked + .ped-box.male {
    border-color: var(--male-color);
    background: rgba(59, 130, 246, 0.1);
    color: var(--male-color);
}

.ped-option input:checked + .ped-box.female {
    border-color: var(--female-color);
    background: rgba(236, 72, 153, 0.1);
    color: var(--female-color);
}

.ped-box:hover {
    border-color: var(--text-muted);
}

/* Upload Info */
.upload-info {
    margin-bottom: 20px;
}

.info-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 16px;
}

.info-card svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-card div strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.info-card div p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.naming-examples {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.example {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.example-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
}

.example code {
    font-family: 'Monaco', 'Consolas', monospace;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.8rem;
}

.component-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.component-tags span {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Info Card Warning */
.info-card.warning {
    border-left: 4px solid var(--warning);
}

.info-card.warning svg {
    color: var(--warning);
}

/* Upload Method Selector */
.upload-method-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.method-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 28px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.method-option input {
    display: none;
}

.method-option svg {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.method-option span {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.method-option small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.method-option:hover {
    border-color: var(--text-muted);
}

.method-option.active {
    border-color: var(--accent);
    background: rgba(249, 115, 22, 0.08);
}

.method-option.active svg {
    color: var(--accent);
}

.method-option.active span {
    color: var(--accent);
}

.method-option.active small {
    color: var(--text-secondary);
}

/* Main Dropzone */
.dropzone-main {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-tertiary);
}

.dropzone-main:hover,
.dropzone-main.dragover {
    border-color: var(--accent);
    background: rgba(249, 115, 22, 0.05);
}

.dropzone-main svg {
    width: 56px;
    height: 56px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.dropzone-main h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dropzone-main p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.dropzone-main > span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.file-label {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* File Stats */
.file-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 700px) {
    .file-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 450px) {
    .file-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

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

/* File List Container */
.file-list-container {
    margin-top: 20px;
}

.file-list-container h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

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

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

.file-badges {
    display: flex;
    gap: 6px;
}

.file-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-badge.male {
    background: rgba(59, 130, 246, 0.2);
    color: var(--male-color);
}

.file-badge.female {
    background: rgba(236, 72, 153, 0.2);
    color: var(--female-color);
}

.file-badge.component {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.file-badge.prop {
    background: rgba(249, 115, 22, 0.2);
    color: var(--accent);
}

.file-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

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

.file-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background: var(--error);
    color: white;
}

.file-remove svg {
    width: 18px;
    height: 18px;
}

/* Structure Preview */
.structure-preview {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    max-height: 400px;
    overflow-y: auto;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.preview-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.structure-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-folder {
    color: var(--accent);
}

.tree-file {
    color: var(--text-primary);
}

.tree-indent {
    color: var(--text-muted);
}

/* Action Bar */
.action-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-primary svg {
    width: 22px;
    height: 22px;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Progress */
.progress-container {
    width: 100%;
    max-width: 500px;
}

.progress-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

.progress-text {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 420px;
    border: 1px solid var(--border);
    animation: modalSlide 0.4s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.modal-icon svg {
    width: 36px;
    height: 36px;
}

.modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.modal-content > p {
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-actions .btn-primary {
    justify-content: center;
}

/* Footer */
footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    section {
        padding: 16px;
    }

    .upload-method-selector {
        flex-direction: column;
        gap: 12px;
    }

    .method-option {
        flex-direction: row;
        padding: 16px 20px;
    }

    .method-option svg {
        width: 28px;
        height: 28px;
    }

    .method-option span {
        font-size: 1rem;
    }

    .dropzone-main {
        padding: 36px 20px;
    }

    .ped-options {
        flex-direction: column;
    }

    .ped-box {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        margin: 16px;
        padding: 24px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Spinner Animation */
.spinner {
    animation: spin 1s linear infinite;
}

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