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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #222222;
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    background: linear-gradient(135deg, #222222 0%, #444444 100%);
    color: #eeeeee;
    padding: 30px;
    text-align: center;
}

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

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Removed API link styles - no public API access */

.main-content {
    padding: 40px;
}

/* Flash Messages */
.flash-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.flash-error {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b7a;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.flash-info {
    background: rgba(13, 110, 253, 0.15);
    color: #66b3ff;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.flash-success {
    background: rgba(25, 135, 84, 0.15);
    color: #6fbf73;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.upload-box {
    border: 2px dashed #666666;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(68, 68, 68, 0.3);
    position: relative;
}

.upload-box:hover {
    border-color: #888888;
    background: rgba(68, 68, 68, 0.5);
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: #888888;
    background: rgba(68, 68, 68, 0.5);
}

.upload-box h3 {
    color: #eeeeee;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-box p {
    color: #cccccc;
    opacity: 0.9;
    margin-bottom: 20px;
}

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

.upload-btn {
    background: linear-gradient(135deg, #444444 0%, #666666 100%);
    color: #eeeeee;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    transform: translateY(-1px);
}

.file-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.file-status.success {
    background: rgba(25, 135, 84, 0.3);
    color: #6fbf73;
}

.file-status.error {
    background: rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
}

.textarea-section {
    margin-bottom: 30px;
}

.textarea-section h3 {
    color: #eeeeee;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

textarea {
    width: 100%;
    height: 150px;
    max-height: 300px;
    padding: 15px;
    border: 2px solid #666666;
    border-radius: 10px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #444444;
    color: #eeeeee;
    overflow-y: auto;
}

textarea:focus {
    outline: none;
    border-color: #888888;
}

.process-section {
    text-align: center;
    margin: 30px 0;
}

.filter-mode-section,
.header-option-section {
    background: rgba(68, 68, 68, 0.3);
    border: 1px solid #666666;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
}

.filter-mode-section h3,
.header-option-section h3 {
    color: #eeeeee;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.toggle-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #444444;
    border: 2px solid #666666;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.toggle-option:hover {
    border-color: #888888;
    background: #555555;
    transform: translateY(-1px);
}

.toggle-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #888888;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.toggle-option input[type="radio"]:checked + .radio-custom {
    border-color: #cccccc;
    background: #cccccc;
}

.toggle-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.toggle-option input[type="radio"]:checked ~ .toggle-text {
    color: #eeeeee;
    font-weight: 600;
}

.toggle-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #cccccc;
    margin-bottom: 5px;
    display: block;
}

.toggle-description {
    font-size: 0.9rem;
    color: #cccccc;
    opacity: 0.8;
    display: block;
    line-height: 1.4;
}

.header-checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #444444;
    border: 2px solid #666666;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-checkbox-option span {
    color: #eeeeee;
    font-weight: 500;
}

.header-checkbox-option:hover {
    border-color: #888888;
    background: #555555;
}

input[type="checkbox"] {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid #666666;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: #333333;
}

input[type="checkbox"]:checked {
    border-color: #cccccc;
    background: #cccccc;
}

input[type="checkbox"]:checked::after {
    content: '✔';
    color: #333333;
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.process-btn {
    background: linear-gradient(135deg, #444444 0%, #666666 100%);
    color: #eeeeee;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #555555 0%, #777777 100%);
}

.process-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.stat-card {
    background: #333333;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #666666;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #eeeeee;
}

.stat-label {
    color: #cccccc;
    opacity: 0.9;
    font-size: 0.9rem;
    margin-top: 5px;
}

.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: #eeeeee;
    font-size: 1.3rem;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-btn {
    background: #444444;
    color: #eeeeee;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-btn:hover {
    background: #666666;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: #333333;
    border: 1px solid #666666;
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: #eeeeee;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #555555;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-table th {
    background: #444444;
    font-weight: bold;
    color: #eeeeee;
    white-space: normal;
}

.results-table td {
    white-space: nowrap;
}

.results-table tr:nth-child(even) {
    background: #2a2a2a;
}

.results-table tr:hover {
    background: #555555;
}

.results-box {
    background: #333333;
    border: 1px solid #666666;
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #cccccc;
    opacity: 0.8;
}

.spinner {
    border: 3px solid rgba(204, 204, 204, 0.2);
    border-top: 3px solid #888888;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.highlight {
    background-color: #888888;
    color: #222222;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.no-matches {
    color: #cccccc;
    opacity: 0.6;
    font-style: italic;
}

.quick-start-box {
    margin-top: 40px;
    padding: 20px;
    background: #372549;
    border-radius: 10px;
}

.quick-start-box h3 {
    color: #eacdc2;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.quick-start-box ol {
    color: #eacdc2;
    margin-left: 20px;
    line-height: 1.6;
}

.quick-start-box li {
    margin-bottom: 8px;
}

.quick-start-box p {
    color: #eacdc2;
    opacity: 0.8;
    margin-top: 15px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-section {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .export-buttons {
        justify-content: center;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
    
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}

/* CAPTCHA Styles */
.captcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.captcha-box {
    background: #333333;
    border: 1px solid #666666;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.captcha-icon {
    font-size: 3rem;
    color: #888888;
    margin-bottom: 20px;
}

.captcha-box h2 {
    color: #eeeeee;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.captcha-box p {
    color: #cccccc;
    margin-bottom: 25px;
    line-height: 1.5;
}

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

.captcha-question {
    background: #444444;
    border: 2px solid #666666;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #eeeeee;
}

.captcha-question label {
    display: block;
    margin: 0;
    font-size: 1.3rem;
}

.captcha-input {
    margin-bottom: 25px;
}

.captcha-input .form-input {
    width: 200px;
    padding: 12px 20px;
    font-size: 1.1rem;
    text-align: center;
    background: #444444;
    color: #eeeeee;
    border: 2px solid #666666;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.captcha-input .form-input:focus {
    outline: none;
    border-color: #888888;
    background: #555555;
}

.captcha-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.captcha-actions .btn-primary,
.captcha-actions .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.captcha-actions .btn-primary {
    background: #666666;
    color: #eeeeee;
}

.captcha-actions .btn-primary:hover {
    background: #888888;
    transform: translateY(-2px);
}

.captcha-actions .btn-secondary {
    background: #444444;
    color: #cccccc;
    border: 1px solid #666666;
}

.captcha-actions .btn-secondary:hover {
    background: #555555;
    color: #eeeeee;
}

.captcha-info {
    background: #2a2a2a;
    border: 1px solid #555555;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    color: #cccccc;
    font-size: 0.9rem;
}

.captcha-info p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #eeeeee;
}

.captcha-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.captcha-info li {
    margin-bottom: 5px;
}

.captcha-info small {
    color: #aaaaaa;
    font-style: italic;
}
