/* General Styling */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

* {
    font-family: "Vazirmatn", sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out; 
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: whitesmoke;
    background-image: url("img/LOGO.jpg");
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.content {
    flex: 1;
}

/* 🎯 اصلاح شده: آوردن کانتینر اصلی به مرکز و مدیریت فواصل */
.wrapper {
    /* حفظ کامل ساختار محتوا */
    width: 100%;
    min-height: 100vh;
    padding: 100px 0 50px; /* حذف padding افقی برای مدیریت بهتر توسط کانتینرهای داخلی */
    flex-direction: column;
    display: flex; /* تغییر به فلکس برای مرکزیت عمودی */
    align-items: center; /* آوردن محتوا به مرکز افقی */
    direction: rtl;
}


/* ------------------------------------------- */
/* 🏠 Content & Card Styles (اصلاح شده) 🏠 */
/* ------------------------------------------- */

/* 🎯 اصلاح شده: محدود کردن عرض و مرکزیت برای دسکتاپ */
.profile-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-content: center;
    padding: 20px;
    margin: 0 auto 50px; /* مرکزیت افقی */
    width: 100%;
    max-width: 1200px; /* عرض حداکثری برای نمایش بهتر */
    direction: rtl;
}

.profile-card {
    width: 100%;
    max-width: 360px;
    min-height: 280px;
    background: rgba(2, 19, 39, 0.8);
    border-radius: 12px;
    box-shadow: 0 8px 60px -10px rgba(0, 0, 0, 0.8);
    position: relative;
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-in-out forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.profile-card:hover {
    background: #042b57;
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease-in-out;
}
.profile-card__img {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 3px solid white;
}

.profile-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-card h3 {
    margin-top: 15px;
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
}
.profile-card p {
    margin-top: 10px;
    font-size: 1rem;
    color: #f8f8f8;
    padding: 0 15px;
}

/* 🎯 اصلاح شده: محدود کردن عرض و مرکزیت جدول رنکینگ */
.ranking-container {
    padding-top: 50px;
    direction: rtl;
    width: 100%;
    max-width: 1100px; /* عرض محدود برای خوانایی بهتر جدول */
    margin: 0 auto; /* مرکزیت */
    text-align: center;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.tab {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border: none;
    background: #ccc;
    font-size: 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.tab.active {
    background: #021327;
    color: white;
    font-weight: bold;
}
table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    text-align: right;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 10px;
}

th, td {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}
th {
    background: #007bff;
    color: white;
}
.post {
    border: 1px solid #ccc;
    padding: 15px;
    margin: 15px 0;
    background: #fff;
    border-radius: 5px;
}
.post img {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
}

/* 🎯 اصلاح شده: مرکزیت کانتینر اصلی بلاگ */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    width: 100%;
}
/* 🎯 اصلاح شده: محدود کردن عرض و مرکزیت کانتینر بلاگ */
.blog-container {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
    direction: rtl;
    width: 100%;
    max-width: 1200px; /* عرض حداکثری برای نمایش بهتر */
    margin: 20px auto; /* مرکزیت */
}

.blog-item {
    padding: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    text-align: right;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.read-more:hover {
    background-color: #2980b9;
}

.blog-detail {
    max-width: 700px;
    margin: auto;
    padding: 30px;
    background-color: #fefefe;
    border-radius: 10px;
    direction: rtl;
}

.three-column { grid-column: span 1; }
.two-column { grid-column: span 2; }
.single-column { grid-column: span 3; }

/* 🎯 مرکزیت پنل مدیریت */
.profile, .admin-actions {
    width: 90%; /* افزایش عرض در دستگاه‌های بزرگ */
    max-width: 500px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.admin-actions button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    transition: 0.3s;
}

.admin-actions button:hover {
    background-color: #0056b3;
}
.logout-btn {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #dc3545;
    color: white;
    transition: 0.3s;
}

.logout-btn:hover {
    background-color: #a71d2a;
}

/* ------------------------------------------- */
/* 🦶 Footer Styles (حفظ و بهینه شده) 🦶 */
/* ------------------------------------------- */

.footer {
    background: #f8f8f8;
    text-align: center;
    padding: 0;
    width: 100%;
    direction: rtl;
}

/* نوار بالای فوتر - حذف منحنی‌ها */
.top-bar {
    padding: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 70px; 
}
.top-bar::before, .top-bar::after {
    content: '';
    display: block;
    background-color: #021327; 
    flex-grow: 1;
    min-width: 30%;
    height: 100%; 
}
.top-bar .logo-container {
    background-color: white; 
    padding: 5px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    height: 100%; 
}
.top-bar .logo-container img {
    max-height: 60px; 
    width: auto;
}

/* بقیه بخش‌های فوتر */
.bottom-section {
    background-color: #e9ecef; 
    padding: 30px 20px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content {
    display: flex;
    justify-content: space-around; 
    width: 90%;
    max-width: 1200px;
    flex-wrap: wrap;
    text-align: right; 
}

.footer-section {
    flex: 1;
    min-width: 220px; 
    margin: 15px;
}
.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 800; 
    color: #021327;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff; 
    display: inline-block;
    padding-bottom: 5px;
}

.social-media img {
    width: 40px;
    margin: 5px;
    transition: transform 0.3s;
}
.social-media img:hover {
    transform: scale(1.1);
}

.footer-links a {
    display: block;
    color: #333;
    text-decoration: none;
    margin: 8px 0;
    transition: color 0.3s, transform 0.3s;
    font-size: 1rem; 
}
.footer-links a:hover {
    color: #007bff;
    transform: translateX(-5px); 
}

.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    width: 100%;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #ccc;
}


/* ------------------------------------------- */
/* 📱 Responsive Adjustments (Mobile Optimized for Content) 📱 */
/* ------------------------------------------- */

/* موبایل (Max 768px) */
@media (max-width: 768px) {
    
    /* 🎯 اصلاح ریسپانسیو برای حذف فواصل اضافی و مرکزیت */
    .wrapper {
        padding: 50px 0 30px; /* کاهش padding در موبایل */
    }
    
    /* ریسپانسیو محتوا (تک ستونی) */
    .profile-container {
        grid-template-columns: repeat(1, 1fr);
        padding: 10px;
        max-width: 400px; /* محدودیت بیشتر عرض برای موبایل */
    }
    .blog-container {
        grid-template-columns: repeat(1, 1fr);
        width: 95%;
        max-width: 400px;
        margin: 10px auto;
    }
    
    /* ریسپانسیو فوتر (وسط‌چین) */
    .footer-content {
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center; 
    }
    .footer-section {
        width: 100%;
        margin: 15px 0;
        text-align: center; 
    }
    .footer-section h4 {
        margin: 0 auto 10px;
        font-size: 1.1rem;
    }
    .footer-links a {
        display: inline-block; 
        margin: 5px 8px;
        font-size: 0.95rem;
    }
    
    .top-bar {
        height: 50px; 
    }
    .top-bar .logo-container img {
        max-height: 40px; 
    }
}

/* تبلت (Max 1024px) */
@media (max-width: 1024px) {
    .profile-container {
        padding: 15px;
        gap: 15px;
        max-width: 900px; /* تنظیم برای تبلت */
    }
    .ranking-container, .blog-container {
        max-width: 95%;
    }
}