/* Root Variables */
:root {
    --primary-dark: #1E3C72;
    --primary-light: #2A5298;
    --accent-color: #4285F4;
    --accent-color-light: #70A7FF;
    --accent-color-dark: #1A73E8;
    --bg-light: #F8F9FF;
    --border-color: #EEF2FF;
    --text-dark: #1F2937;
    --text-light: #4B5563;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-light: #1E1E1E;
    --border-color: #333333;
    --text-dark: #FFFFFF;
    --text-light: #B0B0B0;
    --white: #2A2A2A;
    background-color: #1A1A1A;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #FAFBFF;
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
    transition: var(--transition);
}

body.dark-mode {
    background-color: #1A1A1A;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-color-light));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    transition: transform 0.1s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.dark-mode .floating-nav {
    background: rgba(42, 42, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-color);
    font-size: 26px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Header Section */
.header-section {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    padding: 40px 40px 30px;
    position: relative;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-light);
    clip-path: ellipse(60% 100% at 50% 100%);
    z-index: 0;
}

body.dark-mode .header-section::after {
    background: #1A1A1A;
}

.header-actions {
    position: absolute;
    top: 20px;
    left: 100px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.header-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    font-size: 17px;
}

.header-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-content {
    text-align: center;
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.profile-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.9);
    overflow: hidden;
    margin: 0 auto 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFFFFF 0%, #E0E7FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    /* Using filter drop-shadow for gradient text as text-shadow doesn't work with background-clip */
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.3));
}

.profile-title {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    position: relative;
    z-index: 10;
}

.social-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    font-size: 16px;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Section Styles */
.section {
    padding: 60px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    opacity: 0.5;
}

.section:last-of-type::after {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.section-icon {
    font-size: 32px;
    color: var(--accent-color);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

body.dark-mode .section-header h2 {
    color: var(--text-dark);
}

/* About Section */
.about-section {
    padding: 30px 0;
}

.about-card {
    width: 100%;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.about-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--text-dark);
}

/* Specializations Section */
.specializations-section {
    padding: 50px 0;
}

.specializations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.specialization-card {
    padding: 20px;
    background: var(--white);
    border-radius: 16px;
    border: 2px solid transparent;
    background-image: linear-gradient(var(--white), var(--white)), 
                      linear-gradient(135deg, var(--accent-color), var(--accent-color-light));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

.specialization-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(112, 167, 255, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.specialization-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(66, 133, 244, 0.15);
}

.specialization-card:hover::before {
    opacity: 1;
}

.specialization-icon {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.specialization-card:hover .specialization-icon {
    transform: scale(1.2) rotateY(360deg);
    color: var(--accent-color-dark);
}

.specialization-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

body.dark-mode .specialization-card h3 {
    color: var(--text-dark);
}

/* Achievements Section */
.achievements-section {
    padding: 45px 0;
}

.achievements-wrapper {
    padding: 40px;
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.achievement-card {
    padding: 24px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 20px;
    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.achievement-icon-wrapper {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(66, 133, 244, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-icon {
    font-size: 28px;
    color: var(--accent-color);
}

.achievement-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

body.dark-mode .achievement-content h3 {
    color: var(--text-dark);
}

.achievement-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-light);
}

/* Clients Section */
.clients-section {
    padding: 50px 0;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.client-card {
    padding: 30px 20px;
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
    transition: var(--transition);
    min-height: 200px;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

/* Client Logo Container */
.client-logo {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

body.dark-mode .client-logo {
    background: rgba(255, 255, 255, 0.08);
}

.client-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.client-card:hover .client-logo {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.client-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

body.dark-mode .client-card h3 {
    color: var(--text-dark);
}

/* References Section */
.references-section {
    padding: 50px 0;
}

.references-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.reference-card {
    padding: 30px 25px;
    background: var(--white);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.reference-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.reference-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

body.dark-mode .reference-card h3 {
    color: var(--text-dark);
}

.reference-card .phone {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    direction: ltr;
    text-align: right;
    letter-spacing: 0.5px;
}

/* Card Animation States */
.specialization-card,
.achievement-card,
.client-card,
.reference-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.specialization-card.card-visible,
.achievement-card.card-visible,
.client-card.card-visible,
.reference-card.card-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Section */
.contact-section {
    padding: 20px 0 40px;
}

.contact-form-wrapper {
    padding: 32px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    right: 16px;
    color: var(--accent-color);
    font-size: 18px;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    background: #F9FAFB;
    transition: var(--transition);
    direction: rtl;
}

body.dark-mode .input-wrapper input,
body.dark-mode .input-wrapper textarea {
    background: var(--white);
    border-color: var(--border-color);
    color: var(--text-dark);
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.input-wrapper textarea {
    resize: vertical;
    min-height: 120px;
    padding-top: 16px;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    padding: 20px;
    background: var(--primary-dark);
    color: var(--white);
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-credit {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Floating Contact Button */
.floating-contact-btn {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    font-size: 24px;
    z-index: 999;
    opacity: 0;
    transform: scale(0);
}

.floating-contact-btn.show {
    opacity: 1;
    transform: scale(1);
}

.floating-contact-btn:hover {
    background: var(--accent-color-dark);
    transform: scale(1.1);
}

/* Floating WhatsApp Button */
.floating-whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    font-size: 28px;
    z-index: 999;
}

.floating-whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.1);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    font-size: 20px;
    z-index: 998;
    opacity: 0;
    transform: scale(0);
}

.back-to-top:hover {
    background: var(--accent-color-dark);
    transform: scale(1.1);
}

.back-to-top.show {
    opacity: 1;
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .specializations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .clients-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .references-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .client-logo {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 768px) {
    .header-actions {
        left: 20px;
        flex-wrap: wrap;
    }
    
    .floating-nav {
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
        border-radius: 50px;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .profile-name {
        font-size: 2rem;
    }
    
    .profile-title {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .specializations-grid,
    .clients-grid,
    .references-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .achievement-card {
        flex-direction: column;
        text-align: center;
    }
    
    .achievements-wrapper {
        padding: 20px;
    }
    
    .contact-form-wrapper {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding: 60px 20px;
        min-height: 500px;
    }
    
    .profile-image {
        width: 140px;
        height: 140px;
    }
    
    .profile-name {
        font-size: 1.6rem;
    }
    
    .profile-title {
        font-size: 1rem;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .nav-item {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease-out;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #10B981;
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Loading State */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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