body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f4f4;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Small site-info banner placed at top of body for quick crawlers and users */
.site-info {
    background: linear-gradient(90deg, #e9f7ef, #f0fbff);
    color: #083344;
    padding: 8px 20px;
    text-align: center;
    font-size: 14px;
}
.site-info .site-info-text a { color: #0b6fb6; font-weight: 600; text-decoration: none; }
.site-info .site-info-text a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.theme-toggle {
    padding: 10px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    margin: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main container - full width */
.container {
    flex: 1;
    width: 100%;
    padding: 30px 40px;
    box-sizing: border-box;
}

.container h1 {
    margin: 0 0 10px 0;
    color: #1a1a2e;
}

.subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

/* TEXTAREA, BUTTON, etc stay normal */
textarea {
    width: 100%;
    max-width: 900px;
    height: 200px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.input-controls {
    display: flex;
    gap: 12px;
    margin: 15px 0 30px 0;
    flex-wrap: wrap;
    align-items: center;
}

#keySelector {
    padding: 12px 15px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    min-width: 250px;
    cursor: pointer;
}

button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#prettifyBtn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

#generateBtn {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.export-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

#completeTestingBtn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

/* Output Section */
.output-section h2 {
    margin: 0 0 15px 0;
    color: #1a1a2e;
}

#output-header {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* The Output uses full width with two columns */
#output-container {
    width: 100%;
    display: flex;
    gap: 24px;
}

.output-column {
    flex: 1;
    min-width: 0;
}

.output-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Each test case */
#output pre {
    background: white;
    padding: 15px;
    border: 1px solid #ddd;
    overflow-x: auto;
}

.copy-container {
    position: relative;
    border: 2px solid #e0e0e0;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.copy-container pre {
    margin: 0;
    padding-right: 120px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.copy-container pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.copy-container pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.copy-container pre::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.test-btn, .copy-btn-inside {
    position: absolute;
    top: 10px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin: 0;
}

.test-btn {
    right: 70px;
    background: #2196F3;
    color: white;
}

.test-btn:hover {
    background: #1976D2;
}

.test-btn.tested {
    background: #4CAF50;
}

.copy-btn-inside {
    right: 10px;
    background: #333;
    color: white;
}

.copy-btn-inside:hover {
    background: #000;
}

/* Tested card styling */
.copy-container.tested {
    border-color: #4CAF50;
    background: linear-gradient(to bottom right, #fff, #f0fff0);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.footer .small { font-size: 12px; color: #cfcfcf; margin-top: 8px; }
.footer a { color: #9ecbff; }

/* Feedback form styles */
.feedback-container {
    max-width: 820px;
    margin: 24px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.feedback-container h2 { margin-top: 0; }
.feedback-form .form-group { margin-bottom: 12px; }
.feedback-input, .feedback-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
}
.feedback-textarea { min-height: 160px; resize: vertical; }
.feedback-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }
.feedback-actions .btn { padding: 10px 16px; border-radius: 8px; cursor: pointer; }
.btn-primary.feedback { background: linear-gradient(135deg,#4CAF50,#45a049); color: white; border: none; }
.btn-secondary.feedback { background: #eee; border: none; }

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-links a {
    color: #4da6ff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

.separator {
    margin: 0 10px;
    color: #666;
}

/* Key selector completed state */
#keySelector option.completed {
    background-color: #d4edda;
    color: #155724;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 20px;
    }
    
    #output-container {
        flex-direction: column;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .input-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #keySelector {
        min-width: auto;
        width: 100%;
    }
    
    textarea {
        max-width: 100%;
    }
}

/* Dark Mode */
body.dark-mode {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .container h1,
body.dark-mode .container h2 {
    color: #fff;
}

body.dark-mode .subtitle {
    color: #aaa;
}

body.dark-mode textarea {
    background: #16213e;
    color: #e0e0e0;
    border-color: #0f3460;
}

body.dark-mode #keySelector {
    background: #16213e;
    color: #e0e0e0;
    border-color: #0f3460;
}

body.dark-mode .copy-container {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .copy-container pre {
    color: #e0e0e0;
}

body.dark-mode .copy-container.tested {
    background: linear-gradient(to bottom right, #16213e, #1e4620);
    border-color: #4CAF50;
}
