@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Caveat:wght@600;700&display=swap');

/* Modern CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --background: #ffffff;
    --background-secondary: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #1e3a8a;
    --background: #0f172a;
    --background-secondary: #1e293b;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-hover: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--background-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 0 1rem 1.5rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.nav-item .material-symbols-outlined {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-secondary);
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: transparent;
    color: var(--primary);
}

.nav-item:hover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0.08;
    border-radius: var(--radius);
}

.nav-item:hover .material-symbols-outlined {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.active .material-symbols-outlined {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-container {
    flex: 1;
    width: 100%;
    transition: var(--transition);
}

.main-container.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="dark"] .header {
    background: rgba(30, 41, 59, 0.85);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
    padding: 0 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    background: var(--background-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown {
    position: relative;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    background: var(--background-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--border);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    padding: 0.5rem;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

/* Main Area */
.main {
    padding: 2.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.container {
    width: 100%;
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 1rem;
}

.title-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.title-icon {
    font-size: 4rem;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

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

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.sparkle-emoji {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    animation: twinkle 1.5s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.main-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(to right, #ec4899, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.subtitle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cursive-subtitle {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #1e293b;
    transform: rotate(-2deg);
}

[data-theme="dark"] .cursive-subtitle {
    color: #f8fafc;
}

.sparkle-lines {
    width: 50px;
    height: 50px;
}

.header-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 500;
}

.highlight-ig {
    color: #ec4899;
    font-weight: 700;
}

.highlight-tt {
    color: #a855f7;
    font-weight: 700;
}

.highlight-tw {
    color: #3b82f6;
    font-weight: 700;
}

/* Sticky Input Section */
.sticky-text-input {
    position: sticky;
    top: 5.5rem;
    z-index: 50;
    margin-bottom: 2.5rem;
}

.text-input-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2px;
    /* Much thinner border line */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    background: var(--border);
    /* Solid subtle border by default */
    transition: var(--transition);
}

.text-input-container:focus-within {
    /* Gradient border activates only when typing */
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

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

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

.input-container {
    position: relative;
    background: var(--background);
    border-radius: calc(var(--radius) - 2px);
}

.text-input {
    width: 100%;
    min-height: 64px;
    /* Much thinner box! */
    padding: 1rem 3.5rem 1rem 1.25rem;
    /* Reduced padding */
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.15rem;
    /* Adjusted text size */
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.clear-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: var(--background-secondary);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-input:not(:placeholder-shown)+.clear-btn {
    opacity: 1;
}

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

/* Controls Section */
.controls-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    align-items: center;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.stats-bar {
    display: flex;
    gap: 1rem;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Font Categories & Cards */
.font-categories {
    display: grid;
    gap: 3rem;
}

.category {
    background: transparent;
}

.category-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.category-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.font-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.font-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
    transform: translateY(-4px);
}

.font-info {
    flex: 1;
    min-width: 0;
}

.font-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.font-preview {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-all;
}

.copy-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 4rem;
    height: 4rem;
    background: var(--background-secondary);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
}

.copy-btn.copied {
    background: #10b981;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

/* Article & Sections */
.article-section,
.share-section,
.faq-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    margin-top: 3rem;
    box-shadow: var(--shadow-card);
}

.article-section h2,
.faq-section h2,
.share-section h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.article-section h2 {
    margin-top: 2rem;
}

.article-section p,
.faq-item p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.article-section ul,
.article-section ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.article-section li {
    margin-bottom: 0.5rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--background-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

/* Share Section */
.share-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    margin: 3rem auto;
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    max-width: 800px;
    transition: var(--transition);
}

.share-section h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.share-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 50px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    transition: fill 0.3s ease;
}

/* Platform specific styles */
.share-btn.facebook {
    background: rgba(24, 119, 242, 0.1);
    color: #1877F2;
}
.share-btn.facebook:hover {
    background: #1877F2;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(24, 119, 242, 0.3);
}

.share-btn.twitter {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}
[data-theme="dark"] .share-btn.twitter {
    background: rgba(255, 255, 255, 0.1);
}
.share-btn.twitter:hover {
    background: var(--text-primary);
    color: var(--background);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.share-btn.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}
.share-btn.whatsapp:hover {
    background: #25D366;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(37, 211, 102, 0.3);
}

.share-btn.telegram {
    background: rgba(42, 171, 238, 0.1);
    color: #2AABEE;
}
.share-btn.telegram:hover {
    background: #2AABEE;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(42, 171, 238, 0.3);
}

.share-btn.copy {
    background: var(--primary-light);
    color: var(--primary);
}
.share-btn.copy:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--background);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}

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

/* Scroll Top */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .header-section h2 {
        font-size: 2rem;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-bar {
        flex-direction: column;
    }

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

    .article-section,
    .share-section,
    .faq-section {
        padding: 1.5rem;
    }
}