/* ==========================================================================
   Cursive & Unicode Text Generator Premium Stylesheet
   ========================================================================== */

:root {
    /* Transitions & Radii */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    --glass-blur: blur(12px);
}

/* Dark Theme Variables (Default) */
html[data-theme="dark"], :root {
    --bg-base: hsl(224, 25%, 8%);
    --bg-surface: hsla(224, 25%, 13%, 0.65);
    --bg-input: hsl(224, 25%, 10%);
    --bg-control: hsl(224, 20%, 15%);
    
    --border-color: hsla(224, 20%, 22%, 0.7);
    --border-hover: hsla(255, 80%, 75%, 0.4);
    --border-focus: hsl(255, 80%, 65%);
    
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 15%, 82%);
    --text-muted: hsl(210, 10%, 58%);
    
    --accent-purple: hsl(255, 80%, 65%);
    --accent-purple-glow: hsla(255, 80%, 65%, 0.18);
    --accent-purple-hover: hsl(255, 80%, 58%);
    --accent-success: hsl(145, 80%, 48%);
    --accent-success-glow: hsla(145, 80%, 48%, 0.15);
    
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.25);
    --shadow-input: 0 10px 30px rgba(120, 80, 250, 0.1);
    
    --glass-bg: hsla(224, 25%, 12%, 0.45);
    --glass-border: hsla(224, 25%, 100%, 0.07);
}

/* Light Theme Variables */
html[data-theme="light"] {
    --bg-base: hsl(210, 25%, 96%);
    --bg-surface: hsla(0, 0%, 100%, 0.75);
    --bg-input: hsl(0, 0%, 100%);
    --bg-control: hsl(210, 18%, 91%);
    
    --border-color: hsla(210, 14%, 84%, 0.7);
    --border-hover: hsla(255, 80%, 65%, 0.3);
    --border-focus: hsl(255, 80%, 55%);
    
    --text-primary: hsl(220, 25%, 12%);
    --text-secondary: hsl(220, 12%, 35%);
    --text-muted: hsl(220, 10%, 55%);
    
    --accent-purple: hsl(255, 75%, 55%);
    --accent-purple-glow: hsla(255, 75%, 55%, 0.12);
    --accent-purple-hover: hsl(255, 75%, 48%);
    --accent-success: hsl(145, 80%, 38%);
    --accent-success-glow: hsla(145, 80%, 38%, 0.1);
    
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.03);
    --shadow-input: 0 10px 35px rgba(120, 80, 250, 0.05);
    
    --glass-bg: hsla(0, 0%, 100%, 0.55);
    --glass-border: hsla(0, 0%, 0%, 0.06);
}

/* Reset and Global Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font-body);
    line-height: 1.6;
    padding: 50px 0;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: background-color 0.4s ease;
}

/* Pulsing backdrop aura colors */
.glass-bg-blur {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    z-index: -1;
    background: radial-gradient(circle at 15% 25%, hsla(255, 80%, 65%, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 85% 75%, hsla(180, 85%, 55%, 0.07) 0%, transparent 40%);
    filter: blur(120px);
    pointer-events: none;
    transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
    border: 3px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Page Layout Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* Glassmorphism card standard */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.header-utilities {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    transform: rotate(30deg) scale(1.1);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple-glow);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    color: var(--accent-purple);
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-serif);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.logo-icon:hover {
    transform: scale(1.05) rotate(-5deg);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-hover), 0 0 25px var(--accent-purple-glow);
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-purple-glow) 0%, transparent 60%);
    pointer-events: none;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-purple) 0%, hsl(180, 85%, 55%) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==========================================================================
   Main Core Input Section Layout
   ========================================================================== */

.input-section {
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
}

.input-section:focus-within {
    box-shadow: var(--shadow-hover), var(--shadow-input);
    border-color: var(--border-focus);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.input-title {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-purple);
}

.char-counter {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.textarea-wrapper {
    position: relative;
    width: 100%;
}

.input-section textarea {
    width: 100%;
    height: 130px;
    padding: 18px 50px 18px 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.25rem;
    resize: none;
    line-height: 1.5;
    transition: var(--transition-smooth);
}

.input-section textarea:focus {
    background-color: var(--bg-input);
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 5px var(--accent-purple-glow);
}

.clear-btn {
    position: absolute;
    right: 18px;
    top: 18px;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.clear-btn:hover {
    background: var(--accent-purple);
    color: #fff;
    border-color: var(--accent-purple);
    transform: scale(1.1);
}

.clear-btn svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Symbol Picker Drawer Styles
   ========================================================================== */

.symbol-panel {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.symbol-header-row {
    margin-bottom: 12px;
}

.panel-subtitle {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.symbol-tabs-container {
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbars */
    margin-bottom: 14px;
    padding-bottom: 4px;
}

.symbol-tabs-container::-webkit-scrollbar {
    display: none;
}

.symbol-tabs {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.symbol-tab-btn {
    padding: 8px 16px;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.symbol-tab-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

.symbol-tab-btn.active {
    background: var(--accent-purple);
    color: #fff;
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.symbol-content {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    max-height: 110px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    align-content: start;
}

.symbol-btn {
    height: 38px;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.symbol-btn:hover {
    background: var(--accent-purple-glow);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

/* Custom dimensions for Kaomoji elements */
.symbol-content.kaomoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.symbol-btn.kaomoji-btn {
    font-size: 0.85rem;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controller Options Bar */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.search-filter {
    position: relative;
    flex-grow: 1;
    min-width: 280px;
}

.search-filter input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.search-filter input:focus {
    background-color: var(--bg-input);
    border-color: var(--accent-purple);
}

.search-filter svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* Button Mechanics */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 22px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    background: transparent;
}

.btn-primary {
    background-color: var(--accent-purple);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.btn-primary:hover {
    background-color: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-purple-glow);
}

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

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

.btn-secondary:hover {
    background-color: var(--bg-control);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

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

/* ==========================================================================
   Category Tab Badges Nav
   ========================================================================== */

.category-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 35px auto;
    flex-wrap: wrap;
    max-width: 100%;
}

.category-btn {
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-btn:hover {
    background: var(--bg-control);
    color: var(--text-primary);
    transform: translateY(-2px);
    border-color: var(--accent-purple);
}

.category-btn.active {
    background: var(--accent-purple);
    color: #fff;
    border-color: var(--accent-purple);
    box-shadow: 0 6px 18px var(--accent-purple-glow);
    transform: translateY(-2px);
}

/* ==========================================================================
   Grid Sections Layouts
   ========================================================================== */

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.section-icon {
    font-size: 1.6rem;
}

.section-title h2 {
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.favorites-section {
    margin-bottom: 50px;
    padding: 30px;
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* ==========================================================================
   Output Font Card Design
   ========================================================================== */

.font-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    transition: var(--transition-smooth);
    position: relative;
    min-height: 190px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    overflow: hidden;
}

.font-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
}

.font-card:hover::before {
    opacity: 1;
}

.font-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover), 0 10px 25px var(--accent-purple-glow);
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.card-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.style-badge {
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.font-card:hover .style-badge {
    color: var(--accent-purple);
}

.category-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background-color: var(--bg-control);
    color: var(--text-secondary);
    width: fit-content;
}

.btn-star {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-star:hover {
    color: #ffb800;
    transform: scale(1.25);
}

.btn-star.starred {
    color: #ffb800;
    filter: drop-shadow(0 0 5px rgba(255, 184, 0, 0.45));
}

.btn-star svg {
    width: 20px;
    height: 20px;
}

.card-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    width: 100%;
}

.output-text {
    font-size: 1.35rem;
    color: var(--text-primary);
    word-break: break-word;
    user-select: all;
    line-height: 1.4;
    width: 100%;
    padding: 6px;
    border-radius: var(--radius-sm);
    border: 1px dashed transparent;
    transition: var(--transition-fast);
}

.output-text:focus {
    background: var(--bg-input);
    border-color: var(--accent-purple);
    outline: none;
    border-style: solid;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-copy-micro {
    padding: 8px 14px;
    font-size: 0.8rem;
    background-color: var(--bg-control);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy-micro:hover {
    background-color: var(--accent-purple-glow);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-1px);
}

.btn-copy-micro svg {
    width: 14px;
    height: 14px;
}

.btn-copy-micro.copied-success {
    background-color: var(--accent-success-glow);
    border-color: var(--accent-success);
    color: var(--accent-success);
    box-shadow: 0 2px 8px var(--accent-success-glow);
}

/* Blank Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
}

.empty-state svg {
    width: 50px;
    height: 50px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.empty-state h3 {
    margin-bottom: 6px;
    font-size: 1.25rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-success);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15), 0 5px 15px rgba(0,0,0,0.05);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    pointer-events: auto;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transform: translateY(120%) scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-success);
    flex-shrink: 0;
}

/* Footer Section */
footer {
    text-align: center;
    padding: 30px 0 10px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 60px;
}

.footer-content p {
    margin-bottom: 8px;
}

/* ==========================================================================
   Responsive Configurations (Media Queries)
   ========================================================================== */

@media (max-width: 960px) {
    body {
        padding: 40px 0;
    }
    
    .styles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    header h1 {
        font-size: 2.6rem;
    }
}

@media (max-width: 650px) {
    body {
        padding: 30px 0;
    }
    
    .container {
        padding: 0 16px;
    }
    
    header {
        margin-bottom: 30px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .input-section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .input-section textarea {
        height: 110px;
        padding: 14px 44px 14px 16px;
        font-size: 1.1rem;
    }
    
    .clear-btn {
        right: 14px;
        top: 14px;
        width: 28px;
        height: 28px;
    }
    
    .control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-filter {
        width: 100%;
        min-width: 0;
    }
    
    .button-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .category-nav {
        margin: 20px auto;
        gap: 6px;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .styles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .font-card {
        padding: 18px;
        min-height: 160px;
        gap: 14px;
    }
    
    .output-text {
        font-size: 1.2rem;
    }
    
    .favorites-section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 20px;
    }
    
    .toast {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Language Switcher & RTL (Arabic) Support
   ========================================================================== */

.lang-switcher {
    position: relative;
    display: inline-block;
    margin-right: 12px;
}

.lang-switcher-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.lang-switcher-btn:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple-glow);
    transform: translateY(-1px);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 150px;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    padding: 6px;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95);
    transition: transform var(--transition-fast), opacity var(--transition-fast), visibility var(--transition-fast);
    transform-origin: top right;
}

.lang-dropdown.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.lang-item:hover {
    background: var(--bg-control);
    color: var(--text-primary);
}

.lang-item.active {
    background: var(--accent-purple);
    color: #fff;
}

/* ==========================================================================
   RTL Layout Overrides (Arabic lang="ar" / dir="rtl")
   ========================================================================== */

[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] body {
    direction: rtl;
}

[dir="rtl"] .lang-switcher {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
    transform-origin: top left;
}

[dir="rtl"] .search-filter input {
    padding: 13px 44px 13px 16px;
}

[dir="rtl"] .search-filter svg {
    left: auto;
    right: 16px;
}

[dir="rtl"] .clear-btn {
    right: auto;
    left: 18px;
}

[dir="rtl"] .input-section textarea {
    padding: 18px 22px 18px 50px;
}

[dir="rtl"] .btn-copy-micro {
    flex-direction: row-reverse;
}

[dir="rtl"] .font-card::before {
    background: linear-gradient(-90deg, transparent, var(--accent-purple), transparent);
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 30px;
}

[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid var(--accent-success);
    transform: translateY(120%) scale(0.9);
}

[dir="rtl"] .toast.show {
    transform: translateY(0) scale(1);
}

@media (max-width: 650px) {
    [dir="rtl"] .lang-switcher {
        margin-left: 0;
    }
    
    [dir="rtl"] .search-filter input {
        padding: 14px 44px 14px 16px;
    }
    
    [dir="rtl"] .clear-btn {
        left: 14px;
    }
    
    [dir="rtl"] .input-section textarea {
        padding: 14px 16px 14px 44px;
    }
    
    [dir="rtl"] .toast-container {
        left: 16px;
        right: 16px;
    }
}

/* ==========================================================================
   Top Main Navigation Bar Styles
   ========================================================================== */

.top-nav {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    margin-bottom: 45px;
    margin-top: 20px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-control);
}

.nav-link.active {
    color: var(--accent-purple);
    background-color: var(--accent-purple-glow);
}

/* Nav Dropdown Styling */
.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.nav-dropdown-btn.active {
    color: var(--accent-purple);
    background-color: var(--accent-purple-glow);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 210px;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    padding: 6px;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95);
    transition: transform var(--transition-fast), opacity var(--transition-fast), visibility var(--transition-fast);
    transform-origin: top left;
}

.nav-dropdown.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-dropdown-item:hover {
    background: var(--bg-control);
    color: var(--text-primary);
}

.nav-dropdown-item.active {
    background: var(--accent-purple-glow);
    color: var(--accent-purple);
}

[dir="rtl"] .nav-dropdown {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.top-nav .header-utilities {
    margin-bottom: 0;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Responsive Configurations for Navigation
   ========================================================================== */

@media (max-width: 900px) {
    .top-nav {
        flex-direction: column;
        gap: 16px;
        padding: 18px;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .top-nav .header-utilities {
        justify-content: center;
    }
}

@media (max-width: 650px) {
    .top-nav {
        margin-top: 10px;
        margin-bottom: 25px;
        padding: 10px 8px;
        gap: 12px;
        border-radius: var(--radius-md);
    }

    /* Centered Wrapping Navigation for Mobile with fully visible dropdowns */
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
        overflow: visible;
    }

    .nav-link, .nav-dropdown-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        background: var(--bg-control);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
    }
    
    .nav-link.active, .nav-dropdown-btn.active {
        background-color: var(--accent-purple);
        color: #fff;
        border-color: var(--accent-purple);
    }

    /* Centered mobile dropdown alignments to prevent horizontal screen overflow */
    .nav-dropdown {
        left: 50%;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
        transform-origin: top center;
        width: 200px;
    }

    .nav-dropdown.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    .lang-dropdown {
        right: 50%;
        transform: translateX(50%) translateY(-10px) scale(0.95);
        transform-origin: top center;
    }

    .lang-dropdown.show {
        transform: translateX(50%) translateY(0) scale(1);
    }
}

/* RTL Specific Overrides for Top Navigation */
[dir="rtl"] .top-nav {
    flex-direction: row;
}

[dir="rtl"] .top-nav .header-utilities {
    margin-right: auto;
    margin-left: 0;
}

@media (max-width: 900px) {
    [dir="rtl"] .top-nav {
        flex-direction: column;
    }
    [dir="rtl"] .top-nav .header-utilities {
        margin-right: 0;
    }
}

/* ==========================================================================
   Blog Guide Section & Post Styles
   ========================================================================== */

.blog-section {
    margin-top: 60px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.blog-post {
    margin-top: 24px;
}

.blog-post h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.blog-post p {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.blog-post ol {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-left: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-post li {
    color: var(--text-secondary);
}

.blog-post li strong {
    color: var(--text-primary);
}

.blog-post .pro-tip {
    background: var(--bg-control);
    border-left: 4px solid var(--accent-purple);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

[dir="rtl"] .blog-post ol {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] .blog-post .pro-tip {
    border-left: none;
    border-right: 4px solid var(--accent-purple);
}

@media (max-width: 650px) {
    .blog-section {
        padding: 24px 18px;
        margin-top: 40px;
    }
    
    .blog-post h3 {
        font-size: 1.3rem;
    }
}
