/* فونت‌های Vazir */
@font-face {
    font-family: 'Vazir-Regular-FD';
    src: url('https://sacdn.ir/fonts/vazirmatn/Vazir-Regular-FD.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir-Bold-FD';
    src: url('https://sacdn.ir/fonts/vazirmatn/Vazir-Bold-FD.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

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

body {
    font-family: 'Vazir-Regular-FD', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.8;
    direction: rtl;
}

strong, b, h1, h2, h3, h4, h5, h6 {
    font-family: 'Vazir-Bold-FD', sans-serif;
}

/* هدر سایت */
.site-header {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #000;
}

/* کانتینر */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ویرایشگر */
.editor-wrapper {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.editor-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
}

.editor-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative; /* این خط مهمه! */
}

.editor-content {
    position: relative; /* این هم مهمه! */
}

.editor-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.editor-actions {
    display: flex;
    gap: 1rem;
}

.input-title {
    width: 100%;
    font-size: 2.5rem;
    font-weight: bold;
    border: none;
    outline: none;
    padding: 1rem 0;
    background: transparent;
    font-family: 'Vazir-Bold-FD', sans-serif;
}

.input-title::placeholder {
    color: #d0d0d0;
}

.input-author {
    width: 100%;
    font-size: 0.9rem;
    color: #666;
    border: none;
    outline: none;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    background: transparent;
}

.input-author::placeholder {
    color: #d0d0d0;
}

.editor-content {
    width: 100%;
    min-height: 500px;
    font-size: 1.2rem;
    line-height: 1.8;
    outline: none;
    padding: 1rem 0;
    color: #333;
}

.editor-content:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

.editor-content h1 {
    font-size: 2em;
    margin: 1.5em 0 0.5em;
    color: #000;
}

.editor-content h2 {
    font-size: 1.5em;
    margin: 1.3em 0 0.5em;
    color: #000;
}

.editor-content blockquote {
    border-right: 4px solid #ddd;
    padding-right: 1.5rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

.editor-content a {
    color: #0066cc;
    text-decoration: none;
}

.editor-content a:hover {
    text-decoration: underline;
}

.editor-content p {
    margin: 1rem 0;
}

.editor-content .post-image,
.editor-content .post-video {
    margin: 2rem 0;
}

.editor-content .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.editor-content .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* تولبار فرمت */
.format-toolbar {
    position: fixed;
    background: #333;
    color: white;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
}

.format-toolbar button {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    transition: background 0.2s;
}

.format-toolbar button:hover {
    background: #555;
}

/* تولبار خط جدید */
.newline-toolbar {
    position: absolute;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.3rem;
    display: flex;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    left: -50px !important;
}

.toolbar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

/* دکمه‌ها */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Vazir-Regular-FD', sans-serif;
}

.btn-primary {
    background: #000;
    color: white;
}

.btn-primary:hover {
    background: #333;
}

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

.btn-outline:hover {
    background: #f5f5f5;
}

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

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* نمایش پست */
.post-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-link {
    color: #0066cc;
    text-decoration: none;
}

.post-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.post-content {
    font-size: 1.2rem;
    line-height: 1.8;
}

.post-content figure {
    margin: 2rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.share-box {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.share-box h3 {
    margin-bottom: 1rem;
}

.share-link {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-link input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Vazir-Regular-FD', sans-serif;
}

/* صفحه ورود/ثبت نام */
.auth-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.auth-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Vazir-Regular-FD', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #000;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer p {
    margin: 0.5rem 0;
}

.auth-footer a {
    color: #0066cc;
    text-decoration: none;
}

/* داشبورد کاربر */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

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

.dashboard-actions {
    display: flex;
    gap: 1rem;
}

.user-info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info-card h2 {
    margin-bottom: 0.5rem;
}

.user-email {
    color: #666;
    margin-bottom: 0.5rem;
}

.user-meta {
    color: #999;
    font-size: 0.9rem;
}

.posts-section h2 {
    margin-bottom: 1.5rem;
}

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

.post-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.post-card-meta {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.post-card-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: #666;
}

/* الرت‌ها */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3a3;
    border: 1px solid #cfc;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .editor-wrapper {
        padding: 0 1rem;
    }
    
    .editor-container {
        padding: 2rem 1.5rem;
    }
    
    .input-title {
        font-size: 2rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}