.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-text {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: var(--text);
    text-align: center;
    width: 100%;
}

.loading-text-brand {
    font-weight: 900;
    font-size: 0.8rem;
    display: inline-block;
    opacity: 0;
    animation: bang 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
}

.loading-text-quote {
    font-weight: 200;
    font-size: 1.5rem;
    margin-top: 36px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.static-text, .dynamic-word {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.static-text {
    text-align: right;
}

.dynamic-word {
    font-weight: 400;
    text-align: left;
}

.static-text.changing, .dynamic-word.changing {
    opacity: 0;
    transform: translateY(10px);
}

@keyframes bang {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

:root {
    --bg: #FAFAF9;
    --text: #1C1917;
    --glass: rgba(255, 255, 255, 0.98);
    --border: rgba(0,0,0,0.08);
    --current-font: 'Poppins', sans-serif;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--current-font);
    transition: background 0.3s ease;
}

.nav-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(250, 250, 249, 0.8);
    backdrop-filter: blur(5px);
    padding: 5px;
    border-radius: 30px;
    transition: opacity 0.5s ease;
}

.nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: #78716C;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.nav-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 6px 10px;
    background: #000;
    color: #fff;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1010;
    opacity: 0;
    animation: tooltipFade 0.2s forwards;
    pointer-events: none;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: translate(-50%, 0); }
    to { opacity: 1; transform: translate(-50%, 4px); }
}

.studio-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #000;
    color: #fff;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 3100;
    opacity: 0;
    animation: tooltipFade 0.2s forwards;
    pointer-events: none;
}

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

.close-btn svg, .studio-close svg {
    width: 24px;
    height: 24px;
    display: block;
}

body.typing .nav-container {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.signature {
    position: fixed;
    bottom: 20px;
    right: 30px;
    left: auto;
    transform: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #333333;
    pointer-events: auto;
    z-index: 50;
    opacity: 0.8;
    transition: opacity 0.5s;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.typing .signature, body.typing .footer-left { opacity: 0.1; }

main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding-top: 100px;
    position: relative;
    z-index: 1;
}

.suggestion-bar {
    position: fixed;
    z-index: 3100;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    max-height: 200px;
    min-width: 140px;
    overflow-y: auto;
    overflow-x: hidden;
}

.suggestion-bar.show {
    opacity: 1;
    pointer-events: auto;
}

.suggestion-bar::-webkit-scrollbar { display: none; }

.suggestion-item {
    flex: 0 0 auto;
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    background: transparent;
    border-radius: 4px;
    font-family: var(--current-font);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.1s;
    color: var(--text);
    border: none;
    box-shadow: none;
}

.suggestion-item:hover {
    background: rgba(0,0,0,0.05);
}

.suggestion-item:active {
    background: rgba(0,0,0,0.1);
}

#editor {
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border: none;
    background: transparent;
    font-family: var(--current-font);
    font-size: 1.5rem;
    line-height: 1.8;
    padding: 0 20px 150px 20px;
    color: #292524;
    transition: font-family 0.2s ease;
    outline: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

#editor.is-empty::before {
    content: attr(placeholder);
    color: #d6d3d1;
    font-weight: 400;
    transition: opacity 0.5s;
    pointer-events: none;
    display: block;
    opacity: 1;
}

#editor.is-empty:focus::before {
    opacity: 0.5;
    color: #a8a29e;
}

#editor h1 {
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1.2;
    margin: 1em 0 0.5em 0;
    color: var(--text);
}

#editor h2 {
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
    margin: 1em 0 0.5em 0;
    color: var(--text);
}

#editor ul, #editor ol { margin: 0 0 1em 2em; padding: 0; }
#editor li { margin-bottom: 0.5em; }

#preview {
    display: none;
    box-sizing: border-box;
    padding: 60px;
    font-family: var(--current-font);
    font-size: 1.8rem;
    line-height: 1.6;
    background: var(--bg);
    color: #292524;
    min-height: 600px;
    border-radius: 0;
    flex-direction: column;
    justify-content: space-between;
}

.capture-signature {
    margin-top: 40px;
    width: 100%;
    text-align: right;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #78716C;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

h1 { font-size: 1.8em; font-weight: 400; line-height: 1.2; margin: 0 0 0.5em 0; }
p { font-size: 1em; line-height: 1.6; margin-bottom: 1.2em; }

body.split-mode main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
}

body.split-mode textarea#editor {
    border-right: 1px solid var(--border);
    padding-right: 20px;
}

#split-output {
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border: none;
    resize: none;
    background: transparent;
    font-family: var(--current-font);
    font-size: 1.5rem;
    line-height: 1.8;
    color: #D97706;
    padding: 0 10px 150px 10px;
}

@media (max-width: 768px) {
    body.split-mode main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    body.split-mode textarea#editor {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 40vh;
    }
}

#toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #1C1917;
    color: #FAFAF9;
    padding: 8px 20px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 2000;
}

#toast.show { opacity: 1; transform: translateY(-10px) translateX(-50%); }

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
}

.settings-modal.open { opacity: 1; pointer-events: all; }

.settings-content {
    background: var(--bg);
    width: 420px;
    max-width: 90%;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 24px;
    border: 1px solid var(--border);
}

.settings-modal.open .settings-content { transform: scale(1) translateY(0); }

.settings-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.settings-header h2 { margin: 0; font-family: 'Poppins', sans-serif; font-size: 1.4rem; }

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #78716C;
    padding: 0;
}

.settings-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.settings-section:last-child { border-bottom: none; }

.settings-section h3 {
    margin: 0 0 12px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #78716C;
    font-weight: 600;
}

.settings-section:nth-of-type(2) {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
}

.lang-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lang-grid::-webkit-scrollbar { display: none; }

.lang-item {
    flex: 0 0 auto;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-item:hover { background: rgba(0,0,0,0.02); border-color: #D6D3D1; }
.lang-item.selected { background: #FFF7ED; border-color: #FDBA74; color: #C2410C; }
.lang-letter { font-size: 1.5rem; margin-bottom: 4px; }
.lang-label { font-size: 0.75rem; font-family: 'Poppins', sans-serif; }

.font-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.font-list::-webkit-scrollbar { width: 4px; }
.font-list::-webkit-scrollbar-thumb { background: #E5E5E5; border-radius: 4px; }

.font-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: #fff;
    font-family: var(--current-font);
    font-size: 1rem;
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2378716C%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.6-6.4H19.2c-7.6%200-13.6%204.8-13.6%2012.8s6%2012.8%2013.6%2012.8h254.8c7.6%200%2013.6-4.8%2013.6-12.8s-6-12.8-13.6-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

.font-select:focus {
    border-color: #FDBA74;
    box-shadow: 0 0 0 2px rgba(253, 186, 116, 0.4);
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-row h3 { margin: 0; }

.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #D97706; }
input:checked + .slider:before { transform: translateX(22px); }

@media print {
    .nav-container, #toast, .signature { display: none !important; }
    body::after { content: 'typedesi'; position: fixed; bottom: 0; left:0; width:100%; text-align:center; font-family:'Poppins'; font-weight: 600; font-size:10pt; color:#444; }
    body, main { height: auto; overflow: visible; padding: 0; background: white; }
    textarea { display: none; }
    #preview { display: block !important; padding: 0; color: black; }
    @page { margin: 1.5cm; }
}

.settings-modal.feedback-modal .settings-content {
    width: 600px;
    max-width: 95%;
}

.feedback-lang-toggle .lang-opt {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
}

.feedback-lang-toggle .lang-opt:hover {
    background: rgba(0,0,0,0.05);
    border-color: #D6D3D1;
}

.feedback-lang-toggle .lang-opt.active {
    background: #FFF7ED;
    border-color: #FDBA74;
    color: #C2410C;
    font-weight: 500;
}

.roadmap-page {
    overflow-y: auto;
    height: auto;
    padding-bottom: 50px;
}

.roadmap-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.roadmap-col h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #78716C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.feature-card h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.footer-left {
    position: fixed;
    bottom: 20px;
    left: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text);
    text-decoration: none;
    z-index: 100;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-left:hover { opacity: 1; }

@media print {
    .nav-container, #toast, .signature, .footer-left { display: none !important; }
}

.footer-controls {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    transition: none;
}
.footer-controls > .dd-container,
.footer-controls > .footer-sep {
    margin-right: 8px;
}
.footer-controls > .dd-container:last-child,
.footer-controls > .footer-sep:last-child {
    margin-right: 0;
}

.footer-controls:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.footer-sep {
    width: 1px;
    height: 16px;
    background: #e5e5e5;
    opacity: 0.6;
}

.dd-container {
    position: relative;
}

.dd-trigger {
    background: transparent;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500; /* Less bold than 600 */
    color: var(--text);
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}

.dd-trigger:hover, .dd-trigger.active {
    background: transparent;
    opacity: 1;
}

.dd-trigger::after {
    content: none; /* Remove the arrow */
}


/* Scrollbar */
.dd-menu::-webkit-scrollbar { width: 4px; }
.dd-menu::-webkit-scrollbar-thumb { background: #e5e5e5; border-radius: 4px; }
