/* css/styles.css */
:root {
    /* Light Theme (Default) */
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --danger-color: #ef4444;
    --danger-hover: #dc2828;
    --accent-color: #ec4899;
}

body.dark-mode {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --text-muted: #9ca3af;
    --glass-bg: rgba(31, 41, 55, 0.6);
    --glass-border: rgba(75, 85, 99, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    padding-bottom: 80px;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.05), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.05), transparent 25%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary-color);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background: rgba(100, 116, 139, 0.1);
}

.lang-select {
    appearance: none;
    background-color: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 6px 32px 6px 16px;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.lang-select:hover, .lang-select:focus {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 6px 14px -4px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body[dir="rtl"] .lang-select {
    padding: 6px 16px 6px 32px;
    background-position: left 12px center;
}

.hidden { display: none !important; }

.ad-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
}
ins.adsbygoogle {
    background-color: rgba(100, 116, 139, 0.1) !important;
    border: 2px dashed rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--text-muted);
    font-size: 0.875rem;
}
ins.adsbygoogle[data-ad-status="unfilled"]::after,
ins.adsbygoogle:empty::after {
    content: "AdSense Block (Localhost/Test)";
    position: absolute;
    z-index: 1;
}
ins.adsbygoogle > * {
    z-index: 2;
    position: relative;
}
.ad-sidebar .sidebar-ad {
    height: 250px;
}
.ad-mobile-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
}
.ad-mobile-sticky .mobile-ad {
    height: 50px;
    border: none;
    max-width: 320px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .ad-mobile-sticky { display: none; }
    body { padding-bottom: 20px; }
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}

@media (min-width: 1024px) {
    .main-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.editor-glass-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    height: 400px;
    padding: 24px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1.125rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.02);
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.toolbar-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.2);
}

.btn-danger {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}
.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}
.w-100 { width: 100%; }

.grammar-alerts {
    margin-top: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger-color);
    padding: 16px;
    border-radius: 0 8px 8px 0;
}
.grammar-alerts h4 { margin-bottom: 8px; font-size: 0.9rem;}
.grammar-alerts ul { 
    margin-left: 20px;
    font-size: 0.875rem;
    color: var(--danger-color);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 24px;
}

.sticky-wrapper {
    position: sticky;
    top: 90px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    margin-top: 4px;
}
.text-small {
    font-size: 1.5rem;
    color: var(--text-color);
}

.time-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.time-box {
    display: flex;
    align-items: center;
    gap: 16px;
}
.time-box svg {
    color: var(--accent-color);
}

.keyword-section { margin-top: 24px; }
.keyword-section h3 {
    margin-bottom: 16px;
    font-size: 1.125rem;
}
.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.keyword-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.keyword-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}
.placeholder-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}
