/* ===================================================
   Ferhenga Pirzimanî - Vanilla CSS (style.css)
   Sêwirana paqij, modern û guncav bo mobîlan
   =================================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.font-rtl {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

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

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

.brand-icon {
    font-size: 1.75rem;
    background-color: #fef3c7;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.brand-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Bişkok (Buttons) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Qada Sereke */
.main-content {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* Qutiya Lêgerînê */
.search-panel {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    font-size: 1rem;
    opacity: 0.6;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
    background-color: #f8fafc;
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    background-color: #ffffff;
}

.btn-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

/* Parzûnên Ziman */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    color: #334155;
}

.pill:hover {
    background-color: #e2e8f0;
}

.pill.active {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Parzûnên Kategoriyan */
.category-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.cat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.cat-pill {
    background: none;
    border: none;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
}

.cat-pill:hover {
    background-color: #f1f5f9;
}

.cat-pill.active {
    background-color: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.icon-toggle {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.825rem;
}

.icon-toggle.active {
    background: #0f172a;
    color: #ffffff;
}

/* Qertên Peyvan (Word Cards Grid) */
.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.word-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card-group-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background-color: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
}

.card-category-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 4px;
}

.translations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.trans-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.925rem;
}

.lang-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    min-width: 65px;
    text-align: center;
}

.lang-kurdi { background: #fef3c7; color: #92400e; }
.lang-ingilizi { background: #dbeafe; color: #1e40af; }
.lang-tirki { background: #fee2e2; color: #991b1b; }
.lang-farsi { background: #dcfce7; color: #166534; }
.lang-erebi { background: #ccfbf1; color: #115e59; }
.lang-fransizi { background: #e0e7ff; color: #3730a3; }

.trans-text {
    color: #1e293b;
    font-weight: 500;
}

.trans-text.rtl {
    direction: rtl;
    text-align: right;
    font-size: 1.05rem;
}

.card-rave {
    background-color: #f8fafc;
    border-left: 3px solid #cbd5e1;
    padding: 0.75rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 1rem;
}

.rave-label {
    font-weight: 700;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
}

.btn-card-action {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-card-action:hover {
    background: #f1f5f9;
}

.btn-delete:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Modala Zêdekirinê (Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.modal-note {
    font-size: 0.85rem;
    color: #0369a1;
    background: #e0f2fe;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.hidden {
    display: none !important;
}

/* Barkirina Bixweber (Autoloading Styles) */
.autoload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    position: relative;
}

.autoload-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0369a1;
    box-shadow: var(--shadow-sm);
}

.spinner-circle {
    width: 16px;
    height: 16px;
    border: 2px solid #bae6fd;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.all-loaded {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 20px;
}

.autoload-sentinel {
    height: 20px;
    width: 100%;
    pointer-events: none;
}

/* Binê Malperê (Footer) */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobil Guhartin (Mobile Responsive) */
@media (max-width: 640px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .words-grid {
        grid-template-columns: 1fr;
    }
}
