/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&display=swap');

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

:root {
    /* Color Palette - Black/White/Grey Theme (Dark Mode) */
    --primary: #FFFFFF;
    --primary-hover: #E0E0E0;
    --accent: #B0B0B0;
    --highlight: #808080;
    --success: #808080;
    --error: #808080;
    --warning: #808080;

    /* Neutrals - Dark Mode */
    --bg-dark: #000000;
    --bg-card: #1A1A1A;
    --bg-input: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --border: #404040;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FFFFFF 0%, #B0B0B0 100%);
    --gradient-accent: linear-gradient(135deg, #B0B0B0 0%, #808080 100%);
    --gradient-success: linear-gradient(135deg, #808080 0%, #606060 100%);

    /* Shadows - Minimalistic */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-glow: none;
    --shadow-neopop: none;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius - Minimalistic */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-squircle: 4px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Light Mode - Pure Minimalistic */
body.light-mode {
    --bg-dark: #FFFFFF;
    --bg-card: #FAFAFA;
    --bg-input: #F0F0F0;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border: #E0E0E0;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-glow: none;
    --shadow-neopop: none;
    --primary: #000000;
    --primary-hover: #333333;
    --gradient-primary: none;
    --gradient-accent: none;
    --gradient-success: none;
}

body.light-mode::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 0, 0, 0.01) 0%, transparent 50%);
}

/* Light mode overrides for HEADER and FOOTER - EXPLICIT to ensure theme changes work */
body.light-mode .header h1,
body.light-mode .header .logo h1,
body.light-mode .logo h1,
body.light-mode .header-content h1,
body.light-mode .logo-icon {
    color: var(--text-primary) !important;
}

body.light-mode .subtitle,
body.light-mode .header .subtitle,
body.light-mode .header-content .subtitle {
    color: var(--text-secondary) !important;
}

body.light-mode .footer {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

body.light-mode .attribution,
body.light-mode .footer .attribution {
    color: var(--text-primary) !important;
}

body.light-mode .copyright,
body.light-mode .footer .copyright,
body.light-mode .footer-link,
body.light-mode .footer .footer-link {
    color: var(--text-secondary) !important;
}

body.light-mode .logo-icon,
body.light-mode .feature-title,
body.light-mode .feature-desc,
body.light-mode .attribution,
body.light-mode .copyright,
body.light-mode .footer-link,
body.light-mode .user-name,
body.light-mode .modal-title,
body.light-mode .settings-section-title,
body.light-mode .form-label,
body.light-mode .dropdown-title,
body.light-mode .dropdown-item,
body.light-mode .error-title,
body.light-mode .error-message,
body.light-mode .error-tip,
body.light-mode .suggestions-title,
body.light-mode .suggestions-message,
body.light-mode .suggestions-list li,
body.light-mode .status-item,
body.light-mode .validation-indicator,
body.light-mode .token-count,
body.light-mode .format-selector,
body.light-mode .btn,
body.light-mode .btn-primary,
body.light-mode .btn-secondary,
body.light-mode .btn-icon-only,
body.light-mode .theme-preset-btn,
body.light-mode .color-input,
body.light-mode .form-input,
body.light-mode .transform-description,
body.light-mode .transform-preview,
body.light-mode .doc-item-name,
body.light-mode .doc-item-meta,
body.light-mode .plan-price,
body.light-mode .plan-duration,
body.light-mode .plan-features li,
body.light-mode .payment-plan h3,
body.light-mode .header-btn,
body.light-mode .theme-toggle,
body.light-mode .btn-arrow,
body.light-mode .btn-clear,
body.light-mode .btn-text,
body.light-mode .ad-label,
body.light-mode .savings-text,
body.light-mode .savings-number,
body.light-mode .savings-percent {
    color: #22c55e;
}

body.light-mode .feature-desc,
body.light-mode .copyright,
body.light-mode .footer-link,
body.light-mode .error-tip,
body.light-mode .suggestions-list li,
body.light-mode .status-item,
body.light-mode .token-count,
body.light-mode .doc-item-meta,
body.light-mode .plan-duration,
body.light-mode .dropdown-title,
body.light-mode .transform-description {
    color: var(--text-secondary);
}

body {
    font-family: 'Inconsolata', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* No Animated Background - Pure Minimalistic */
body::before {
    display: none;
}

.container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--spacing-md) 0;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    overflow: visible !important;
    position: relative;
    z-index: 1000;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: var(--bg-dark);
    /* No animation - minimalistic */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto var(--spacing-sm);
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
    overflow: visible !important;
    position: relative;
    z-index: 1001;
}

.logo {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--text-primary);
    animation: pulse 2s infinite;
}

.header h1,
.header .logo h1,
.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    letter-spacing: -0.025em;
    margin: 0;
    white-space: nowrap;
}

.subtitle,
.header .subtitle,
.header-content .subtitle {
    color: var(--text-secondary) !important;
    font-size: 0.7875rem;
    font-weight: 500;
    margin: 0;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    overflow: visible !important;
    position: relative;
    z-index: 1002;
}

/* Theme dropdown in header */
.header-controls .dropdown {
    position: relative;
    overflow: visible !important;
    z-index: 1003;
}

.header-controls .format-selector.dropdown-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    padding-right: 2.5rem;
    height: auto;
    min-width: fit-content;
    overflow: visible;
}

.header-controls .format-selector.dropdown-toggle:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--primary);
}

.header-controls .dropdown-menu {
    min-width: 280px;
    max-width: 450px;
    width: max-content;
    overflow: visible !important;
    white-space: normal;
    word-wrap: break-word;
}

.header-controls .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.75rem 1rem;
    line-height: 1.4;
    min-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    text-overflow: clip;
}

.header-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition-fast);
    padding: 0;
}

.header-btn:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--primary);
    /* No transform - minimalistic */
}

.header-btn:active {
    opacity: 0.8;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition-fast);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--primary);
    /* No transform - minimalistic */
}

.theme-toggle:active {
    opacity: 0.8;
}

/* Converter Layout */
.converter {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-lg);
    height: calc(100vh - 300px);
    min-height: 600px;
    /* No animation - minimalistic */
}

/* Resizable Container - Fixed 50-50 horizontal layout */
.resizable-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 0;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.resizable-panel {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Conversion Controls Panel */
.conversion-controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    flex-shrink: 0;
    flex-grow: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: relative;
    z-index: 1;
    width: auto;
    min-width: auto;
}

.conversion-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Arrow Buttons */
.btn-arrow {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: 0;
}

.btn-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
    transform: scale(1.05);
}

body.light-mode .btn-arrow:hover {
    color: var(--text-primary);
}

.btn-arrow:active {
    transform: scale(0.95);
}

.btn-arrow .arrow-icon {
    display: inline-block;
    font-weight: bold;
}

/* Clear Button */
.btn-clear {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 1.125rem;
    padding: 0;
    margin-left: var(--spacing-xs);
}

.btn-clear:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    color: var(--bg-dark);
    transform: scale(1.05);
}

body.light-mode .btn-clear:hover {
    color: var(--text-primary);
}

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

.btn-clear .clear-icon {
    display: inline-block;
    font-weight: bold;
}

/* Resize handle removed - using fixed 50-50 split */

.resize-handle:hover .resize-handle-line,
.resize-handle:active .resize-handle-line {
    opacity: 1;
    background: var(--text-primary);
}

/* Mobile: Stack vertically */
@media (max-width: 1024px) {
    .resizable-container {
        flex-direction: column;
    }
    
    .resizable-panel {
        flex: 1 1 0;
        width: 100%;
        min-height: 300px;
    }
    
    .conversion-controls-panel {
        flex-direction: row;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
}

/* Sections */
.input-section,
.output-section {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    box-shadow: none;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Section Headers - Customizable color like jsoneditor */
.section-header {
    background: var(--header-bg, var(--primary));
    color: var(--bg-dark);
    margin: calc(-1 * var(--spacing-md)) calc(-1 * var(--spacing-md)) var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 3rem;
    overflow: visible !important;
    position: relative;
    z-index: 100;
}

.section-header .editor-toolbar,
.section-header .header-actions {
    color: var(--bg-dark);
}

.section-header .format-selector {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--bg-dark);
    border-color: rgba(0, 0, 0, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

.section-header .format-selector:hover {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.section-header .format-selector option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.section-header .format-selector.dropdown-toggle {
    background: rgba(0, 0, 0, 0.2);
    color: var(--bg-dark);
    border-color: rgba(0, 0, 0, 0.3);
}

.section-header .format-selector.dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.5);
}

.section-header .dropdown-arrow {
    color: var(--bg-dark);
    opacity: 0.9;
}

.section-header .btn-icon-only {
    color: var(--bg-dark);
    opacity: 0.9;
}

.section-header .btn-icon-only:hover {
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.section-header .token-count {
    background: rgba(0, 0, 0, 0.2);
    color: var(--bg-dark);
    border-color: rgba(0, 0, 0, 0.3);
}

/* Light mode section headers - use white text on black background */
body.light-mode .section-header {
    background: var(--header-bg, var(--primary));
    color: #FFFFFF;
}

body.light-mode .section-header .editor-toolbar,
body.light-mode .section-header .header-actions {
    color: #FFFFFF;
}

body.light-mode .section-header .format-selector {
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

body.light-mode .section-header .format-selector:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.light-mode .section-header .format-selector.dropdown-toggle {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

body.light-mode .section-header .format-selector.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

body.light-mode .section-header .dropdown-arrow {
    color: #FFFFFF;
}

body.light-mode .section-header .btn-icon-only {
    color: #FFFFFF;
}

body.light-mode .section-header .btn-icon-only:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-mode .section-header .token-count {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

body.light-mode .section-header .format-selector option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-section:hover,
.output-section:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

/* Section header styles are defined above with primary color background */

/* Format Selector */
.format-selector-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.format-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.format-selector {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inconsolata', monospace;
    cursor: pointer;
    transition: var(--transition-base);
    display: block;
    white-space: nowrap;
    min-width: fit-content;
    overflow: visible;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

body.light-mode .format-selector {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Select elements styling */
select {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inconsolata', monospace;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

body.light-mode select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

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

select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Dropdown toggle buttons styled like format selector */
.format-selector.dropdown-toggle {
    position: relative;
    padding-right: 2.5rem;
    min-width: fit-content;
}

.dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform var(--transition-fast);
    pointer-events: none;
    flex-shrink: 0;
}

.dropdown.show .dropdown-toggle .dropdown-arrow,
.dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

.format-selector:hover {
    border-color: var(--primary);
}

.format-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.token-count {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
    font-family: 'Inconsolata', monospace;
}

/* Code Editor Wrapper */
.code-editor-wrapper {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-squircle);
    background: var(--bg-dark);
    overflow: hidden;
    transition: all var(--transition-base);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.code-editor-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 46, 99, 0.15);
}

/* Input boxes keep Inter font - NOT Inconsolata */
.form-input,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* CodeMirror Styles */
.code-editor-cm {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.code-editor-cm .CodeMirror {
    height: 100%;
    flex: 1;
    font-family: 'Fira Code', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace !important;
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.code-editor-cm .CodeMirror-lines,
.code-editor-cm .CodeMirror-line,
.code-editor-cm .CodeMirror-code {
    font-family: 'Fira Code', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace !important;
}

.code-editor-cm .CodeMirror-scroll {
    min-height: 0;
}

body.light-mode .code-editor-cm .CodeMirror {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* CodeMirror Theme Override */
.code-editor-cm .CodeMirror-gutters {
    background: var(--bg-input);
    border-right: 1px solid var(--border);
}

body.light-mode .code-editor-cm .CodeMirror-gutters {
    background: var(--bg-input);
}

.code-editor-cm .CodeMirror-linenumber {
    color: var(--text-secondary);
    opacity: 0.7;
}

.code-editor-cm .CodeMirror-cursor {
    border-left: 2px solid var(--primary);
}

.code-editor-cm .CodeMirror-selected {
    background: rgba(255, 255, 255, 0.2);
}

body.light-mode .code-editor-cm .CodeMirror-selected {
    background: rgba(0, 0, 0, 0.1);
}

.code-editor-cm .CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.05);
}

body.light-mode .code-editor-cm .CodeMirror-activeline-background {
    background: rgba(0, 0, 0, 0.03);
}

/* Code Editor with Line Numbers (Legacy) */
.code-editor {
    display: flex;
    gap: 0;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-squircle);
    background: var(--bg-dark);
    overflow: hidden;
    transition: all var(--transition-base);
    flex: 1;
    min-height: 500px;
}

/* Input section editor - full height when not fullscreen */
.input-section:not(.fullscreen) .code-editor-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.input-section:not(.fullscreen) .code-editor-cm .CodeMirror {
    height: 100%;
}

.input-section:not(.fullscreen) .input-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    height: 100%;
    resize: none;
}

.input-section:not(.fullscreen) .line-numbers {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

.code-editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

body.light-mode .code-editor {
    background: var(--bg-dark);
}

body.light-mode .code-editor:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.code-editor-wrapper.error,
.code-editor.error {
    border: 1px solid var(--error);
    animation: shake 0.5s ease-in-out;
}

/* Error line highlighting in CodeMirror */
.code-editor-cm .CodeMirror-line.error-line {
    background: rgba(128, 128, 128, 0.2);
    border-left: 3px solid var(--error);
    padding-left: 5px;
}

body.light-mode .code-editor-cm .CodeMirror-line.error-line {
    background: rgba(128, 128, 128, 0.1);
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: var(--spacing-md);
    padding: 0.375rem var(--spacing-md);
    background: var(--bg-input);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Inconsolata', monospace;
}

.status-item {
    display: flex;
    align-items: center;
}

.status-item::before {
    content: '';
    width: 1px;
    height: 12px;
    background: var(--border);
    margin-right: var(--spacing-md);
}

.status-item:first-child::before {
    display: none;
}

/* Validation Indicator */
.validation-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 0;
    font-size: 0.75rem;
    line-height: 1;
    cursor: help;
    transition: all var(--transition-fast);
}

.validation-indicator.valid {
    background: var(--success);
    color: var(--text-primary);
    box-shadow: 0 0 4px var(--success);
}

.validation-indicator.invalid {
    background: var(--error);
    color: var(--bg-dark);
    box-shadow: 0 0 4px var(--error);
}

body.light-mode .validation-indicator.invalid {
    color: var(--text-primary);
}

.validation-indicator.pending {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Validation Notifications */
.validation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-squircle);
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    max-width: 400px;
    word-wrap: break-word;
    opacity: 0;
    transition: opacity var(--transition-base);
    animation: slideInRight 0.3s ease-out;
}

.validation-success {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.validation-error {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Transform Modal Styles */
.transform-modal {
    max-width: 700px;
}

.transform-description {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.transform-description a {
    color: var(--primary);
    text-decoration: none;
}

.transform-description a:hover {
    text-decoration: underline;
}

.transform-query {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.9rem;
    resize: vertical;
}

.transform-preview {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.85rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    resize: vertical;
}

.transform-preview.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Settings Modal Styles */
.settings-modal {
    max-width: 600px;
}

.settings-section {
    margin-bottom: var(--spacing-lg);
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
}

.color-picker-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.color-input {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inconsolata', monospace;
    font-size: 0.875rem;
}

.theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--spacing-sm);
}

.theme-preset-btn {
    padding: var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.theme-preset-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    transform: translateY(-2px);
}

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

.line-numbers {
    flex-shrink: 0;
    width: 3.5rem;
    padding: var(--spacing-md) 0;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border);
    overflow: hidden;
    white-space: pre !important;
    padding-right: 0.75rem;
    opacity: 0.7;
}

body.light-mode .line-numbers {
    background: #F5F5F5;
}

.code-editor .input-area,
.code-editor .output-area {
    flex: 1;
    border: none;
    border-radius: 0;
    margin: 0;
}

.code-editor .input-area:focus,
.code-editor .output-area:focus {
    border: none;
    box-shadow: none;
}

/* Textarea Styles */
.input-area,
.output-area {
    width: 100%;
    min-height: 500px;
    background: transparent;
    border: none;
    border-radius: var(--radius-squircle);
    padding: var(--spacing-md);
    font-family: 'Fira Code', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace !important;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
    resize: none;
    white-space: pre;
    overflow-x: auto;
    transition: all var(--transition-base);
}

.input-area:focus,
.output-area:focus {
    outline: none;
}


/* Error Display */
.error-display {
    margin-top: var(--spacing-md);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid var(--error);
    border-radius: var(--radius-squircle);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    animation: slideInUp 0.3s ease-out;
}

.error-display.hidden {
    display: none;
}

.error-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-title {
    font-weight: 600;
    color: var(--error);
    margin-bottom: var(--spacing-xs);
    font-size: 1.125rem;
}

.error-message {
    color: var(--text-primary);
    font-family: 'Inconsolata', monospace;
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-xs);
    background: var(--bg-input);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.error-tip {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Savings Display */
.savings-display {
    margin-top: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-squircle);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    animation: slideInUp 0.3s ease-out;
    box-shadow: var(--shadow-neopop), var(--shadow-glow);
    border: 2px solid var(--success);
    min-height: auto;
}

.savings-display.hidden {
    display: none;
}

.savings-icon {
    font-size: 1.25rem;
    animation: pulse 2s infinite;
    flex-shrink: 0;
    line-height: 1;
}

.savings-text {
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #4ade80;
}

.savings-number,
.savings-percent {
    font-weight: 700;
    font-size: 1rem;
    color: #4ade80;
}

/* Controls - Hidden on desktop, shown on mobile */
.controls {
    display: none;
    flex-direction: row;
    gap: var(--spacing-sm);
    justify-content: center;
    padding: var(--spacing-md);
    flex-wrap: wrap;
}

.controls.mobile-only {
    display: flex;
}

@media (min-width: 1025px) {
    .controls.mobile-only {
        display: none;
    }
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-squircle);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-neopop);
    white-space: nowrap;
    position: relative;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    border: 1px solid var(--primary);
    box-shadow: none;
}

body.light-mode .btn-primary {
    color: #FFFFFF;
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: none;
    box-shadow: none;
    opacity: 0.9;
}

.btn-primary:active {
    transform: none;
    opacity: 0.8;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    transform: none;
    box-shadow: none;
}

.btn-secondary:active {
    transform: none;
    opacity: 0.8;
}

/* .btn-clear styles are defined above in conversion controls panel section */

/* Icon-only Buttons (Minimalistic) */
.btn-icon-only {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    min-width: 2rem;
    min-height: 2rem;
}

.btn-icon-only:hover {
    background: var(--bg-input);
    color: var(--primary);
    transform: scale(1.1);
}

.btn-icon-only:active {
    transform: scale(0.95);
}

.btn-icon-only.dropdown-toggle::after {
    display: none;
}

.copy-icon {
    font-size: 1.25rem;
}

.btn-icon-only.copied {
    background: var(--success);
    border-color: var(--success);
}

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

/* Arrow Buttons (non-circular, like jsoneditor) */
.btn-arrow {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-squircle);
    /* square-ish corners; keep a little rounding for style */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: 0;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

body.light-mode .btn-arrow:hover {
    color: var(--text-primary);
}

.btn-arrow:active {
    transform: scale(0.95);
}

.btn-arrow .btn-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.btn-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow:disabled:hover {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
    transform: none;
}

.btn-text {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    margin-right: var(--spacing-xs);
}

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

/* Feature Cards */
.features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: 0;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-squircle);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    transition: all var(--transition-base);
    flex: 1;
    max-width: 300px;
}

.feature:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.feature-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-xl);
    background: var(--bg-card);
    color: var(--text-primary) !important;
}

.attribution,
.footer .attribution {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary) !important;
}

.heart {
    color: var(--error);
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

.attribution strong {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    color: var(--text-primary);
    font-weight: 700;
}

.copyright,
.footer .copyright {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
}

.footer-links {
    margin: var(--spacing-xs) 0;
}

.footer-link,
.footer .footer-link {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-base);
}

.footer-link:hover,
.footer .footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Advertisement Containers */
.ad-container {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: var(--spacing-xs);
    text-align: center;
    overflow: hidden;
}

.ad-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.ad-horizontal {
    margin-bottom: var(--spacing-xs);
    min-height: 70px;
    max-height: 70px;
    min-width: 728px;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .ad-horizontal {
        min-width: 320px;
        width: 100%;
    }
}

.ad-bottom {
    margin: var(--spacing-lg) auto;
    max-width: 728px;
    min-width: 728px;
    width: 100%;
    min-height: 110px;
    max-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .ad-bottom {
        min-width: 320px;
        width: 100%;
        max-width: 100%;
    }
}

.ad-vertical {
    min-height: 100px;
    max-height: 100px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Control Buttons Wrapper */
.control-buttons {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: center;
}

/* Suggestions Display */
.suggestions-display {
    margin-top: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-squircle);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    animation: slideInUp 0.3s ease-out;
}

.suggestions-display.hidden {
    display: none;
}

.suggestions-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.suggestions-content {
    flex: 1;
}

.suggestions-title {
    font-weight: 600;
    color: var(--warning);
    margin-bottom: var(--spacing-xs);
    font-size: 1.125rem;
}

.suggestions-message {
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-sm);
}

.suggestions-list {
    list-style: none;
    padding-left: 0;
}

.suggestions-list li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-md);
    position: relative;
}

.suggestions-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes bounce {

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

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2);
    }

    40% {
        transform: scale(1);
    }

    60% {
        transform: scale(1.1);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page Load Animations */
body {
    animation: fadeIn 0.6s ease-out;
}

.header {
    animation: fadeInDown 0.6s ease-out;
}

.converter {
    animation: fadeInUp 0.8s ease-out;
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Button Animations */
.btn,
.btn-primary,
.btn-secondary,
.btn-arrow,
.btn-clear {
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0);
}

.btn-arrow:hover {
    transform: scale(1.05);
}

.btn-icon-only:hover {
    transform: scale(1.1);
}

/* Card/Feature Hover Animations */
.feature,
.why-choose-item,
.feature-detailed-item,
.step-item,
.footer-feature {
    transition: all var(--transition-base);
}

.feature:hover,
.why-choose-item:hover,
.feature-detailed-item:hover,
.step-item:hover,
.footer-feature:hover {
    transform: translateY(-4px);
}

/* Modal Animations */
.modal-overlay {
    animation: fadeIn 0.3s ease-out;
}

.modal {
    animation: fadeInScale 0.3s ease-out;
}

.modal-overlay.hidden {
    animation: fadeIn 0.3s ease-out reverse;
}

/* Form Input Animations */
.form-input,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    transition: opacity var(--transition-base), border-color var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    opacity: 1;
}

/* Section Header Animations */
.section-header {
    transition: all var(--transition-base);
}

/* Dropdown Animations */
.dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
    transform-origin: top;
}

/* Privacy/Terms/Contact Page Animations */
.privacy-container,
.terms-container,
.contact-container {
    animation: fadeInUp 0.6s ease-out;
}

.privacy-header,
.terms-header,
.contact-header {
    animation: fadeInDown 0.6s ease-out;
}

.privacy-content,
.terms-content,
.contact-content {
    animation: fadeInScale 0.8s ease-out;
}

.privacy-content h2,
.terms-content h2,
.contact-content h2 {
    animation: slideInLeft 0.5s ease-out;
    animation-fill-mode: both;
}

.privacy-content h2:nth-child(2) { animation-delay: 0.1s; }
.privacy-content h2:nth-child(3) { animation-delay: 0.2s; }
.privacy-content h2:nth-child(4) { animation-delay: 0.3s; }
.terms-content h2:nth-child(2) { animation-delay: 0.1s; }
.terms-content h2:nth-child(3) { animation-delay: 0.2s; }
.contact-content h2:nth-child(2) { animation-delay: 0.1s; }

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

/* Features Section Animations */
.features {
    animation: fadeInUp 0.8s ease-out;
}

.feature {
    animation: fadeInScale 0.6s ease-out;
    animation-fill-mode: both;
}

.feature:nth-child(1) { animation-delay: 0.1s; }
.feature:nth-child(2) { animation-delay: 0.2s; }
.feature:nth-child(3) { animation-delay: 0.3s; }

/* What is TOON Section Animations */
.what-is-toon {
    animation: fadeInUp 0.8s ease-out;
}

.what-is-toon-title {
    animation: fadeInDown 0.6s ease-out;
}

.why-choose-item,
.step-item,
.feature-detailed-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.why-choose-item:nth-child(1) { animation-delay: 0.1s; }
.why-choose-item:nth-child(2) { animation-delay: 0.2s; }
.why-choose-item:nth-child(3) { animation-delay: 0.3s; }

.step-item:nth-child(1) { animation-delay: 0.1s; }
.step-item:nth-child(2) { animation-delay: 0.2s; }
.step-item:nth-child(3) { animation-delay: 0.3s; }
.step-item:nth-child(4) { animation-delay: 0.4s; }

.feature-detailed-item:nth-child(1) { animation-delay: 0.1s; }
.feature-detailed-item:nth-child(2) { animation-delay: 0.2s; }
.feature-detailed-item:nth-child(3) { animation-delay: 0.3s; }
.feature-detailed-item:nth-child(4) { animation-delay: 0.4s; }
.feature-detailed-item:nth-child(5) { animation-delay: 0.5s; }
.feature-detailed-item:nth-child(6) { animation-delay: 0.6s; }

/* Footer Animations */
.footer {
    animation: fadeInUp 0.8s ease-out;
}

.footer-feature {
    animation: fadeInScale 0.6s ease-out;
    animation-fill-mode: both;
}

.footer-feature:nth-child(1) { animation-delay: 0.1s; }
.footer-feature:nth-child(2) { animation-delay: 0.2s; }
.footer-feature:nth-child(3) { animation-delay: 0.3s; }

/* Back Link Animation */
.back-link {
    transition: all var(--transition-base);
    display: inline-block;
}

.back-link:hover {
    transform: translateX(-5px);
}

/* Contact Form Animations */
.contact-email {
    transition: all var(--transition-base);
}

.contact-email:hover {
    transform: translateY(-2px);
}

.form-submit {
    transition: transform var(--transition-base), opacity var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.form-submit:hover {
    transform: translateY(-2px);
}

.form-submit:active {
    transform: translateY(0);
}

/* Success Message Animation */
.success-message {
    animation: slideInUp 0.3s ease-out;
}

/* Responsive Design - Tablet (already defined above) */

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-xs);
    }

    /* Header Improvements */
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
        margin-bottom: var(--spacing-sm);
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        padding: 0;
    }

    .logo {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-xs);
    }

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

    .header h1,
    .header .logo h1,
    .logo h1 {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.3;
        flex: 1;
        min-width: 0;
    }

    .subtitle,
    .header .subtitle,
    .header-content .subtitle {
        display: none; /* Hide subtitle on mobile to save space */
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .auth-buttons {
        flex: 1;
        min-width: 0;
        gap: var(--spacing-xs);
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        flex: 1;
        min-width: 0;
    }

    .header-btn,
    .theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.1rem;
    }

    /* Converter Layout */
    .converter {
        height: auto;
        min-height: 60vh;
        margin-bottom: var(--spacing-md);
    }

    .resizable-container {
        flex-direction: column;
        min-height: 60vh;
        gap: var(--spacing-xs);
    }

    .resizable-panel {
        min-height: 40vh;
        flex: 1;
    }

    /* Section Headers - Better Mobile Layout */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
        min-height: auto;
    }

    .editor-toolbar {
        width: 100%;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        order: 1;
        align-items: center;
        justify-content: flex-start;
    }

    .toolbar-group {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        align-items: center;
        display: flex;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        order: 2;
        margin-top: var(--spacing-xs);
        align-items: center;
    }

    /* Format Selector - Mobile */
    .format-selector {
        font-size: 0.8125rem;
        padding: 0.5rem 2rem 0.5rem 0.625rem;
        min-width: 80px;
    }

    /* Buttons - Touch Friendly */
    .btn-icon-only {
        width: 2.25rem;
        height: 2.25rem;
        min-width: 2.25rem;
        min-height: 2.25rem;
        font-size: 1rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-arrow {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }

    .btn-clear {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }

    .conversion-controls-panel {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .conversion-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: center;
    }
    
    /* Mobile: Change arrow icons to up/down when layout is vertical */
    @media (max-width: 768px) {
        #arrowLeftBtn .arrow-icon {
            font-size: 0;
            line-height: 0;
        }
        
        #arrowLeftBtn .arrow-icon::before {
            content: '↓';
            font-size: 1.2rem;
            line-height: 1;
            display: inline-block;
        }
        
        #arrowRightBtn .arrow-icon {
            font-size: 0;
            line-height: 0;
        }
        
        #arrowRightBtn .arrow-icon::before {
            content: '↑';
            font-size: 1.2rem;
            line-height: 1;
            display: inline-block;
        }
    }

    /* Token Count */
    .token-count {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        min-width: fit-content;
    }

    /* Editor Areas - Larger in Mobile */
    .input-area,
    .output-area {
        min-height: 45vh;
        font-size: 0.875rem;
        padding: var(--spacing-md);
    }
    
    .code-editor-wrapper {
        min-height: 45vh;
    }
    
    .code-editor-cm {
        min-height: 45vh;
    }

    .code-editor-cm .CodeMirror {
        font-size: 0.875rem;
    }

    /* Status Bar */
    .status-bar {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }

    .status-item {
        font-size: 0.75rem;
    }

    /* Ad Containers */
    .ad-horizontal {
        min-height: 150px;
        max-height: 150px;
        margin-bottom: var(--spacing-sm);
    }

    .ad-vertical,
    .ad-bottom {
        min-height: 150px;
        max-height: 150px;
        min-width: 100%;
        max-width: 100%;
        margin: var(--spacing-md) 0;
    }

    /* Dropdown Menus */
    .dropdown-menu {
        min-width: 200px;
        max-width: calc(100vw - 2rem);
    }

    /* Features Section */
    .features {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .feature {
        padding: var(--spacing-md);
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .footer-links {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }

    .footer-features {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
}

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

    .features {
        grid-template-columns: 1fr;
    }

    .ad-horizontal {
        min-height: 150px;
    }
}

/* Authentication & Payment Styles */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.payment-plan {
    text-align: center;
    padding: 1rem 0;
}

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

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.plan-duration {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.plan-features {
    list-style: none;
    text-align: left;
    margin: 1.5rem 0;
    padding: 0;
}

.plan-features li {
    padding: 0.5rem 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.plan-features li:last-child {
    border-bottom: none;
}

.payment-methods {
    margin-top: 1.5rem;
}

/* Hide ads for premium users */
.premium-user [id^="ad-"] {
    display: none !important;
}

/* Responsive auth buttons */
@media (max-width: 768px) {
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .auth-buttons .btn {
        width: 100%;
    }
    
    .user-menu {
        flex-direction: column;
        width: 100%;
    }
}

/* What is JSON to TOON Converter Section */
.what-is-toon {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--bg-card);
    margin: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.what-is-toon-container {
    max-width: 1200px;
    margin: 0 auto;
}

.what-is-toon-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.what-is-toon-content {
    margin-bottom: var(--spacing-xl);
}

.what-is-toon-intro {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.what-is-toon-subsection {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-dark);
    border-left: 3px solid var(--primary);
}

.what-is-toon-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.what-is-toon-subsection p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Why Choose Section */
.why-choose-section {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.why-choose-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.why-choose-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: 1.125rem;
}

.why-choose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.why-choose-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.why-choose-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.why-choose-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.why-choose-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.why-choose-item-desc {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How to Use Section */
.how-to-use-section {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
}

.how-to-use-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.how-to-use-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: 1.125rem;
}

.how-to-use-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.step-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.step-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

body.light-mode .step-number {
    color: #FFFFFF;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.step-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Features Detailed Section */
.features-detailed-section {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
}

.features-detailed-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.features-detailed-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: 1.125rem;
}

.features-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.feature-detailed-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.feature-detailed-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-detailed-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.feature-detailed-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.feature-detailed-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Footer Features */
.footer-features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.footer-feature {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    text-align: center;
    padding: var(--spacing-lg);
}

.footer-feature-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    transition: all var(--transition-base);
}

body.light-mode .footer-feature-icon-wrapper {
    background: rgba(0, 0, 0, 0.1);
}

.footer-feature:hover .footer-feature-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

body.light-mode .footer-feature:hover .footer-feature-icon-wrapper {
    background: rgba(0, 0, 0, 0.2);
}

.footer-feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.footer-feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.footer-feature-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* Responsive Design for New Sections */
@media (max-width: 768px) {
    .what-is-toon-title {
        font-size: 1.5rem;
    }
    
    .why-choose-grid,
    .how-to-use-steps,
    .features-detailed-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-features {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-feature {
        max-width: 100%;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
}