﻿:root {
    --primary: #245d55;
    --primary-light: #3a7a71;
    --primary-dark: #1a453f;
    --accent: #e6b89c;
    --accent-light: #f0d4c2;
    --text: #333333;
    --text-light: #666666;
    --background: #f8f9fa;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



/* Enhanced Animated SVG Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #eef2f5 100%);
}

    .animated-bg svg {
        width: 100%;
        height: 100%;
        opacity: 0.7;
    }

/* Container with margins */
.containerProfile {
    margin: 0 auto;
    padding: 20px 30px;
    position: relative;
    z-index: 1;
    /*max-width: 1400px;*/
}

/* Profile Card */
.profile-card {
    display: flex;
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeIn 1s forwards 0.5s;
    transition: transform 0.5s, box-shadow 0.5s;
    position: relative;
    border: 1px solid rgba(36, 93, 85, 0.1);
}

    .profile-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 6px;
        background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
        z-index: 2;
    }

    .profile-card:hover {
        transform: translateY(-12px);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    }

.profile-image {
    flex: 0 0 320px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

    .profile-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        filter: grayscale(10%);
    }

.profile-card:hover .profile-image img {
    transform: scale(1.08);
    filter: grayscale(0%);
}

.profile-content {
    flex: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.profile-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.profile-title {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 25px;
    font-weight: 500;
    position: relative;
    padding-left: 15px;
}

    .profile-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background: var(--accent);
        border-radius: 50%;
    }

.profile-description {
    margin-bottom: 35px;
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text);
    text-align: justify;
}

/* Enhanced Profile Stats - 4 columns on desktop, 2 on mobile */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
    position: relative;
    padding: 20px 15px;
    background: linear-gradient(135deg, rgba(36, 93, 85, 0.05) 0%, rgba(230, 184, 156, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(36, 93, 85, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .stat::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        opacity: 0;
        transition: opacity 0.4s;
        z-index: 1;
    }

    .stat:hover {
        transform: translateY(-8px) scale(1.03);
        box-shadow: 0 15px 30px rgba(36, 93, 85, 0.15);
        border-color: transparent;
    }

        .stat:hover::before {
            opacity: 1;
        }

        .stat:hover .stat-number,
        .stat:hover .stat-label {
            color: var(--white);
        }

        .stat:hover .stat-icon {
            color: var(--accent-light);
        }

.stat-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
    transition: all 0.4s;
    position: relative;
    z-index: 2;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: color 0.4s;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: color 0.4s;
}

/* Enhanced QR Code - تم التعديل ليكون ضمن تخطيط أفضل */
.qr-code-container {
    position: absolute;
    right: 40px;
    top: 40px;
    background: linear-gradient(135deg, var(--white) 0%, #f8f8f8 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(230, 184, 156, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 180px;
    opacity: 0;
    animation: fadeIn 1s forwards 1s;
    z-index: 10;
    transition: transform 0.5s, box-shadow 0.5s;
    backdrop-filter: blur(10px);
}

    .qr-code-container:hover {
        transform: translateY(-8px) scale(1.03);
        box-shadow: 0 25px 50px rgba(36, 93, 85, 0.15);
    }

.qr-code-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(36, 93, 85, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .qr-code-wrapper::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
        animation: shine 3s infinite linear;
        z-index: 1;
    }

.qr-code {
    width: 100%;
    height: 100%;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
    padding: 5px;
}

    .qr-code img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 4px;
    }

.qr-label {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(230, 184, 156, 0.15);
    border-radius: 10px;
    width: 100%;
    border: 1px solid rgba(230, 184, 156, 0.3);
}

.qr-sub-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    margin-top: -5px;
}

.qr-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Enhanced Academic Social Links */
.academic-social-links {
    display: flex;
    gap: 16px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.academic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--white);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0px 0px 5px rgba(0, 150, 136, 0.3);
}

    .academic-icon::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        opacity: 0;
        transition: opacity 0.4s;
        z-index: -1;
    }

    .academic-icon:hover::before {
        opacity: 1;
    }

    .academic-icon:hover {
        transform: translateY(-8px) scale(1.05);
        box-shadow: 0 12px 25px rgba(36, 93, 85, 0.2);
        border-color: transparent;
    }

        .academic-icon:hover i {
            color: white !important;
            transform: scale(1.15);
        }

        .academic-icon:hover svg {
            filter: brightness(0) invert(1);
        }

    .academic-icon i {
        font-size: 2.5rem;
        transition: all 0.4s;
        z-index: 2;
    }

/* Icon colors */
.ai-google-scholar-square i {
    color: #4285F4;
}

.ai-researchgate-square i {
    color: #00CCBB;
}

.ai-orcid-square i {
    color: #A6CE39;
}

.ai-scopus-square i {
    color: #E9710F;
}

.custom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--white);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0px 0px 5px rgba(0, 150, 136, 0.3);
}

    .custom-icon::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #009688, #00796B);
        opacity: 0;
        transition: opacity 0.4s;
        z-index: -1;
    }

    .custom-icon:hover::before {
        opacity: 1;
    }

    .custom-icon:hover {
        transform: translateY(-8px) scale(1.05);
        box-shadow: 0 12px 25px rgba(0, 150, 136, 0.2);
        border-color: transparent;
    }

        .custom-icon:hover svg {
            fill: white !important;
            transform: scale(1.15);
        }

    .custom-icon svg {
        width: 28px;
        height: 28px;
        object-fit: contain;
        transition: all 0.4s;
        z-index: 2;
        fill: #009688;
    }

/* Sections Grid */
.sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
    margin-bottom: 60px;
}

.section {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.06);
    transition: transform 0.5s, box-shadow 0.5s;
    opacity: 0;
    animation: fadeInUp 1s forwards;
    position: relative;
    border: 1px solid rgba(36, 93, 85, 0.08);
}

    .section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 6px;
        background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
        border-radius: 20px 20px 0 0;
    }

    .section:hover {
        transform: translateY(-12px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }

    .section:nth-child(1) {
        animation-delay: 0.9s;
    }

    .section:nth-child(2) {
        animation-delay: 1.1s;
    }

    .section:nth-child(3) {
        animation-delay: 1.3s;
    }

    .section:nth-child(4) {
        animation-delay: 1.5s;
    }

    .section:nth-child(5) {
        animation-delay: 1.7s;
    }

    .section:nth-child(6) {
        animation-delay: 1.9s;
    }

    .section:nth-child(7) {
        animation-delay: 2.1s;
    }

    .section:nth-child(8) {
        animation-delay: 2.3s;
    }

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-light);
    position: relative;
}

.section-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--white);
    font-size: 1.3rem;
    transition: transform 0.5s, background 0.5s;
    box-shadow: 0 6px 15px rgba(36, 93, 85, 0.2);
}

.section:hover .section-icon {
    background: linear-gradient(135deg, var(--accent), #f0a87c);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    flex-grow: 1;
    font-weight: 700;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

    .timeline::before {
        content: '';
        position: absolute;
        left: 7px;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(to bottom, var(--primary), var(--accent));
        border-radius: 2px;
    }

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-left: 25px;
    transition: transform 0.3s;
}

    .timeline-item::before {
        content: '';
        position: absolute;
        left: -33px;
        top: 5px;
        width: 15px;
        height: 15px;
        background: var(--primary);
        border-radius: 50%;
        border: 3px solid var(--white);
        box-shadow: 0 0 0 3px var(--primary);
        transition: background 0.3s, transform 0.3s;
    }

    .timeline-item:hover::before {
        background: var(--accent);
        transform: scale(1.3);
    }

    .timeline-item span {
        font-weight: 600;
        display: block;
        color: var(--primary-dark);
        font-size: 0.95rem;
    }

    .timeline-item p {
        color: var(--text);
        margin-top: 5px;
        font-size: 0.95rem;
    }

/* Simple Counter */
.simple-counter {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(36, 93, 85, 0.08);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(36, 93, 85, 0.1);
}

    .simple-counter i {
        font-size: 0.9rem;
        color: var(--primary);
    }

    .simple-counter span {
        font-size: 1.2rem;
        font-weight: 700;
    }

/* More Button */
.more-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

    .more-button:hover {
        background: var(--primary);
        color: var(--white);
        border-color: var(--primary);
    }


/* Contact List */
.contact-list {
    list-style: none;
}

    .contact-list li {
        margin-bottom: 18px;
        display: flex;
        align-items: center;
        padding: 12px 15px;
        background: rgba(36, 93, 85, 0.03);
        border-radius: 10px;
        border: 1px solid rgba(36, 93, 85, 0.08);
        transition: transform 0.3s;
    }

        .contact-list li:hover {
            transform: translateX(5px);
            background: rgba(36, 93, 85, 0.06);
        }

    .contact-list i {
        margin-right: 15px;
        color: var(--primary);
        font-size: 1.2rem;
        width: 25px;
        text-align: center;
    }

    .contact-list span {
        font-weight: 600;
        color: var(--primary-dark);
        margin-right: 10px;
    }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design - تم تحسين جميع الاستجابات */
@media (max-width: 1200px) {
    .qr-code-container {
        position: relative;
        right: auto;
        top: auto;
        margin: 30px auto 0;
        align-self: center;
        order: 3;
    }

    .profile-content {
        position: relative;
    }

    .academic-social-links {
        order: 2;
    }

    .profile-stats {
        order: 1;
    }
}

@media (max-width: 992px) {
    .profile-card {
        flex-direction: column;
    }

    .profile-image {
        flex: 0 0 300px;
        width: 100%;
    }

    .containerProfile {
        padding: 20px 25px;
    }

    .qr-code-container {
        position: relative;
        margin: 30px auto 0;
        align-self: center;
    }

    .profile-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        order: 1;
        margin-bottom: 20px;
    }

    .stat {
        padding: 18px 12px;
        min-height: 140px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 15px;
    }

    .containerProfile {
        padding: 20px 15px;
    }

    .sections {
        grid-template-columns: 1fr;
    }

    .simple-counter {
        margin-left: 0;
        margin-top: 5px;
    }

    .academic-social-links {
        justify-content: center;
        order: 2;
        margin-top: 20px;
    }

    .profile-name {
        font-size: 2.2rem;
    }

    .qr-code-container {
        order: 3;
        margin-top: 20px;
    }

    .profile-description {
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat {
        padding: 16px 10px;
        min-height: 130px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .profile-content {
        padding: 30px 25px;
    }

    .academic-icon, .custom-icon {
        width: 46px;
        height: 46px;
    }

        .academic-icon i {
            font-size: 2.5rem;
        }

        .custom-icon svg {
            width: 24px;
            height: 24px;
        }

    .qr-code-container {
        width: 160px;
        padding: 15px;
    }

    .qr-code-wrapper {
        width: 120px;
        height: 120px;
    }

    .profile-name {
        font-size: 2rem;
    }
}

@media (max-width: 380px) {
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat {
        min-height: 120px;
    }

    .academic-social-links {
        justify-content: center;
    }
}

@media (max-width: 1400px) {
    .qr-code-container {
        right: 20px;
        top: 20px;
    }
}

.biography-text {
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 8; /* عدد الأسطر */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000 !important; /* Increased z-index */
    display: none; /* Default to none, JS will toggle to flex */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-content {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative; /* Ensure content is positioned */
    z-index: 10001; /* Higher than overlay */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.modal-item:last-child {
    border-bottom: none;
}

.modal-date {
    font-size: 0.85em;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.modal-title {
    font-weight: 500;
    color: #333;
    text-decoration: none; /* Ensure links don't have underline by default if desired */
}

.modal-title:hover {
    text-decoration: underline;
}
