@import url('./fonts.css?family=Vazirmatn:wght@300;400;600;700&display=swap');

:root {
    --bg-primary: #f4f6f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --accent: #3182ce;
    --accent-hover: #2b6cb0;
    --accent-light: #ebf8ff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px rgba(0,0,0,0.04);
    --shadow-hover: 0 10px 15px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-full: 9999px;
}

* {font-family: 'Vazirmatn', sans-serif; margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }

/* Header */
.header { text-align: center; margin-bottom: 50px; }
.header h1 { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.header p { color: var(--text-secondary); font-size: 1.1rem; }

/* Navigation */
.nav { display: flex; justify-content: center; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; }
.nav-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.nav-link:hover { background: var(--accent-light); color: var(--accent); border-color: transparent; }
.nav-link.active {
    background: var(--accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.3);
}

/* Search */
.search-box { margin-bottom: 50px; }
.search-wrapper { position: relative; max-width: 600px; margin: 0 auto; }
.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2); }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-clear {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    background: var(--bg-primary); border: none; width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; display: none; align-items: center; justify-content: center; color: var(--text-muted);
}
.search-clear.visible { display: flex; }

/* Category Section */
.category-section { margin-bottom: 50px; }
.category-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.category-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.category-title { font-size: 1.2rem; font-weight: 600; }
.category-count { background: var(--bg-primary); padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.8rem; color: var(--text-muted); margin-right: auto; }

/* Links Grid */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* Link Card */
.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.2s;
}
.link-card:hover { border-color: transparent; box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.link-logo { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; margin-bottom: 15px; background: var(--bg-primary); }
.link-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.link-url { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; margin-bottom: 8px; }
.link-description { font-size: 0.9rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Empty & No Results */
.empty-state, .no-results { text-align: center; padding: 60px 20px; background: var(--bg-secondary); border-radius: var(--radius); border: 1px dashed var(--border); color: var(--text-secondary); }
.empty-state h3 { margin-bottom: 5px; color: var(--text-primary); }

/* ==================== CONTACT & FORM STYLES (FIXED) ==================== */

/* About Hero */
.about-hero {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}
.about-hero h2 { font-size: 1.8rem; margin-bottom: 15px; }
.about-hero p { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    transition: 0.2s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { width: 50px; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.feature-card h4 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* Contact Layout */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    align-items: flex-start;
}
@media (max-width: 900px) {
    .contact-wrapper { grid-template-columns: 1fr; }
}

/* Contact Info Card */
.contact-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
}
.contact-item { display: flex; gap: 15px; margin-bottom: 25px; }
.contact-icon {
    width: 48px; height: 48px;
    background: var(--accent-light);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.contact-details h4 { font-size: 1rem; margin-bottom: 4px; font-weight: 600; }
.contact-details p { color: var(--text-secondary); font-size: 0.95rem; margin: 0; }

/* Form Card */
.contact-form-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}
/* Form Grid Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s;
    -webkit-appearance: none; /* Fix appearance for selects */
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}
.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}
.form-textarea { min-height: 120px; resize: vertical; }

/* Button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.2);
}
.btn svg { width: 18px; height: 18px; }

/* Toast */
.toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 1000; }
.toast {
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-hover);
    display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 4px solid #48bb78; }
.toast.error { border-left: 4px solid #f56565; }
/* Modal Styles for Users */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s;
    padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 100%; max-width: 450px;
    max-height: 90vh; overflow-y: auto;
    transform: scale(0.9); transition: 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: #aaa; transition: 0.2s;
}
.modal-close:hover { color: #000; }

/* Form Tweaks */
.form-input, .form-select {
    width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0;
    border-radius: 8px; font-family: inherit; font-size: 0.95rem;
    background: #f9fafb; transition: 0.2s;
}
.form-input:focus, .form-select:focus {
    border-color: var(--accent); background: #fff; outline: none;
    box-shadow: 0 0 0 3px rgba(49,130,206,0.1);
}
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group { margin-bottom: 15px; }
input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }
a{
	text-decoration: none;
	cursor:pointer;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}