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

body {
    font-family: 'Courier New', monospace;
    background: #f0f2f5;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(0,0,0,0.15) 1px, transparent 0);
    background-size: 20px 20px;
    color: #2d3748;
    line-height: 1.4;
}

.header {
    background: #fff;
    border-bottom: 3px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3748;
}

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #2d3748;
    background: #fff;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.1),
        0 2px 4px rgba(0,0,0,0.06);
}

.btn:hover {
    background: #2d3748;
    color: #fff;
    transform: translateY(-1px);
}

.btn-primary {
    background: #e53e3e;
    color: #fff;
    border-color: #e53e3e;
}

.btn-primary:hover {
    background: #c53030;
    border-color: #c53030;
}

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

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.search-container {
    background: #fff;
    border: 2px solid #2d3748;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.search-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #e53e3e;
}

.category-select {
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: #fff;
}

.site-container {
    background: #fff;
    border: 3px solid #2d3748;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.15),
        0 3px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.site-header {
    background: #2d3748;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-info {
    flex: 1;
}

.site-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.site-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.site-url {
    font-size: 0.8rem;
    opacity: 0.7;
    word-break: break-all;
}

.site-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 8px;
}

.badge-category {
    background: var(--category-color, #6366f1);
    color: #fff;
}

.iframe-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #f7fafc;
}

.iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #718096;
    font-size: 1.1rem;
}

.loading-spinner {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.site-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.iframe-error {
    background: #fed7d7;
    color: #c53030;
    padding: 2rem;
    text-align: center;
}

.stats-bar {
    background: #edf2f7;
    padding: 1rem;
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    text-transform: uppercase;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

.modal-content {
    background: #fff;
    border-radius: 12px;
    border: 3px solid #2d3748;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d3748;
    color: #fff;
    border-radius: 9px 9px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e53e3e;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Featured site styling */
.site-container.featured {
    border-color: #f59e0b;
    box-shadow: 
        0 8px 25px rgba(245, 158, 11, 0.2),
        0 3px 6px rgba(245, 158, 11, 0.1),
        0 0 0 1px rgba(245, 158, 11, 0.1);
}

.site-container.featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #f59e0b, #fbbf24, #f59e0b);
    border-radius: 14px;
    z-index: -1;
    opacity: 0.5;
}

.badge-featured {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #ffffff;
    border: 1px solid #d97706;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* View counter badge */
.badge-views {
    background: #e0f2fe;
    color: #0277bd;
    border: 1px solid #0277bd;
}

/* Dark Mode Toggle Switch */
.dark-mode-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.theme-toggle input[type="checkbox"] {
    display: none;
}

.slider {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    transition: background 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle input:checked + .slider {
    background: #2d3748;
}

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

.slider-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.slider-label.light {
    right: 8px;
    opacity: 1;
}

.slider-label.dark {
    left: 8px;
    opacity: 0;
}

.theme-toggle input:checked + .slider .slider-label.light {
    opacity: 0;
}

.theme-toggle input:checked + .slider .slider-label.dark {
    opacity: 1;
}

/* Enhanced Modal Styles */
.submission-intro {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #bae6fd;
}

.submission-intro p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #0369a1;
    font-weight: 500;
}

.benefits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.benefit-item {
    font-size: 0.9rem;
    color: #0284c7;
    font-weight: 500;
}

.form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-style: italic;
}

.submission-footer {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.review-notice {
    font-size: 0.9rem;
    color: #475569;
    text-align: center;
    line-height: 1.5;
}

/* Dark Mode */
body.dark-mode {
    background: #1a202c;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.1) 1px, transparent 0);
    color: #e2e8f0;
}

.dark-mode .header {
    background: #2d3748;
    border-bottom: 3px solid #4a5568;
}

.dark-mode .logo {
    color: #e2e8f0;
}

.dark-mode .btn {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #e2e8f0;
}

.dark-mode .btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.dark-mode .btn-primary {
    background: #c53030;
    border-color: #c53030;
}

.dark-mode .btn-primary:hover {
    background: #9b2c2c;
    border-color: #9b2c2c;
}

.dark-mode .search-container {
    background: #2d3748;
    border-color: #4a5568;
}

.dark-mode .search-input,
.dark-mode .category-select {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.dark-mode .search-input::placeholder {
    color: #a0aec0;
}

.dark-mode .site-container {
    background: #2d3748;
    border-color: #4a5568;
}

.dark-mode .site-header {
    background: #1a202c;
}

.dark-mode .iframe-container {
    background: #1a202c;
    border-top: 1px solid #4a5568;
}

.dark-mode .iframe-overlay {
    background: #2d3748;
    color: #a0aec0;
}

.dark-mode .stats-bar {
    background: #2d3748;
    border-top: 1px solid #4a5568;
}

.dark-mode .stat-number {
    color: #e2e8f0;
}

.dark-mode .stat-label {
    color: #a0aec0;
}

.dark-mode .error-message {
    background: #742a2a;
    color: #fed7d7;
}

.dark-mode .modal-content {
    background: #2d3748;
    border-color: #4a5568;
}

.dark-mode .modal-header {
    background: #1a202c;
    border-bottom-color: #4a5568;
}

.dark-mode .form-group label {
    color: #e2e8f0;
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.dark-mode .form-group input::placeholder,
.dark-mode .form-group textarea::placeholder {
    color: #a0aec0;
}

.dark-mode .submission-intro {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-color: #475569;
}

.dark-mode .submission-intro p {
    color: #7dd3fc;
}

.dark-mode .benefit-item {
    color: #38bdf8;
}

.dark-mode .form-hint {
    color: #94a3b8;
}

.dark-mode .submission-footer {
    background: #1e293b;
    border-color: #475569;
}

.dark-mode .review-notice {
    color: #cbd5e1;
}

.dark-mode .badge-views {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #3b82f6;
}

.dark-mode .slider {
    background: #4a5568;
}

.dark-mode .theme-toggle input:checked + .slider {
    background: #e2e8f0;
}

.dark-mode .site-container.featured {
    border-color: #f59e0b;
    box-shadow: 
        0 8px 25px rgba(245, 158, 11, 0.3),
        0 3px 6px rgba(245, 158, 11, 0.2),
        0 0 0 1px rgba(245, 158, 11, 0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .controls {
        justify-content: center;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .iframe-container {
        height: 400px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
}