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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: rgb(0, 0, 0);
    min-height: 100vh;
    padding: 20px;
    color: rgb(161, 161, 170);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgb(24, 24, 27);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

header {
    background: rgb(0, 0, 0);
    color: white;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 2px solid rgb(20, 184, 166);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: white;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
    color: rgb(161, 161, 170);
}

header a:hover {
    opacity: 1 !important;
}

main {
    padding: 30px;
    background: rgb(24, 24, 27);
}

section {
    margin-bottom: 30px;
}

h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid rgb(20, 184, 166);
    padding-bottom: 10px;
}

/* File Upload */
.file-upload {
    margin-bottom: 20px;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.file-button {
    display: inline-block;
    padding: 12px 24px;
    background: rgb(20, 184, 166);
    color: white;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s;
}

.file-button:hover {
    background: rgb(13, 148, 136);
}

.file-name {
    color: rgb(161, 161, 170);
    font-style: italic;
}

input[type="file"] {
    display: none;
}

/* Textarea */
.textarea-container {
    margin-bottom: 20px;
}

.textarea-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: white;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(20, 184, 166, 0.3);
    border-radius: 6px;
    font-family: "Courier New", monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
    background: rgb(0, 0, 0);
    color: rgb(161, 161, 170);
}

textarea:focus {
    outline: none;
    border-color: rgb(20, 184, 166);
}

/* Options */
.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: white;
}

select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(20, 184, 166, 0.3);
    border-radius: 6px;
    font-size: 14px;
    background: rgb(0, 0, 0);
    color: rgb(161, 161, 170);
    cursor: pointer;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: rgb(20, 184, 166);
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: rgb(161, 161, 170);
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgb(20, 184, 166);
}

.checkbox-group span {
    font-size: 15px;
    color: rgb(161, 161, 170);
}

/* Buttons */
.analyze-btn,
.download-btn,
.copy-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.analyze-btn {
    background: rgb(20, 184, 166);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(20, 184, 166, 0.4);
    background: rgb(13, 148, 136);
}

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

.download-btn,
.copy-btn {
    background: rgb(20, 184, 166);
    color: white;
}

.download-btn:hover,
.copy-btn:hover {
    background: rgb(13, 148, 136);
}

/* Results */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgb(0, 0, 0);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid rgb(20, 184, 166);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: rgb(161, 161, 170);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: rgb(20, 184, 166);
}

.output-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.output-container {
    background: rgb(0, 0, 0);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 6px;
    max-height: 500px;
    overflow: auto;
}

#output {
    margin: 0;
    padding: 20px;
    font-family: "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: rgb(161, 161, 170);
}

/* Error */
.error-section {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 6px;
    padding: 20px;
    color: rgb(248, 113, 113);
}

.error-section h3 {
    margin-bottom: 10px;
    color: rgb(248, 113, 113);
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(20, 184, 166, 0.3);
    border-top-color: rgb(20, 184, 166);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

/* Footer */
footer {
    background: rgb(0, 0, 0);
    padding: 40px 30px;
    color: rgb(161, 161, 170);
    font-size: 0.95em;
    line-height: 1.6;
    border-top: 1px solid rgba(20, 184, 166, 0.3);
}

.about-section {
    max-width: 900px;
    margin: 0 auto 30px;
    text-align: left;
}

.about-section h2 {
    color: white;
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
}

.about-section h3 {
    color: rgb(20, 184, 166);
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 12px;
}

.about-section p {
    margin: 10px 0;
    color: rgb(161, 161, 170);
}

.about-section ul {
    margin: 15px 0 15px 30px;
    color: rgb(161, 161, 170);
}

.about-section li {
    margin: 8px 0;
}

.about-section a {
    color: rgb(20, 184, 166);
    text-decoration: none;
    font-weight: 600;
}

.about-section a:hover {
    text-decoration: underline;
}

.about-section strong {
    color: white;
}

footer .credits {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(20, 184, 166, 0.3);
    font-size: 0.9em;
}

.subtitle {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.85;
    font-style: italic;
    color: rgb(161, 161, 170);
}

footer p {
    margin: 5px 0;
}

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

    .output-controls {
        flex-direction: column;
    }

    .download-btn,
    .copy-btn {
        width: 100%;
    }
}
