:root {
    /* Colors */
    --primary-color: #4361ee;
    --primary-light: #4cc9f0;
    --primary-dark: #3a0ca3;

    --text-color: #2b2d42;
    --text-light: #8d99ae;
    --text-dark: #1a1a2e;
    --bg-color: #f8f9fa;
    --bg-light: #ffffff;
    --bg-dark: #121212;
    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-color: #e9ecef;


    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Space Grotesk', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;

    /* Transition */
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Dark Mode */
.dark-mode {
    --primary-color: #4cc9f0;
    --primary-light: #4895ef;
    --primary-dark: #4361ee;

    --text-color: #f8f9fa;
    --text-light: #adb5bd;
    --text-dark: #e9ecef;
    --bg-color: #121212;
    --bg-light: #1e1e1e;
    --bg-dark: #0a0a0a;
    --card-bg: #1e1e1e;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --border-color: #2d2d2d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Section */
.section {
    padding: var(--space-xl) 0;
}

.section-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: var(--space-xs);
}

.mb-2 {
    margin-bottom: var(--space-sm);
}

.mb-3 {
    margin-bottom: var(--space-md);
}

.mb-4 {
    margin-bottom: var(--space-lg);
}

.mt-1 {
    margin-top: var(--space-xs);
}

.mt-2 {
    margin-top: var(--space-sm);
}

.mt-3 {
    margin-top: var(--space-md);
}

.mt-4 {
    margin-top: var(--space-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    white-space: nowrap;
}

.btn i {
    font-size: 1.2rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: var(--space-lg);
    transition: var(--transition);
}

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

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 1rem;
    background: var(--bg-light);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Lists */
.dash-list li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-light);
    transition: var(--transition);
    padding-left: clamp(0.8rem, 2vw, 1.5rem);
}

.dash-list li::before {
    content: "➤";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.dash-list li:hover::before {
    transform: translateX(3px);
}

/* RTL Support for dash-list */
[lang="ar"] .dash-list li,
[dir="rtl"] .dash-list li {
    padding-left: 0;
    padding-right: 1.5rem;
    padding-right: clamp(0.8rem, 2vw, 1.5rem);
}

[lang="ar"] .dash-list li::before,
[dir="rtl"] .dash-list li::before {
    left: auto;
    right: 0;
    transform: scaleX(-1);
}

[lang="ar"] .dash-list li:hover::before,
[dir="rtl"] .dash-list li:hover::before {
    transform: translateX(-3px) scaleX(-1);
}

/* Icon Buttons */
.icon-btn {
    width: 36px;
    height: 36px;
    background-color: #e5e7eb;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.icon-btn:hover {
    background-color: #d1d5db;
}

.dark-mode .icon-btn {
    background-color: #374151;
    color: #f9fafb;
}

.dark-mode .icon-btn:hover {
    background-color: #4b5563;
}

/* Theme Icons */
.sun-icon {
    display: none;
}

.dark-mode .sun-icon {
    display: block;
}

.dark-mode .moon-icon {
    display: none;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* Progress Bars */
.skill-progress {
    background: var(--border-color);
    height: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: var(--space-xs);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-sm);
    transition: width 1s ease-in-out;
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--border-color);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(var(--bg-light), 0.8);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dark-mode .navbar {
    background-color: rgba(var(--bg-dark), 0.8);
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header Logo */
.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}

.header-logo span {
    color: var(--primary-color);
}

.dark-mode .header-logo {
    color: white;
}

.dark-mode .header-logo span {
    color: var(--primary-color);
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

.nav-links a::after {
    content: "";
    position: absolute;
    height: 2px;
    width: 0;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.dark-mode .nav-links a {
    color: var(--text-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--primary-light), transparent 70%);
    opacity: 0.15;
    z-index: 0;
    border-radius: 50%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-xl);
    position: relative;
    z-index: 1;
}

.hero-text {
    max-width: 600px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
    font-weight: 500;
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: var(--space-sm);
    line-height: 1.1;
    background: linear-gradient(to right, var(--text-dark), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.dark-mode .hero-title {
    background: linear-gradient(to right, var(--text-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

.hero-social {
    display: flex;
    gap: var(--space-md);
    opacity: 0;
    animation: fadeInUp 1s ease 0.8s forwards;
}

.hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: var(--radius-full);
    color: var(--primary-color);
    font-size: 1.3rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.hero-social a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

/* Language Dropdown */
.language-dropdown {
    position: relative;

}

.lang-menu {
    display: none;
    position: absolute;
    top: 42px;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    list-style: none;
    z-index: 100;
}

.lang-menu li {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
}

.lang-menu li:hover {
    background-color: #f3f4f6;
}

.lang-menu.show {
    display: block;
}

.dark-mode .lang-menu {
    background-color: #2c2c2c;
    color: white;
    border-color: #444;
}

/* Hero Image */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    order: 1;
    margin: 0 auto;
    max-width: 350px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.profile-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: block;
    /* للتأكد من عدم وجود مسافات غير مرغوب بها */
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: var(--space-xl) 0 0;
    margin-top: var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand {
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-text {
    color: var(--text-light);
    margin-top: var(--space-sm);
}

.footer-links {

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);


}

.footer-column h4 {
    color: white;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);

    /*margin-bottom: var(--space-sm);*/
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: var(--space-xs);
}

.footer-column ul li a {
    color: var(--text-light);
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding: var(--space-md) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;



}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #2c2c2c;
    color: white;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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


/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xl);
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-img {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.about-content {
    max-width: 600px;
}

.about-title {
    font-size: 1.8rem;
    margin-bottom: var(--space-md);
    color: var(--primary-color);
}

.about-text {
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 3px;
}

.info-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.info-item a {
    font-weight: 500;
    color: var(--text-dark);
}

.dark-mode .info-item a {
    color: var(--text-color);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.skill-category {
    background: var(--card-bg);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.3rem;
    margin-bottom: var(--space-lg);
    color: var(--primary-color);
}

.category-title i {
    font-size: 1.5rem;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.skill-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.skill-info i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

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

.dark-mode .skill-info span {
    color: var(--text-color);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Lazy Loading Styles */
.lazy {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    /* Background for light mode */
}

.dark-mode .project-image {
    background-color: #2a2a2a;
    /* Background for dark mode */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-links {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.project-card:hover .project-links {
    opacity: 1;
}

.project-links .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.project-card:hover .project-links .btn {
    transform: translateY(0);
}

/* Stagger button animation */
.project-card:hover .project-links .btn:nth-child(1) {
    transition-delay: 0.1s;
}

.project-card:hover .project-links .btn:nth-child(2) {
    transition-delay: 0.2s;
}

.project-links .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.project-links .btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.project-links .btn:hover {
    transform: scale(1.05);
    background: white;
    color: var(--primary-color);
}

.project-content {
    padding: var(--space-lg);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: var(--space-xs);
}

.project-description {
    color: var(--text-light);
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.project-tech span {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.section-footer {
    text-align: center;
    margin-top: var(--space-xl);
}

/* Timeline Section */
.timeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.timeline-column {
    position: relative;
}

.timeline-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    height: 100%;
    width: 2px;
    background: var(--primary-color);
    opacity: 0.3;
}

.timeline-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    padding-left: var(--space-md);
    color: var(--primary-color);
}

.timeline-title i {
    font-size: 1.8rem;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);

}

.timeline-item {
    position: relative;
    padding-left: var(--space-md);
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    border: 3px solid var(--bg-light);
}

.dark-mode .timeline-item::before {
    border-color: var(--bg-dark);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.timeline-heading {
    font-size: 1.2rem;
    margin-bottom: var(--space-xs);
}

.timeline-subheading {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.contact-info {
    background: var(--card-bg);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.contact-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--primary-color);
}

.contact-text {
    color: var(--text-light);
    margin-bottom: var(--space-lg);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 3px;
}

.contact-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.contact-item a {
    font-weight: 500;
    color: var(--text-dark);
}

.dark-mode .contact-item a {
    color: var(--text-color);
}

.contact-form {
    background: var(--card-bg);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-scale {
    animation: fadeInScale 0.8s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.bounce-in {
    animation: bounceIn 0.8s ease forwards;
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Text Animations */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary-color);
    }
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

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

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.stagger-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* Responsive Design */

/* Large Screens (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .hero-title {
        font-size: 3.5rem;
    }


    .section-title {
        font-size: 1.8rem;
    }
}

/* Medium Screens (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .hero-title {
        font-size: 2rem;
    }
}

/* Small Screens (768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-lg);
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-lg);
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .timeline-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-lg);
    }
}

/* Extra Small Screens (576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 var(--space-sm);
    }

    /* Navigation */
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }


    /* Mobile Menu Styling */
    .nav-links.show {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 64px;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--card-bg);
        padding: var(--space-xl);
        gap: var(--space-md);
        align-items: flex-start;
        justify-content: flex-start;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    /* Navigation */
    .nav-links {
        position: fixed;
        top: 65px;
        left: 0;
        width: 100%;

        flex-direction: column;
        gap: 0;
        padding: var(--space-md);
        height: 0;
        overflow: hidden;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }



    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: var(--space-sm) 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Hero Section */
    .hero {
        padding-top: 100px;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 250px;
    }

    /* Sections */
    .section {
        padding: var(--space-lg) 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Global */

    .section-title {
        font-size: 2rem;
        margin-bottom: var(--space-sm);
    }

    .section-title::after {
        width: 60px;
        bottom: -8px;
    }

    /* Skills Grid */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    /* Lists */
    .dash-list li {
        padding-left: 0;
    }

    .dash-list li::before {
        display: none;
    }
}

/* Very Small Screens (up to 575px) */
@media (max-width: 575px) {
    .container {
        width: 100%;
        padding: 0 var(--space-sm);
    }

    /* Hero Section */
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    /* Sections */
    .section-title {
        font-size: 1.8rem;
    }

    .skill-category {
        padding: var(--space-md);
    }

    .project-card {
        max-width: 100%;
    }

    .project-image {
        height: 200px;
    }
}

/* Extra Small Screens (up to 400px) */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-cta .btn {
        padding: var(--space-sm);
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .project-links {
        bottom: 10px;
        right: 10px;
    }

    .project-links .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Tablet Portrait Mode */
@media (min-width: 577px) and (max-width: 768px) and (orientation: portrait) {
    .hero-content {
        gap: var(--space-lg);
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape Mobile Devices */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .hero-content {
        align-items: flex-start;
    }
}

/* iOS Viewport Fix */
@supports (-webkit-touch-callout: none) {

    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .back-to-top,
    .mobile-menu-btn {
        display: none !important;
    }

    .hero {
        padding-top: 0;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .profile-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}



/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
    position: relative;
    text-align: center;
}

#lightbox-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--primary-color);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 10px;
        font-size: 18px;
    }
}
