/* Reset and Base Styles with Arabic fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --background-light: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--background-light);
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Almarai', 'Cairo', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.profile-info h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    line-height: 1.4;
    font-family: 'Cairo', 'Almarai', sans-serif;
    font-weight: 900;
    position: relative;
    padding-bottom: 15px;
}

.profile-info h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.profile-info h3 {
    font-size: 1.5rem;
    color: #34495e;
    margin-bottom: 2rem;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-weight: 500;
    font-style: italic;
    opacity: 0.9;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* Arabic text optimization */
.about {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 1.5rem;
}

/* Conference Objectives */
.Conference.Objectives {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border-right: 4px solid var(--secondary-color);
    font-family: 'Cairo', 'Almarai', sans-serif;
}

.Conference.Objectives p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Expertise Section */
.expertise {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-right: 4px solid var(--secondary-color);
    font-family: 'Almarai', 'Cairo', sans-serif;
}

.expertise p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Button Styling */
.sub {
    font-family: 'Cairo', 'Almarai', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--secondary-color);
    color: white;
    padding: 12px 35px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Footer */
.copy {
    text-align: center;
    padding: 2rem 0;
    color: #7f8c8d;
    font-size: 1rem;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 500;
}

/* Email Link */
.email-link {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.email-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Profile Layout */
.profile {
    position: fixed;
    top: 0;
    left: 0;
    width: 40%;
    height: 100vh;
    padding: 2rem;
    text-align: center;
    background-color: var(--background-light);
    overflow-y: auto;
}

.profile img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    animation: fadeInUp 1s ease-out;
    transition: transform 0.3s ease;
}

.profile img:hover {
    transform: scale(1.02);
}

.profile-info {
    margin-left: 40%;
    width: 60%;
    padding: 2rem 3rem;
    box-sizing: border-box;
}

/* Social Icons */
.social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-icon img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.social-icon:hover img {
    transform: translateY(-3px);
}

/* Enhanced Responsive Design */
@media only screen and (max-width: 900px) {
    .profile {
        position: relative;
        height: auto;
        width: 100%;
        padding: 1rem;
    }

    .profile img {
        width: 40%; /* Reduced from 60% */
        max-width: 200px; /* Reduced from 300px */
        margin: 1rem auto;
    }

    .profile-info {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .social {
        margin: 0.5rem 0;
    }

    .social-icon img {
        width: 25px;
        height: 25px;
    }

    /* Adjust text sizes for mobile */
    .profile-info h1 {
        font-size: 1.8rem;
        margin-top: 0.5rem;
    }

    .profile-info h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .about {
        font-size: 0.95rem;
        text-align: justify;
    }

    /* Adjust conference sections for mobile */
    .Conference.Objectives,
    .expertise {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .Conference.Objectives p,
    .expertise p {
        font-size: 0.95rem;
    }

    /* Adjust button and form elements */
    .sub {
        padding: 10px 25px;
        font-size: 1rem;
    }

    .form-box {
        margin-top: 1.5rem;
    }

    .email-link {
        font-size: 0.95rem;
    }

    .email-link img {
        width: 20px;
        height: 20px;
    }

    /* Footer adjustments */
    .copy {
        font-size: 0.9rem;
        padding: 1.5rem 0;
    }
}

/* Additional breakpoint for very small devices */
@media only screen and (max-width: 480px) {
    .profile img {
        width: 50%;
        max-width: 150px;
    }

    .profile-info h1 {
        font-size: 1.5rem;
    }

    .profile-info h3 {
        font-size: 1rem;
    }

    .about {
        font-size: 0.9rem;
    }
}

/* Enhanced animations */
.expertise:hover,
.Conference.Objectives:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.sub:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

h2 {
    margin: 2rem 0 1rem 0;
}

.form-box {
    margin-top: 2rem;
}

.conference-title {
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-right: 4px solid var(--secondary-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    animation: slideInRight 1s ease-out;
    transition: all 0.3s ease;
}

.conference-title:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.conference-title h2 {
    font-family: 'Cairo', 'Almarai', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: var(--primary-color);
}

.conference-title h3 {
    font-family: 'Cairo', 'Almarai', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.5rem 0 0 0;
    color: var(--secondary-color);
    line-height: 1.3;
}

/* Responsive adjustments */
@media only screen and (max-width: 900px) {
    .conference-title {
        margin: 0.5rem 0 1rem 0;
        padding: 0.8rem;
    }

    .conference-title h2 {
        font-size: 1.3rem;
    }

    .conference-title h3 {
        font-size: 1.1rem;
    }
}

@media only screen and (max-width: 480px) {
    .conference-title {
        padding: 0.6rem;
    }

    .conference-title h2 {
        font-size: 1.1rem;
    }

    .conference-title h3 {
        font-size: 0.95rem;
    }
}

/* Add keyframes for animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Add animations to elements */
.profile img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    animation: fadeInUp 1s ease-out;
    transition: transform 0.3s ease;
}

.profile img:hover {
    transform: scale(1.02);
}

.conference-title {
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-right: 4px solid var(--secondary-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    animation: slideInRight 1s ease-out;
    transition: all 0.3s ease;
}

.conference-title:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.social-icon {
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-5px);
}

.Conference.Objectives {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
    transition: all 0.3s ease;
}

.Conference.Objectives:nth-child(1) { animation-delay: 0.1s; }
.Conference.Objectives:nth-child(2) { animation-delay: 0.2s; }
.Conference.Objectives:nth-child(3) { animation-delay: 0.3s; }
.Conference.Objectives:nth-child(4) { animation-delay: 0.4s; }
.Conference.Objectives:nth-child(5) { animation-delay: 0.5s; }

.Conference.Objectives:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.expertise {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
    transition: all 0.3s ease;
}

.expertise:nth-child(1) { animation-delay: 0.6s; }
.expertise:nth-child(2) { animation-delay: 0.7s; }
.expertise:nth-child(3) { animation-delay: 0.8s; }
.expertise:nth-child(4) { animation-delay: 0.9s; }

.expertise:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.sub {
    transition: all 0.3s ease;
}

.sub:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    background: #2980b9;
}

/* Add smooth scrolling to the whole page */
html {
    scroll-behavior: smooth;
}

/* Add animation for the email link */
.email-link {
    transition: all 0.3s ease;
}

.email-link:hover {
    transform: translateX(-5px);
    color: var(--secondary-color);
}

/* Optimize animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Loading states */
.loading {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.loaded {
    opacity: 1;
}

/* Optimized animations with proper timing */
.profile img {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

.conference-title {
    opacity: 0;
    animation: slideInRight 0.8s ease-out forwards;
    animation-delay: 0.5s;
}

.social {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.7s;
}

/* Staggered animations for conference objectives */
.Conference.Objectives {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    animation-fill-mode: both;
}

.Conference.Objectives:nth-child(1) { animation-delay: 0.8s; }
.Conference.Objectives:nth-child(2) { animation-delay: 1s; }
.Conference.Objectives:nth-child(3) { animation-delay: 1.2s; }
.Conference.Objectives:nth-child(4) { animation-delay: 1.4s; }
.Conference.Objectives:nth-child(5) { animation-delay: 1.6s; }

/* Staggered animations for expertise sections */
.expertise {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    animation-fill-mode: both;
}

.expertise:nth-child(1) { animation-delay: 1.8s; }
.expertise:nth-child(2) { animation-delay: 2s; }
.expertise:nth-child(3) { animation-delay: 2.2s; }
.expertise:nth-child(4) { animation-delay: 2.4s; }

/* Optimized keyframes */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Debounced hover effects */
.conference-title,
.Conference.Objectives,
.expertise,
.social-icon,
.sub,
.email-link {
    will-change: transform;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Throttled animations for performance */
@media (prefers-reduced-motion: no-preference) {
    .profile img:hover {
        transform: scale(1.02);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .conference-title:hover {
        transform: translateX(-5px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent animation bugs on mobile */
@media (max-width: 768px) {
    .profile img,
    .conference-title,
    .social,
    .Conference.Objectives,
    .expertise {
        animation-duration: 0.5s;
        animation-delay: 0.1s;
    }
}

/* Fallback for older browsers */
@supports not (animation-fill-mode: forwards) {
    .profile img,
    .conference-title,
    .social,
    .Conference.Objectives,
    .expertise {
        opacity: 1;
        transform: none;
    }
}

/* Emergency kill switch for animations */
.no-animation {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}
