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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #faf5ff 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: #3b82f6;
}

.desktop-nav {
    display: flex;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    padding: 0.5rem;
}

/* Mobile Navigation Sidebar */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.mobile-nav-close:hover {
    background: #f3f4f6;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mobile-nav-links a:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

/* Main */
.main {
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: #6b7280;
    max-width: 48rem;
    margin: 0 auto 2rem;
}

/* Tool Section */
.tool-section {
    margin-bottom: 4rem;
}

.tool-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header-with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937;
}

.section-title {
    font-size: 1.5rem;
}

.card-content {
    padding: 1.5rem;
}

/* Text Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.stat-words { background-color: #dbeafe; }
.stat-characters { background-color: #e9d5ff; }
.stat-no-spaces { background-color: #d1fae5; }
.stat-sentences { background-color: #fed7aa; }
.stat-paragraphs { background-color: #fce7f3; }
.stat-reading-time { background-color: #e0e7ff; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-words .stat-number { color: #2563eb; }
.stat-characters .stat-number { color: #7c3aed; }
.stat-no-spaces .stat-number { color: #059669; }
.stat-sentences .stat-number { color: #ea580c; }
.stat-paragraphs .stat-number { color: #db2777; }
.stat-reading-time .stat-number { color: #4338ca; }

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-outline {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Text Input */
.text-input {
    width: 100%;
    min-height: 25rem;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Content Guidelines */
.guidelines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guideline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.badge {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}

/* Tabs */
.tabs {
    width: 100%;
}

.tab-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.tab-trigger {
    padding: 0.5rem;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.tab-trigger.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

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

.keyword-list {
    max-height: 16rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keyword-item {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.keyword-phrase {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.keyword-stats {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Features Section */
.features-section {
    margin-bottom: 4rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 32rem;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.feature-icon-blue { background-color: #dbeafe; color: #2563eb; }
.feature-icon-purple { background-color: #e9d5ff; color: #7c3aed; }
.feature-icon-green { background-color: #d1fae5; color: #059669; }

.feature-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #6b7280;
}

/* Guide Section */
.guide-section {
    margin-bottom: 4rem;
}

.guide-tabs {
    width: 100%;
}

.guide-tab-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.guide-tab-trigger {
    padding: 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.guide-tab-trigger.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.guide-tab-content {
    display: none;
}

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

.guide-tab-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-content {
    color: #374151;
}

.guide-section {
    margin-bottom: 1.5rem;
}

.guide-section h5 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.guide-section ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.guide-section li {
    margin-bottom: 0.25rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1.5rem;
}

.content-type h5 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-description {
    color: #9ca3af;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.language-selector {
    margin-bottom: 2rem;
}

.language-selector h4 {
    color: #d1d5db;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: #d1d5db;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.language-option:hover {
    background: #374151;
    border-color: #4b5563;
}

.language-option.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.language-option img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .guide-tab-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    /* Mobile: 2 elements per row for stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .card-header-with-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    /* Keep buttons in same row on mobile */
    .action-buttons {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem 0.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-tab-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.125rem;
        padding: 0.125rem;
    }
    
    .guide-tab-trigger {
        padding: 0.375rem 0.25rem;
        font-size: 0.75rem;
        border-radius: 0.25rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Mobile: 2 languages per row */
    .language-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    /* Mobile layout reordering: Text input first, then stats, then sidebar content */
    .tool-layout {
        display: flex;
        flex-direction: column;
    }
    
    /* Text input area order */
    .main-content {
        order: 1;
        display: flex;
        flex-direction: column;
    }
    
    /* Text input card should be first */
    .main-content .card:has(.text-input) {
        order: 1;
    }
    
    /* Text statistics card should be second */
    .main-content .card:has(.stats-grid) {
        order: 2;
    }
    
    /* Sidebar content (guidelines and keyword density) comes after */
    .sidebar {
        order: 3;
    }
    
    /* Improve keyword density design on mobile */
    .keyword-card {
        margin-bottom: 1rem;
    }
    
    .tab-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.125rem;
        padding: 0.125rem;
    }
    
    .tab-trigger {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        border-radius: 0.25rem;
    }
    
    .keyword-list {
        max-height: 12rem;
        padding: 0.5rem;
    }
    
    .keyword-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 0.375rem;
    }
    
    .keyword-phrase {
        font-size: 0.875rem;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 0.25rem;
    }
    
    .keyword-stats {
        font-size: 0.75rem;
        color: #64748b;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    /* Mobile: 2 elements per row for very small screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    /* Keep buttons in row but smaller */
    .action-buttons {
        flex-direction: row;
        gap: 0.25rem;
    }
    
    .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.25rem;
    }
    
    .tab-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Mobile: 2 languages per row on small screens */
    .language-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
    }
    
    .language-option {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .mobile-nav-content {
        width: 100%;
        max-width: 280px;
    }
    
    /* Better mobile spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    /* Improve text input on mobile */
    .text-input {
        min-height: 20rem;
        font-size: 1rem;
    }
    
    /* Better stat items on mobile */
    .stat-item {
        padding: 0.5rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.75rem;
        margin-top: 0.125rem;
    }
}