/* ===== VARIABLES ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --accent: #4ecdc4;
    --accent-hover: #3dbdb5;
    --accent-dim: rgba(78, 205, 196, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --success: #2ecc71;
    --success-dim: rgba(46, 204, 113, 0.1);
    --error: #e74c3c;
    --error-dim: rgba(231, 76, 60, 0.1);
    --warning: #f39c12;
    --border: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(78, 205, 196, 0.3);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ===== FORM GROUP ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.select-store {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select-store:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.select-store optgroup {
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
}

.select-store option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

/* ===== DROPZONE ===== */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    margin-bottom: 20px;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.dropzone-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
}

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

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

/* ===== FILE LIST ===== */
.file-list-container {
    margin-bottom: 25px;
}

.file-list-container h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.file-item.converted {
    background: var(--success-dim);
    border-color: rgba(46, 204, 113, 0.3);
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

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

.file-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.file-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.file-badge.converted {
    background: var(--success-dim);
    color: var(--success);
}

.file-badge.direct {
    background: var(--accent-dim);
    color: var(--accent);
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

/* ===== BUTTONS ===== */
.btn-upload {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, var(--accent), #3dbdb5);
    color: var(--bg-primary);
}

.btn-upload:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

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

.btn-primary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, var(--accent), #3dbdb5);
    color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.3);
}

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

.btn-secondary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-secondary);
}

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

/* ===== SUCCESS SECTION ===== */
.success-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    border: 1px solid rgba(46, 204, 113, 0.3);
    box-shadow: var(--shadow);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--success);
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.success-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.success-details ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.success-details li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.success-details li:last-child {
    border-bottom: none;
}

/* ===== ERROR SECTION ===== */
.error-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    border: 1px solid rgba(231, 76, 60, 0.3);
    box-shadow: var(--shadow);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--error);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-counter {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-filename {
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 20px;
    word-break: break-all;
}

.modal-instructions {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-instructions p {
    margin-bottom: 12px;
}

.modal-instructions ol {
    padding-left: 20px;
}

.modal-instructions li {
    margin-bottom: 8px;
}

.modal-instructions kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.modal-textarea {
    width: 100%;
    min-height: 200px;
    max-height: 300px;
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.modal-textarea::placeholder {
    color: var(--text-muted);
}

.modal-char-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .dropzone {
        padding: 30px 20px;
    }
    
    .dropzone-icon {
        font-size: 2.5rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* ===== SUCCESS DETAILS V2 ===== */
.success-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.detail-row.highlight {
    background: var(--accent-dim);
    margin: 10px -15px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.detail-secondary {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.detail-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-file {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.detail-file:last-child {
    margin-bottom: 0;
}

.detail-file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.detail-file-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-file-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
}