:root {
    /* Dark Theme as Default */
    --bg-primary: #282c34;
    --bg-secondary: #21252b;
    --bg-tertiary: #2c313c;
    --bg-hover: #3e4451;
    
    --text-primary: #abb2bf;
    --text-secondary: #828997;
    --text-muted: #5c6370;
    
    --border-primary: #3e4451;
    --border-secondary: #4b5263;
    
    /* Accent Colors for Dark Mode */
    --accent-red: #e06c75;
    --accent-red-hover: #f56c75;
    --accent-red-light: rgba(224, 108, 117, 0.15);
    
    --accent-blue: #61afef;
    --accent-blue-hover: #7cc0f0;
    --accent-blue-light: rgba(97, 175, 239, 0.15);
    
    --accent-green: #98c379;
    --accent-green-hover: #a6d189;
    --accent-green-light: rgba(152, 195, 121, 0.15);
    
    --accent-purple: #c678dd;
    --accent-purple-hover: #d084e4;
    --accent-purple-light: rgba(198, 120, 221, 0.15);
    
    --accent-orange: #e5c07b;
    --accent-orange-hover: #eac98b;
    --accent-orange-light: rgba(229, 192, 123, 0.15);
    
    /* Shadow Variables for Dark Mode */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.45);
    
    /* Error Colors for Dark Mode */
    --error-bg: #3b2626;
    --error-text: #f56c6c;
    --error-border: #5a3a3a;
    
    color-scheme: dark;
}

/* Light theme variables */
[data-theme="light"] {
    /* One Light Color Palette */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --bg-hover: #ebebeb;
    
    --text-primary: #383a42;
    --text-secondary: #696c77;
    --text-muted: #a0a1a7;
    
    --border-primary: #e5e5e6;
    --border-secondary: #d0d0d0;
    
    /* Accent Colors for Light Mode */
    --accent-red: #e45649;
    --accent-red-hover: #ca4944;
    --accent-red-light: rgba(228, 86, 73, 0.1);
    
    --accent-blue: #4078f2;
    --accent-blue-hover: #3a6ad6;
    --accent-blue-light: rgba(64, 120, 242, 0.1);
    
    --accent-green: #50a14f;
    --accent-green-hover: #459844;
    --accent-green-light: rgba(80, 161, 79, 0.1);
    
    --accent-purple: #a626a4;
    --accent-purple-hover: #922092;
    --accent-purple-light: rgba(166, 38, 164, 0.1);
    
    --accent-orange: #c18401;
    --accent-orange-hover: #a87001;
    --accent-orange-light: rgba(193, 132, 1, 0.1);
    
    /* Shadow Variables for Light Mode */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.16);
    
    /* Error Colors for Light Mode */
    --error-bg: #ffeaea;
    --error-text: #cc1f1a;
    --error-border: #f5c6cb;
    
    color-scheme: light;
}

/* Theme toggle styles */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Paste button styles */
.paste-button {
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

.paste-button:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.paste-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Copy popover styles */
.copy-popover {
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.copy-popover.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--text-primary);
}

/* Enhanced example code styles */
.example code {
    background: var(--bg-tertiary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent-orange);
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.example code:hover {
    background: var(--accent-orange-light);
    border-color: var(--accent-orange);
    transform: scale(1.02);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 0;
    padding-top: 20px;
    padding-bottom: 20px;
    margin: 0;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

header .container {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    margin-bottom: 30px;
}

main .container {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    margin-bottom: 30px;
}

footer .container {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
}

.header {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 40px;
    text-align: center;
    border-radius: 12px;
}

.header h1 {
    font-size: 3.2em;
    color: var(--accent-red);
    margin-bottom: 15px;
    font-weight: 300;
    letter-spacing: -1px;
}

.header h1 .youtube-icon {
    color: var(--accent-red);
    margin-right: 10px;
}

.header p {
    font-size: 1.3em;
    font-weight: 400;
    margin: 0;
    color: var(--text-secondary);
}

.input-section {
    padding: 40px 40px 0px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.input-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.1em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"] {
    width: 100%;
    padding: 18px 50px 18px 22px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light), var(--shadow-md);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.clear-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 8px;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.result-section {
    padding: 40px 40px 0px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: none;
}

.result-section.show {
    display: block;
}

.preview-container {
    border-radius: 10px;
    display: none;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.preview-actions {
    padding: 25px;
    background: var(--bg-tertiary);
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-primary);
}

.action-btn {
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.download-btn {
    background: var(--accent-green);
    box-shadow: var(--shadow-md);
}

.download-btn:hover {
    background: var(--accent-green-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.open-btn {
    background: var(--accent-purple);
    box-shadow: var(--shadow-md);
}

.open-btn:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.open-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.error-message {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 18px 22px;
    border-radius: 8px;
    margin-top: 25px;
    border: 1px solid var(--error-border);
    display: none;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.info-section {
    background: var(--bg-secondary);
    padding: 12px 40px 0px;
    border-radius: 12px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.info-section h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
}

.info-section h3 {
    color: var(--text-primary);
    font-size: 1.3em;
    font-weight: 500;
}

.info-section ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
    font-size: 15px;
    padding-left: 20px;
}

.info-section ul {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 15px;
    padding-left: 20px;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 15px;
}

.example {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 8px;
    margin-top: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
}

.example-item {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.example-item:last-child {
    margin-bottom: 0;
}

.features {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 8px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
}

footer {
    text-align: center;
    border-radius: 12px;
}

.footer-container {
    padding: 24px 40px;
}

footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.example code {
    background: var(--bg-tertiary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent-orange);
    border: 1px solid var(--border-secondary);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header .container,
    main .container,
    footer .container {
        margin-bottom: 20px;
    }

    .header {
        padding: 30px 20px;
    }

    .theme-toggle {
        top: 20px;
        right: 20px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .header h1 {
        font-size: 2.4em;
    }

    .header p {
        font-size: 1.1em;
    }

    .input-section, 
    .result-section, 
    .info-section {
        padding: 30px 20px;
        margin-bottom: 20px;
    }

    footer {
        padding: 20px;
    }

    .preview-actions {
        flex-direction: column;
        padding: 18px;
        gap: 12px;
    }

    .action-btn {
        min-width: auto;
        width: 100%;
    }

    .paste-button {
        width: 100%;
        margin-top: 8px;
        padding: 10px 18px;
        font-size: 13px;
    }

    label {
        font-size: 1em;
    }

    input[type="text"] {
        font-size: 16px;
        padding: 16px 50px 16px 18px;
    }

    .clear-btn {
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .btn {
        font-size: 16px;
        padding: 16px 28px;
    }

    .copy-popover {
        font-size: 12px;
        padding: 6px 12px;
    }

    .example,
    .features {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
}

h2, h3 {
    padding-bottom: 8px;
}