:root {
    --steam-dark: #1b2838;
    --steam-darker: #0e1419;
    --steam-blue: #1a9fff;
    --steam-light-blue: #66c0f4;
    --steam-accent: #c7d5e0;
    --steam-gradient: linear-gradient(135deg, #1a9fff 0%, #66c0f4 100%);
    --text-primary: #c7d5e0;
    --text-secondary: #8f98a0;
    --surface: #1e2329;
    --surface-hover: #252c35;
    --spoiler-colour: #1e2329;
}

/* Light theme variables */
[data-theme="light"] {
    --steam-dark: #e8f1f5;
    --steam-darker: #f5f9fb;
    --steam-blue: #1a9fff;
    --steam-light-blue: #0d7bc4;
    --steam-accent: #2c3e50;
    --steam-gradient: linear-gradient(135deg, #1a9fff 0%, #0d7bc4 100%);
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --surface: #ffffff;
    --surface-hover: #f0f4f7;
}

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

body {
    font-family: 'Archivo', sans-serif;
    background: var(--steam-darker);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(26, 159, 255, 0.02) 35px, rgba(26, 159, 255, 0.02) 70px),
        radial-gradient(ellipse at 20% 30%, rgba(26, 159, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(102, 192, 244, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
}

[data-theme="light"] .background-pattern {
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(26, 159, 255, 0.03) 35px, rgba(26, 159, 255, 0.03) 70px),
        radial-gradient(ellipse at 20% 30%, rgba(26, 159, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(13, 123, 196, 0.08) 0%, transparent 50%);
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: slideDown 0.6s ease-out;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid rgba(26, 159, 255, 0.2);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--steam-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 159, 255, 0.3);
}

.theme-toggle svg {
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

.theme-toggle:hover svg {
    transform: rotate(20deg) scale(1.1);
}

.header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    letter-spacing: 0.1em;
    background: var(--steam-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(26, 159, 255, 0.3);
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid rgba(26, 159, 255, 0.2);
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.github-link:hover {
    background: var(--surface-hover);
    border-color: var(--steam-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 159, 255, 0.3);
}

.github-link svg {
    transition: transform 0.3s ease;
}

.github-link:hover svg {
    transform: rotate(360deg);
}

.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.panel {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(26, 159, 255, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .panel {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.panel-header {
    background: var(--steam-dark);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--steam-blue);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--steam-light-blue);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] .panel-header {
    color: var(--steam-blue);
}

.toolbar {
    background: var(--steam-dark);
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(26, 159, 255, 0.1);
    transition: background-color 0.3s ease;
}

.toolbar-btn {
    background: var(--surface);
    border: 1px solid rgba(26, 159, 255, 0.2);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Archivo', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.toolbar-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--steam-gradient);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 0;
}

.toolbar-btn:hover:before {
    left: 0;
    opacity: 0.1;
}

.toolbar-btn:hover {
    border-color: var(--steam-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 159, 255, 0.2);
}

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

.toolbar-btn span {
    position: relative;
    z-index: 1;
}

.divider {
    width: 1px;
    background: rgba(26, 159, 255, 0.2);
    margin: 0 0.25rem;
}

.editor-content {
    padding: 1.5rem;
    min-height: 500px;
}

#editor {
    width: 100%;
    min-height: 450px;
    background: var(--steam-darker);
    color: var(--text-primary);
    border: 1px solid rgba(26, 159, 255, 0.1);
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Archivo', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#editor:focus {
    outline: none;
    border-color: var(--steam-blue);
    box-shadow: 0 0 0 3px rgba(26, 159, 255, 0.1);
}

#preview {
    min-height: 450px;
    padding: 1rem;
    background: var(--steam-darker);
    border: 1px solid rgba(26, 159, 255, 0.1);
    border-radius: 4px;
    line-height: 1.6;
}

/* Estilos para la preview de Steam */
#preview h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--steam-light-blue);
}

#preview h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.8rem 0;
    color: var(--steam-light-blue);
}

#preview h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0.6rem 0;
    color: var(--steam-light-blue);
}

#preview b,
#preview strong {
    font-weight: 700;
    color: var(--text-primary);
}

#preview u {
    text-decoration: underline;
}

#preview i,
#preview em {
    font-style: italic;
}

#preview strike,
#preview s {
    text-decoration: line-through;
    color: var(--text-secondary);
}

#preview .spoiler {
    background: var(--spoiler-colour);
    color: var(--spoiler-colour);
    padding: 0 4px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s ease;
}

#preview .spoiler:hover,
#preview .spoiler.revealed {
    color: var(--text-primary);
    background: var(--surface-hover);
}

#preview hr {
    border: none;
    border-top: 2px solid rgba(26, 159, 255, 0.3);
    margin: 1.5rem 0;
}

#preview a {
    color: var(--steam-light-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

#preview a:hover {
    border-bottom-color: var(--steam-light-blue);
}

.actions {
    padding: 1.5rem;
    background: var(--steam-dark);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(26, 159, 255, 0.1);
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border-radius: 4px;
    border: none;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--steam-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 159, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 159, 255, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid rgba(26, 159, 255, 0.2);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--steam-blue);
}

/* Success state for copy buttons */
.btn-copied {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    border-color: #4CAF50 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer {
    position: relative;
    z-index: 1;
    margin-top: 4rem;
    padding: 2rem 1rem;
    background: var(--steam-dark);
    border-top: 2px solid rgba(26, 159, 255, 0.2);
    transition: background-color 0.3s ease;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-links {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

.footer-links a {
    color: var(--steam-light-blue);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.footer-links a:hover {
    color: var(--steam-blue);
    border-bottom-color: var(--steam-blue);
}

@media (max-width: 1024px) {
    .editor-wrapper {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 3rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .theme-toggle {
        width: 44px;
        height: 44px;
        top: -0.5rem;
        right: -0.5rem;
    }

    .toolbar {
        gap: 0.25rem;
    }

    .toolbar-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .footer {
        margin-top: 2rem;
        padding: 1.5rem 1rem;
    }

    .disclaimer {
        font-size: 0.8rem;
    }

    .footer-links {
        font-size: 0.85rem;
    }
}