/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --card-light: #ffffff;
    --card-dark: #2a2a3e;
    --text-light: #333333;
    --text-dark: #e0e0e0;
    --border-light: #e9ecef;
    --border-dark: #4a4a6e;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
    transition: var(--transition);
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.dark-mode .navbar {
    background: rgba(26, 26, 46, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

.nav-link:hover,
.nav-link.active {
    color: #667eea;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
}

/* Hero Small Variant */
.hero-small {
    padding: 3rem 2rem;
}

.hero-small h1 {
    font-size: 2.5rem;
}

.hero-small .hero-subtitle {
    font-size: 1.1rem;
}

/* Content Page Styles */
.content-page {
    background: var(--card-light);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.dark-mode .content-page {
    background: var(--card-dark);
}

.content-section {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #667eea;
}

.content-section h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #6c757d;
}

.dark-mode .content-section p {
    color: #a0a0b0;
}

.content-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section ul li {
    line-height: 1.8;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.dark-mode .content-section ul li {
    color: #a0a0b0;
}

.content-section a {
    color: #667eea;
    text-decoration: none;
    transition: var(--transition);
}

.content-section a:hover {
    text-decoration: underline;
}

.last-updated {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.dark-mode .last-updated {
    color: #a0a0b0;
    border-color: var(--border-dark);
}

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

/* App Card */
.app-card {
    background: var(--card-light);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    transition: var(--transition);
}

.dark-mode .app-card {
    background: var(--card-dark);
}

/* Input Section */
.input-section {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

#text-input {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    resize: vertical;
    transition: var(--transition);
    background: var(--card-light);
    color: var(--text-light);
}

.dark-mode #text-input {
    background: #1a1a2e;
    color: var(--text-dark);
    border-color: var(--border-dark);
}

#text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.control-label {
    font-weight: 600;
    font-size: 0.95rem;
}

select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--card-light);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.dark-mode select {
    background: #1a1a2e;
    color: var(--text-dark);
    border-color: var(--border-dark);
}

select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-family);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-mode {
    background: var(--accent-gradient);
    color: white;
}

.btn-icon {
    font-size: 1.1rem;
}

/* Search */
.search-section {
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    transition: var(--transition);
    background: var(--card-light);
    color: var(--text-light);
}

.dark-mode #search-input {
    background: #1a1a2e;
    color: var(--text-dark);
    border-color: var(--border-dark);
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    overflow-x: auto;
}

.dark-mode .tabs {
    border-color: var(--border-dark);
}

.tab {
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    color: inherit;
    white-space: nowrap;
}

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

.tab.active {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

/* Keyboard */
.keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.key {
    padding: 1rem 0.5rem;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    user-select: none;
    font-weight: 500;
}

.dark-mode .key {
    background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
    border-color: var(--border-dark);
}

.key:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.dark-mode .key:hover {
    background: linear-gradient(135deg, #4a4a6e 0%, #3a3a4e 100%);
}

.key:active {
    transform: translateY(0);
}

.symbol-key {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #90caf9;
}

.symbol-key:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

/* Features Section */
.features-section {
    margin-bottom: 4rem;
}

.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

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

.feature-card {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.dark-mode .feature-card {
    background: var(--card-dark);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.7;
}

.dark-mode .feature-card p {
    color: #a0a0b0;
}

/* How It Works */
.how-it-works {
    margin-bottom: 4rem;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

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

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.step p {
    color: #6c757d;
    line-height: 1.7;
}

.dark-mode .step p {
    color: #a0a0b0;
}

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

.faq-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dark-mode .faq-item {
    background: var(--card-dark);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #667eea;
}

.faq-item p {
    color: #6c757d;
    line-height: 1.7;
}

.dark-mode .faq-item p {
    color: #a0a0b0;
}

/* Footer */
.footer {
    background: var(--card-light);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.dark-mode .footer {
    background: var(--card-dark);
}

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

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: #6c757d;
    line-height: 1.7;
}

.dark-mode .footer-section p {
    color: #a0a0b0;
}

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

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

.footer-section a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    color: #6c757d;
}

.dark-mode .footer-bottom {
    border-color: var(--border-dark);
    color: #a0a0b0;
}

/* Popup and Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: popupAppear 0.3s ease-out;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.popup p {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

/* Floating Animation */
.floating {
    animation: float 2s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-20px) rotate(5deg);
    }

    50% {
        transform: translateY(-40px) rotate(0deg);
    }

    75% {
        transform: translateY(-20px) rotate(-5deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features-section h2,
    .how-it-works h2,
    .faq-section h2 {
        font-size: 2rem;
    }

    .keyboard {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .key {
        padding: 0.75rem 0.25rem;
        font-size: 1.1rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }
}