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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 600px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-area.has-file {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    color: #666;
    font-size: 16px;
}

.file-name {
    color: #28a745;
    font-weight: 600;
    margin-top: 10px;
}

#file-input {
    display: none;
}

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

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
    text-align: left;
}

.message.error h1 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 2em;
}

.message.error h2 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 0.5em
}

.message.error h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 0.5em
}

.message.error strong {
    font-weight: 600;
}

.message.error code {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.message.error ul {
    margin: 2px 0 4px 0;
    padding-left: 20px;
    line-height: 1;
}

.message.error li {
    margin: 0;
    padding: 0;
}

.message.error hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 8px 0;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

.guide-section {
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.guide-toggle {
    color: #667eea;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.guide-toggle:hover {
    color: #764ba2;
}

.guide-content {
    display: none;
    margin-top: 20px;
}

.guide-content.show {
    display: block;
}

.guide-step {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.guide-step h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 16px;
}

.guide-step p {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.guide-step img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.guide-step img:hover {
    transform: scale(1.02);
}

/* Toggle switch styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
}

.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    flex-shrink: 0;
}

.help-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    padding: 12px 14px;
    background: #333;
    color: white;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.help-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

.help-icon:hover .help-tooltip {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .help-tooltip {
        width: 250px;
        left: auto;
        right: -10px;
        transform: none;
    }

    .help-tooltip::after {
        left: auto;
        right: 14px;
        transform: none;
    }
}
