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

:root {
    /* Light theme colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #6b7280;
    --accent-color: #10b981;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --key-bg: #ffffff;
    --key-border: #d1d5db;
    --key-pressed: #3b82f6;
    --key-pressed-bg: #dbeafe;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --secondary-color: #9ca3af;
    --accent-color: #34d399;
    --background-color: #111827;
    --surface-color: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --key-bg: #374151;
    --key-border: #4b5563;
    --key-pressed: #60a5fa;
    --key-pressed-bg: #1e3a8a;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    background-color: var(--background-color);
    line-height: 1;
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    background-color: var(--surface-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 3px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: 0.3s;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Page Header */
.page-header {
    padding: 3rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tester Section */
.tester-section {
    padding: 2rem 0 4rem;
}

.tester-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Keyboard Styles */
.keyboard-container {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
    overflow-x: auto;
}

.keyboard-row {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    min-width: max-content;
}

.key {
    background-color: var(--key-bg);
    border: 2px solid var(--key-border);
    border-radius: 6px;
    padding: 0.75rem 0.5rem;
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.1s ease;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    color: var(--text-primary);
}

.key:hover {
    background-color: var(--key-pressed-bg);
    border-color: var(--key-pressed);
}

.key.pressed {
    background-color: var(--key-pressed-bg);
    border-color: var(--key-pressed);
    color: var(--key-pressed);
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key.tested {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.key.tested:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.key.pressed.tested {
    background-color: var(--key-pressed);
    border-color: var(--key-pressed);
    color: white;
    transform: scale(0.95);
}

.key.wide-key {
    min-width: 80px;
}

.key.extra-wide-key {
    min-width: 100px;
}

.key.function-key {
    min-width: 50px;
    font-size: 0.75rem;
}

.spacebar {
    min-width: 300px;
}

.arrow-keys {
    margin-top: 1rem;
    justify-content: center;
}

.arrow-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.arrow-row {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.arrow-key {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

/* Key Log */
.key-log {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.key-log h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.log-container {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
}

.log-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.key-entry {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.key-entry:last-child {
    border-bottom: none;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: var(--surface-color);
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.feature p {
    color: var(--text-secondary);
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
}

.content-article {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 2rem;
}

.content-article h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.content-article p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-article ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content-article li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.contact-method h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.email-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.email-link:hover {
    text-decoration: underline;
}

.response-time {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 8px;
}

.contact-form-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-note {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-notice {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--warning-color);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
}

.faq-section h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.faq-item {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.faq-item h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-secondary);
}

/* Privacy Summary */
.privacy-summary {
    background-color: var(--accent-color);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.privacy-summary h3 {
    color: white;
    margin-bottom: 1rem;
}

.privacy-summary p {
    color: white;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        gap: 1rem;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .tester-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .stats {
        justify-content: center;
    }
    
    .keyboard-container {
        padding: 1rem;
        overflow-x: auto;
    }
    
    .key {
        min-width: 35px;
        height: 35px;
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    .key.wide-key {
        min-width: 60px;
    }
    
    .key.extra-wide-key {
        min-width: 80px;
    }
    
    .spacebar {
        min-width: 200px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .features h2 {
        font-size: 2rem;
    }
    
    .content-article h2 {
        font-size: 1.5rem;
    }
    
    .content-article h3 {
        font-size: 1.25rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 2rem 0 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .keyboard-container {
        padding: 0.5rem;
    }
    
    .keyboard-row {
        gap: 0.125rem;
    }
    
    .key {
        min-width: 28px;
        height: 28px;
        font-size: 0.65rem;
        padding: 0.25rem;
    }
    
    .key.wide-key {
        min-width: 45px;
    }
    
    .key.extra-wide-key {
        min-width: 60px;
    }
    
    .spacebar {
        min-width: 150px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature {
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes keyPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.key.animate {
    animation: keyPress 0.1s ease-in-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.key:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .theme-toggle {
        display: none;
    }
    
    * {
        box-shadow: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}