:root {
    --primary: #E67E22;
    --primary-hover: #D35400;
    --secondary: #F39C12;
    --accent: #FFAB60;
    --bg-main: #1A0E00;
    --bg-panel: rgba(40, 20, 5, 0.6);
    --border-color: rgba(230, 126, 34, 0.2);
    --text-primary: #FDFEFE;
    --text-secondary: #D4AC8D;

    --success: #2ECC71;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-glass: 0 8px 32px 0 rgba(230, 126, 34, 0.1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--secondary);
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 1.5rem;
}

.glass-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}

/* Header */
header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    color: transparent;
}

.header-text p {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(230, 126, 34, 0.1);
}

.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(230, 126, 34, 0.15);
    color: var(--primary);
    border: 1px solid rgba(230, 126, 34, 0.3);
}

.badge-accent {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(230, 126, 34, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-zone h3 {
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Config Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-info {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.font-info h3 {
    font-size: 1.25rem;
    color: var(--primary);
}

.font-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.config-group {
    margin-bottom: 1.5rem;
}

.config-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Preset Checkboxes */
.preset-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-label:hover {
    border-color: var(--primary);
    background: rgba(230, 126, 34, 0.05);
}

.preset-label input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    margin-top: 2px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.preset-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.preset-info {
    display: flex;
    flex-direction: column;
}

.preset-info span {
    font-size: 0.85rem;
    font-weight: 500;
}

.preset-info small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

#customChars {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

.config-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-glow {
    position: relative;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--primary));
    z-index: -1;
    border-radius: calc(var(--radius-md) + 2px);
    background-size: 400%;
    animation: glow 8s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.btn-glow:hover::after {
    opacity: 0.7;
}

@keyframes glow {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* Preview & Output Section */
.preview-output {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.char-wrap-text {
    word-break: break-all;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    letter-spacing: 2px;
    line-height: 1.6;
}

.live-preview-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.live-preview-box label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.live-preview {
    min-height: 80px;
    font-size: 2rem;
    padding: 1rem;
    overflow-wrap: break-word;
    resize: vertical;
    overflow-y: auto;
}

.live-preview:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.2);
}

/* Results */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-info strong {
    font-size: 1.25rem;
}

.card-success {
    border-color: rgba(46, 204, 113, 0.3);
    background: rgba(46, 204, 113, 0.05);
}

.card-success .stat-icon,
.card-success strong {
    color: var(--success);
}

.css-snippet {
    background: #000;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
}

.css-snippet label {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
}

.css-snippet pre {
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a6b2c0;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(230, 126, 34, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .config-actions {
        flex-direction: column;
    }
}