/* صفحة الملف الشخصي العصرية - CSS */

/* الصفحة الرئيسية للملف الشخصي */
.profile-main {
    min-height: 100vh;
    background: var(--gradient-secondary);
    padding: 120px 0 40px;
    position: relative;
}

.profile-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%2360A9A9" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.profile-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    position: relative;
    z-index: 2;
}

/* الشريط الجانبي */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* بطاقة المستخدم */
.user-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px var(--shadow);
    text-align: center;
    position: relative;
}

.user-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--interactive);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 35px;
    height: 35px;
    background: var(--interactive);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.avatar-edit-btn:hover {
    background: var(--heading);
    transform: scale(1.1);
}

.user-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 8px;
}

.user-info p {
    color: var(--border-text);
    opacity: 0.8;
    margin-bottom: 15px;
}

.user-status {
    display: flex;
    justify-content: center;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background: var(--interactive);
    color: var(--white);
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* إحصائيات المستخدم */
.user-stats {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px var(--shadow);
}

.user-stats h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 20px;
    text-align: center;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--gradient-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: var(--interactive);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--border-text);
    opacity: 0.8;
}

/* بطاقة الاشتراك */
.subscription-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px var(--shadow);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.subscription-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--heading);
}

.plan-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-badge.basic {
    background: #e3f2fd;
    color: #1976d2;
}

.plan-badge.standard {
    background: var(--interactive);
    color: var(--white);
}

.plan-badge.premium {
    background: var(--gradient-primary);
    color: var(--white);
}

.plan-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.subscription-info {
    margin-bottom: 20px;
    color: var(--border-text);
    line-height: 1.6;
}

.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* المحتوى الرئيسي */
.profile-main-content {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    overflow: hidden;
}

/* التبويبات */
.profile-tabs {
    display: flex;
    background: var(--gradient-secondary);
    border-bottom: 1px solid rgba(152, 216, 216, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 20px 15px;
    background: none;
    border: none;
    color: var(--border-text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.tab-btn:hover {
    background: rgba(152, 216, 216, 0.2);
    color: var(--heading);
}

.tab-btn.active {
    background: var(--white);
    color: var(--interactive);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--interactive);
}

/* محتوى التبويبات */
.tab-content {
    padding: 0;
}

.tab-pane {
    display: none;
    padding: 30px;
}

.tab-pane.active {
    display: block;
}

/* بطاقات الأقسام */
.section-card {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(152, 216, 216, 0.2);
}

.section-card:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(152, 216, 216, 0.1);
}

.section-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--border-text);
    opacity: 0.8;
    margin: 0;
}

/* النماذج */
.profile-form {
    max-width: 600px;
}

.form-row {
    margin-bottom: 25px;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--interactive);
    width: 16px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(152, 216, 216, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    color: var(--border-text);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--interactive);
    box-shadow: 0 0 0 3px rgba(152, 216, 216, 0.2);
}

.form-input:disabled {
    background: var(--gradient-secondary);
    opacity: 0.7;
    cursor: not-allowed;
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.form-input:focus + .input-border {
    transform: scaleX(1);
}

.form-help {
    color: var(--border-text);
    opacity: 0.7;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* حاوي كلمة المرور */
.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--border-text);
    opacity: 0.6;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--interactive);
}

/* قوة كلمة المرور */
.password-strength {
    margin-top: 8px;
    font-size: 0.85rem;
}

.password-strength.weak {
    color: #e74c3c;
}

.password-strength.medium {
    color: #f39c12;
}

.password-strength.strong {
    color: #27ae60;
}

.password-match {
    margin-top: 8px;
    font-size: 0.85rem;
}

.password-match.match {
    color: #27ae60;
}

.password-match.no-match {
    color: #e74c3c;
}

/* مجموعات التفضيلات */
.preference-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(152, 216, 216, 0.2);
}

.preference-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.preference-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 20px;
}

/* صندوق الاختيار */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--border-text);
    line-height: 1.4;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(152, 216, 216, 0.5);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--interactive);
    border-color: var(--interactive);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

/* أزرار الإجراءات */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}

.btn.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px var(--shadow);
}

.btn.btn-primary:hover {
    background: var(--heading);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-hover);
}

.btn.btn-secondary {
    background: var(--white);
    color: var(--heading);
    border: 2px solid var(--interactive);
}

.btn.btn-secondary:hover {
    background: var(--interactive);
    color: var(--white);
    transform: translateY(-2px);
}

.btn.btn-danger {
    background: #e74c3c;
    color: var(--white);
}

.btn.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* قسم تسجيل الخروج */
.logout-section {
    text-align: center;
    margin-top: 40px;
}

.logout-btn {
    min-width: 200px;
}

/* جلسات النشاط */
.activity-sessions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--gradient-secondary);
    border-radius: 12px;
    border: 1px solid rgba(152, 216, 216, 0.2);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.session-icon {
    width: 40px;
    height: 40px;
    background: var(--interactive);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
}

.session-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 4px;
}

.session-details p {
    font-size: 0.85rem;
    color: var(--border-text);
    opacity: 0.8;
    margin: 0;
}

.session-actions {
    display: flex;
    gap: 10px;
}

.session-current {
    background: var(--interactive);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.session-terminate {
    background: #e74c3c;
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.session-terminate:hover {
    background: #c0392b;
}

/* الخط الزمني للنشاط */
.activity-timeline {
    position: relative;
    padding-right: 30px;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    right: 15px;
    bottom: 0;
    width: 2px;
    background: var(--interactive);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--gradient-secondary);
    border-radius: 12px;
    border: 1px solid rgba(152, 216, 216, 0.2);
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 25px;
    right: -37px;
    width: 12px;
    height: 12px;
    background: var(--interactive);
    border-radius: 50%;
    border: 3px solid var(--white);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.timeline-icon {
    width: 35px;
    height: 35px;
    background: var(--interactive);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.9rem;
}

.timeline-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--border-text);
    margin: 0;
    line-height: 1.5;
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--border-text);
    opacity: 0.7;
    margin-top: 8px;
}

/* تحريكات خفيفة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* تأثيرات التمرير */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* التجاوب */
@media (max-width: 1024px) {
    .profile-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .profile-sidebar {
        order: 2;
        flex-direction: row;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .user-card,
    .user-stats,
    .subscription-card {
        min-width: 280px;
        flex-shrink: 0;
    }

    .profile-main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .profile-main {
        padding: 100px 0 20px;
    }

    .profile-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 50%;
        padding: 15px 10px;
        font-size: 0.85rem;
    }

    .tab-pane {
        padding: 20px;
    }

    .section-card {
        padding: 20px;
    }

    .user-card {
        padding: 20px;
    }

    .user-avatar {
        width: 100px;
        height: 100px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-item {
        padding: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .form-input,
    .form-select {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .session-actions {
        align-self: stretch;
        justify-content: space-between;
    }

    .activity-timeline {
        padding-right: 20px;
    }

    .timeline-item::before {
        right: -27px;
    }
}

@media (max-width: 480px) {
    .profile-sidebar {
        flex-direction: column;
        gap: 15px;
    }

    .user-card,
    .user-stats,
    .subscription-card {
        min-width: auto;
    }

    .tab-btn {
        flex: 1 1 100%;
        padding: 12px 8px;
        font-size: 0.8rem;
    }

    .user-avatar {
        width: 80px;
        height: 80px;
    }

    .avatar-edit-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .user-info h2 {
        font-size: 1.3rem;
    }

    .section-header h3 {
        font-size: 1.2rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-input,
    .form-select {
        padding: 10px 12px;
    }

    .password-toggle {
        left: 10px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .logout-btn {
        min-width: auto;
        width: 100%;
    }
}

/* حالات خاصة */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--border-text);
}

.loading i {
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--border-text);
    opacity: 0.7;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state p {
    margin: 0;
}

/* تأثيرات إضافية للتفاعل */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

.form-group.error .form-input {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.form-group.success .form-input {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.success-message {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
