:root {
    --primary-color: #1481BA;
    --secondary-color: #11B5E4;
    --accent-color: #0CAADC;
    --dark-bg: #001021;
    --mid-dark: #034748;
    --light-bg: #f8f9fa;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    background: rgba(0, 16, 33, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    padding: 1rem 0;
}

.navbar.scrolled {
    background: rgba(0, 16, 33, 0.98);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--mid-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section .display-4 {
    white-space: nowrap;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23667eea" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,213.3C1248,235,1344,213,1392,202.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat;
    background-size: cover;
    animation: wave 20s linear infinite;
    opacity: 0.3;
}

@keyframes wave {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-25%) translateY(-10px); }
    100% { transform: translateX(0) translateY(0); }
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-image {
    text-align: center;
    position: relative;
}

.hero-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border: 5px solid rgba(20, 129, 186, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    color: var(--white);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(20, 129, 186, 0.3);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 28px;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Projects Section - White text */
#projects .section-title {
    color: var(--white) !important;
}

#projects .lead {
    color: var(--white) !important;
}

/* Projects section mobile adjustments */
@media (max-width: 991px) {
    #projects {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    #projects .col-12.text-center.mb-5 {
        position: relative;
        padding: 1rem 0.5rem;
        margin-bottom: 2rem;
    }
    
    #projects .section-title {
        color: var(--white) !important;
        margin-bottom: 0.5rem;
        font-size: 1.8rem;
    }
    
    #projects .lead {
        color: var(--white) !important;
        margin-bottom: 0;
        font-size: 1rem;
    }
}


.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    margin: 0 auto;
    border-radius: 2px;
}

/* About Section */
.about-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.info-item {
    padding: 0.5rem 0;
    font-size: 1rem;
}

/* Project Cards */
.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(20, 129, 186, 0.2);
}

.project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.image-gallery {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image.active {
    opacity: 1;
}

.gallery-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .gallery-navigation {
    opacity: 1;
}

.gallery-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-btn:hover {
    background: var(--primary-color);
}

.project-no-image {
    height: 250px;
    background: linear-gradient(135deg, rgba(20, 129, 186, 0.1), rgba(17, 181, 228, 0.1));
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.project-no-image i {
    color: var(--primary-color);
    opacity: 0.8;
}

.project-logo {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
}

.project-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.project-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-badge {
    background: rgba(20, 129, 186, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Skills Section */
.skill-category {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.skill-category h4 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.skill-name {
    font-weight: 500;
    color: var(--text-dark);
}

.skill-percent {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.skill-icon-img {
    height: 24px;
    width: auto;
    max-width: 48px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.progress {
    height: 8px;
    background: rgba(20, 129, 186, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 1.5s ease;
}

/* Experience Section */
.experience-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.experience-header h4 {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
}

.company-name {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.experience-highlights {
    list-style: none;
    padding: 0;
}

.experience-highlights li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.experience-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Contact Section */
.contact-item {
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.contact-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-link {
    text-decoration: none;
    color: inherit;
}

.contact-item-clickable {
    cursor: pointer;
    transition: var(--transition);
}

.contact-item-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, rgba(20, 129, 186, 0.05), rgba(17, 181, 228, 0.05));
}

.contact-item-clickable .text-muted {
    color: var(--text-light) !important;
}

.social-links-large {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-link-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-link-large:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(20, 129, 186, 0.3);
    color: var(--white);
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(20, 129, 186, 0.3);
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: rgba(255, 255, 255, 0.7);
}

/* Language Toggle */
.language-toggle {
    margin-left: 1rem;
}

/* Services Dropdown */
.dropdown-menu {
    background: rgba(0, 16, 33, 0.98);
    border: 1px solid rgba(20, 129, 186, 0.2);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-top: 0.5rem;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border-radius: 8px;
    margin: 0.25rem 0.5rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white !important;
    transform: translateX(5px);
}

.dropdown-item i {
    color: var(--primary-color);
    transition: var(--transition);
}

.dropdown-item:hover i {
    color: white;
}

/* RTL Support */
[dir="rtl"] .text-gradient {
    direction: rtl;
}

[dir="rtl"] .experience-highlights {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .skill-name {
    text-align: right;
}

/* Responsive Design */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(0, 16, 33, 0.98);
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 10px;
    }
    
    /* Ensure proper scrolling on mobile */
    body {
        scroll-padding-top: 80px;
    }
    
    section {
        scroll-margin-top: 80px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 80px;
        padding-bottom: 3rem;
    }
    
    .hero-section .min-vh-100 {
        min-height: auto !important;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    
    .hero-image img {
        width: 250px;
        height: 250px;
        margin: 0 auto;
        display: block;
    }
    
    .hero-image {
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    
    .display-4 {
        font-size: 1.75rem;
        white-space: nowrap;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }
    
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .project-card {
        margin-bottom: 1.5rem;
    }
    
    /* Maintain 2x2 layout on tablets */
    @media (min-width: 768px) and (max-width: 991px) {
        .col-lg-6.col-md-6 {
            flex: 0 0 50%;
            max-width: 50%;
        }
    }
    
    .skill-category {
        margin-bottom: 1.5rem;
    }
    
    .contact-item {
        margin-bottom: 1.5rem;
        height: 160px;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }
    
    .social-link-large {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .language-toggle {
        margin-right: 0.5rem;
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 1.5rem;
        white-space: nowrap;
    }
    
    .hero-image img {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .hero-image {
        margin-bottom: 0.25rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    
    .lead {
        font-size: 1rem;
    }
    
    .info-item {
        font-size: 0.9rem;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-description {
        font-size: 0.9rem;
    }
    
    .tech-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .contact-item {
        height: 140px;
    }
}