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

:root {
    --primary-color: #1877f2;
    --primary-hover: #145dbf;
    --error-color: #f02849;
    --error-bg: #fff2f4;
    --border-color: #dddfe2;
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --background: #f0f2f5;
    --card-bg: #ffffff;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

/* Main content */
main {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

main:hover {
    box-shadow: var(--shadow-hover);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(24, 119, 242, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upload-text strong {
    color: var(--primary-color);
}

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

/* File info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: rgba(24, 119, 242, 0.05);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    margin-top: 1rem;
}

.file-info span {
    font-weight: 500;
    color: var(--primary-color);
}

.remove-file {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

/* Textarea */
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea::placeholder {
    color: var(--text-secondary);
}

/* Submit button */
.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    margin-top: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error message */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1.5rem;
    background-color: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
}

.error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.error-message strong {
    display: block;
    margin-bottom: 0.25rem;
}

.error-message p {
    color: #5a1a1a;
    margin: 0;
}

/* Help section */
.help-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.help-section summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.help-section summary:hover {
    color: var(--primary-color);
}

.help-content {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--background);
    border-radius: 8px;
}

.help-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.help-content h3:first-child {
    margin-top: 0;
}

.help-content pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.help-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.help-content ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.help-content ul li {
    padding: 0.25rem 0;
}

/* Responsive design */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem;
    }

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

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .submit-button {
        font-size: 1rem;
    }
}
