/* استایل کلی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    direction: rtl;
}

/* نوار بالا */
.top-bar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: #ddd;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-links a.active {
    background: #ff6b6b;
    color: white;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* دکمه‌های کاربر */
.auth-btn-small, .logout-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn-small {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
}

.logout-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
}

.auth-btn-small:hover, .logout-btn:hover {
    transform: translateY(-2px);
}

/* محتوای اصلی */
.bio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.bio-header {
    text-align: center;
    margin-bottom: 3rem;
}

.bio-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* فرم بیوگرافی */
.bio-form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bio-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

textarea, select {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

textarea:focus, select:focus {
    outline: none;
    border-color: #4facfe;
}

.char-counter {
    text-align: left;
    font-size: 0.9rem;
    opacity: 0.7;
}

.submit-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

/* فیلترها */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: #4facfe;
    border-color: #4facfe;
}

.sort-select {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    min-width: 150px;
}

/* لیست بیوگرافی‌ها */
.bios-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.bio-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.bio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4facfe);
}

.bio-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.bio-content {
    margin: 1.5rem 0;
    line-height: 1.6;
    text-align: right;
}

.bio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-weight: bold;
}

.bio-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.like-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.like-btn.liked {
    color: #ff4757;
}

.like-btn:hover {
    transform: scale(1.2);
}

/* مودال‌ها */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* احراز هویت */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #ddd;
    padding: 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #4facfe;
    border-bottom-color: #4facfe;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.3s;
}

.auth-btn:hover {
    transform: translateY(-2px);
}

/* مودال بیوگرافی */
.bio-modal {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.bio-detail {
    position: relative;
    padding: 20px;
}

/* دکمه بستن مودال */
.close-modal-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.3s;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.bio-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.bio-detail-header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bio-detail-header .user-info h3 {
    margin: 0;
    font-size: 1.3rem;
}

.bio-time {
    font-size: 0.9rem;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

/* متن بیوگرافی در مودال */
.bio-text-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    position: relative;
    text-align: right;
    font-size: 1.1rem;
}

.bio-text-container::before {
    content: '❝';
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 2rem;
    opacity: 0.3;
}

.bio-text-container::after {
    content: '❞';
    position: absolute;
    bottom: -15px;
    left: 15px;
    font-size: 2rem;
    opacity: 0.3;
}

/* دکمه کپی */
.copy-btn {
    background: linear-gradient(45deg, #3742fa, #5352ed);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 1.5rem auto;
    transition: all 0.3s;
    width: 100%;
    max-width: 200px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(55, 66, 250, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.success {
    background: linear-gradient(45deg, #2ed573, #20bf6b);
}

.copy-btn.success:hover {
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
}

.bio-detail-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.delete-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn:hover {
    transform: translateY(-2px);
}

/* بارگذاری و وضعیت‌ها */
.loading, .no-bios {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4facfe;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.no-bios i {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bio-container {
        padding: 1rem;
    }
    
    .bio-header h1 {
        font-size: 2rem;
    }
    
    .bios-list {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bio-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bio-detail-header .bio-category {
        align-self: flex-start;
    }
    
    .bio-detail-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-avatar-large {
        width: 60px;
        height: 60px;
    }
    
    .bio-text-container {
        padding: 1rem;
        font-size: 1rem;
    }
}