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

:root {
    /* GitHub Light Theme (default) */
    --primary-color: #0969da;
    --primary-hover: #0550ae;
    --success-color: #1a7f37;
    --background: #ffffff;
    --card-background: #f6f8fa;
    --text-primary: #1f2328;
    --text-secondary: #636c76;
    --border-color: #d0d7de;
    --shadow: 0 1px 3px 0 rgba(31, 35, 40, 0.12), 0 1px 2px -1px rgba(31, 35, 40, 0.12);
    --shadow-lg: 0 10px 15px -3px rgba(31, 35, 40, 0.1), 0 4px 6px -4px rgba(31, 35, 40, 0.1);
}

/* GitHub Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #2f81f7;
        --primary-hover: #409eff;
        --success-color: #3fb950;
        --background: #0d1117;
        --card-background: #161b22;
        --text-primary: #e6edf3;
        --text-secondary: #7d8590;
        --border-color: #30363d;
        --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px -1px rgba(0, 0, 0, 0.12);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

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

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-section,
.output-section {
    background: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--card-background);
    color: var(--text-primary);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.char-count {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: right;
}

.output-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.output-box {
    display: flex;
    flex-direction: column;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.copy-btn:active {
    transform: scale(0.98);
}

.copy-btn.copied {
    background: var(--success-color);
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-1rem);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    font-weight: 500;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.info-section {
    background: var(--card-background);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-card h4 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.info-card ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.25rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .output-section {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    .info-section,
    .input-section,
    .output-section {
        padding: 1rem;
    }

    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}
