@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/roboto/roboto-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/open-sans/open-sans-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/montserrat/montserrat-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/source-sans-3/source-sans-3-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/fira-code/fira-code-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/jetbrains-mono/jetbrains-mono-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/merriweather/merriweather-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/lato/lato-400-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/lato/lato-700-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins/poppins-400-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/poppins/poppins-500-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/poppins/poppins-600-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/poppins/poppins-700-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/fira-sans/fira-sans-400-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/fira-sans/fira-sans-500-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/fira-sans/fira-sans-600-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/fira-sans/fira-sans-700-latin.woff2') format('woff2');
}

:root {
    /* Dark Theme (Default) */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --secondary-hover: #059669;

    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.5);

    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
}

html.light-theme {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
}

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

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Background Mesh Gradient Animation */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.15), transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.1), transparent 40%);
    z-index: -1;
    animation: gradientMove 15s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes gradientMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-5%, -5%);
    }
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.main-content,
.generator-card,
.manifest-settings,
.tab-content,
.upload-zone,
.text-preview-container {
    max-width: 100%;
    min-width: 0;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-color);
    min-width: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: block;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--input-bg);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--card-border);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.intro {
    text-align: center;
}

.intro h2 {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: background 0.3s, border-color 0.3s;
    max-width: 100%;
    min-width: 0;
}

body.light-theme .card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--text-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px rgba(79, 70, 229, 0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

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

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--card-border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-zone:hover .upload-icon {
    transform: translateY(-5px);
}

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

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Controls */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    min-width: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

input[type="text"],
select {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    min-width: 0;
    max-width: 100%;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color) !important;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.colors {
    flex-direction: row;
    gap: 1rem;
    min-width: 0;
}

.color-picker-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

/* Preview Canvas */
.text-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--input-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
}

.canvas-wrap {
    /* Wrapping div for visual transparency context */
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(135deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(135deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
    background-color: white;
    border-radius: 20%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: border-radius 0.3s;
}

body.light-theme .canvas-wrap {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#text-preview-canvas {
    width: 128px;
    height: 128px;
    display: block;
}

/* Buttons */
.actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.75rem 1.5rem;
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.btn-success {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Results Area */
#result-area {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    animation: fadeIn 0.4s ease;
}

.success-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-weight: 600;
}

/* Info Card */
.info-card h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.seo-card h2,
.benefit-card h2 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.seo-copy,
.benefit-copy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.seo-copy p,
.benefit-copy p {
    color: var(--text-muted);
    line-height: 1.65;
}

.faq-card h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--card-border);
}

.faq-item {
    border-bottom: 1px solid var(--card-border);
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

.faq-question:hover {
    color: var(--secondary);
}

.faq-icon {
    width: 22px;
    height: 22px;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    flex: 0 0 auto;
    position: relative;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.faq-icon::before {
    width: 10px;
    height: 2px;
}

.faq-icon::after {
    width: 2px;
    height: 10px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.faq-item.is-open .faq-icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-answer {
    color: var(--text-muted);
    line-height: 1.65;
    padding: 0 2.25rem 1.1rem 0;
}

.faq-answer p {
    margin: 0;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    gap: 1rem;
}

.format-item {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-muted);
}

.format-item span {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-footer {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

.footer-right strong {
    color: var(--text-color);
}

.is-hidden {
    display: none !important;
}

/* Extracted Inline Styles */
.font-upload-wrap {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

#font-select {
    flex: 1;
    min-width: 0;
}

.btn-icon-small {
    padding: 0 0.75rem;
}

#cropper-container {
    display: none;
    margin-top: 20px;
}

#cropper-container.is-visible {
    display: block;
}

#cropper-container h4 {
    margin-bottom: 10px;
}

#cropper-wrap {
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

#cropper-image {
    max-width: 100%;
}

.checkbox-group {
    justify-content: center;
    gap: 15px;
}

.manifest-settings {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.manifest-settings h4 {
    margin-bottom: 1rem;
}

.controls-grid.no-margin {
    margin-bottom: 0;
}

#result-area {
    display: none;
}

#result-area.is-visible {
    display: flex;
}

.color-picker-wrap.is-disabled {
    opacity: 0.5;
}

#outline-color-wrap {
    display: none;
}

#outline-color-wrap.is-visible {
    display: flex;
}

.canvas-wrap.shape-square {
    border-radius: 0;
}

.canvas-wrap.shape-rounded {
    border-radius: 20%;
}

.canvas-wrap.shape-circle {
    border-radius: 50%;
}

.app-container.wide {
    max-width: 1200px;
}

.main-content.impressum {
    margin-top: 2rem;
}

.impressum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.impressum-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.impressum-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.card.impressum-card {
    margin-top: 0;
}

.impressum-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

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

.impressum-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.impressum-card a {
    color: var(--secondary);
    text-decoration: none;
}

.impressum-card a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 700px) {
    body {
        padding: 0;
    }

    .app-container {
        padding: 1rem;
        gap: 1.5rem;
        overflow-x: hidden;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .logo {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }

    .logo-icon {
        order: 0;
        flex-shrink: 0;
    }

    .logo h1 {
        order: 0;
        font-size: 1.55rem;
    }

    .header-actions {
        justify-content: center;
        gap: 0.75rem;
        width: 100%;
    }

    .card {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn.active::after {
        display: none;
    }

    .tab-btn {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    body.light-theme .tab-btn {
        background: rgba(0, 0, 0, 0.05);
    }

    .tab-btn.active {
        background: rgba(79, 70, 229, 0.1);
        border: 1px solid rgba(79, 70, 229, 0.3);
    }

    .controls-grid,
    .controls-grid.no-margin {
        grid-template-columns: minmax(0, 1fr);
    }

    .seo-copy, .benefit-copy {
        grid-template-columns: minmax(0, 1fr);
    }

    .control-group label,
    .checkbox-label {
        white-space: normal;
    }

    .font-upload-wrap {
        align-items: stretch;
    }

    .colors {
        flex-direction: column;
    }

    .upload-zone {
        padding: 2.25rem 1rem;
    }
}

@media (max-width: 950px) and (orientation: landscape) {
    body {
        padding: 0;
    }

    .app-container {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        overflow-x: hidden;
    }

    .header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .logo {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        width: auto;
    }

    .logo-icon {
        order: 0;
    }

    .logo h1 {
        order: 0;
        font-size: 1.45rem;
    }

    .header-actions {
        justify-content: flex-end;
        width: auto;
    }

    .card {
        padding: 1.25rem;
        margin-top: 1.25rem;
    }

    .controls-grid,
    .controls-grid.no-margin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seo-copy {
        grid-template-columns: minmax(0, 1fr);
    }

    .control-group label,
    .checkbox-label {
        white-space: normal;
    }

    .font-upload-wrap,
    .colors {
        min-width: 0;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }
}
