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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1em;
    opacity: 0.95;
}

.main-content {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.label-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
}

.upload-area {
    position: relative;
    border: 3px dashed #d0d0d0;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8edff;
    transform: scale(1.02);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

.upload-placeholder p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 5px;
}

.upload-placeholder small {
    color: #888;
}

.file-list {
    margin-top: 15px;
}

.file-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #667eea;
}

.file-item span {
    flex: 1;
    color: #333;
}

.file-item button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.file-item button:hover {
    background: #e73d4a;
}

.button-group {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: white;
    color: #ff4757;
    border: 2px solid #ff4757;
}

.btn-danger:hover {
    background: #ff4757;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.3);
}

.preview-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.preview-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.preview-group {
    margin-bottom: 25px;
}

.preview-group h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.preview-list {
    background: white;
    border-radius: 10px;
    padding: 15px;
}

.preview-item {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
}

.preview-item:last-child {
    border-bottom: none;
}

.original-name {
    color: #666;
    text-align: right;
}

.arrow {
    color: #667eea;
    font-weight: bold;
    font-size: 1.2em;
}

.renamed-name {
    color: #28a745;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ff4757;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.success-message {
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

footer {
    background: #f8f9fa;
    padding: 30px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

footer p {
    margin-bottom: 8px;
}

.info-text {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 10px;
    color: #333;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .preview-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .original-name {
        text-align: center;
    }
}
