/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.domain-info {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 25px;
    font-size: 0.9rem;
    display: inline-block;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    color: #666;
}

/* Section Styles */
.section {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.section.active {
    display: block;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

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

/* Upload Section Styles */
.upload-area {
    text-align: center;
    padding: 50px 20px;
    border: 3px dashed #ccc;
    border-radius: 15px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.file-info.hidden {
    display: none;
}

.example-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.example-section pre {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    border: 1px solid #e9ecef;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
}

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

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

.btn.secondary {
    background: #6c757d;
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn.danger {
    background: #dc3545;
    color: white;
}

.btn.danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

/* Processing Section Styles */
.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stats,
.results-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

/* Progress Bar Styles */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

/* Controls and Settings */
.controls {
    margin-bottom: 30px;
    text-align: center;
}

.settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-item label {
    font-weight: 600;
    min-width: 200px;
}

.setting-item input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Log Styles */
.log-container {
    margin-top: 30px;
}

.log-output {
    background: #000;
    color: #00ff00;
    padding: 20px;
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.log-output.hidden {
    display: none;
}

.log-controls {
    margin-top: 10px;
}

/* Results Section Styles */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.download-options {
    margin-bottom: 30px;
}

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

/* Preview Styles */
.preview-container {
    margin-bottom: 30px;
}

.preview-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: bold;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.preview-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.preview-content pre {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-top: 30px;
}

footer p {
    margin-bottom: 10px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .processing-header,
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .stats,
    .results-stats {
        width: 100%;
        justify-content: space-between;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .setting-item label {
        min-width: auto;
    }

    .download-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Animation for loading states */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Success and Error States */
.success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #28a745;
}

.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
}

.warning {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.error-details-content {
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Error Summary Styles */
.error-summary {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.error-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.error-stat-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    min-width: 120px;
}

.error-stat-label {
    font-weight: 600;
    color: #666;
    display: block;
    font-size: 0.9rem;
}

.error-stat-value {
    font-weight: bold;
    color: #dc3545;
    font-size: 1.2rem;
    display: block;
    margin-top: 5px;
}

/* Enhanced Log Controls */
.log-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Footer Enhancement */
footer {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

footer p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}
