/* Global Styles */
:root {
    /* Backend Theme Colors */
    --primary-backend: #0a192f;
    --secondary-backend: #64ffda;
    --light-backend: #f8f9fa;
    --dark-backend: #333333;
    --gray-backend: #8892b0;
    
    /* Security Theme Colors */
    --primary-security: #0c1a2d;
    --secondary-security: #ff5580;
    --light-security: #f8f9fa;
    --dark-security: #e2e8f0;
    --gray-security: #94a3b8;
    
    /* Active Theme (default to backend) */
    --primary: var(--primary-backend);
    --secondary: var(--secondary-backend);
    --light: var(--light-backend);
    --dark: var(--dark-backend);
    --gray: var(--gray-backend);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

body.security-mode {
    --primary: var(--primary-security);
    --secondary: var(--secondary-security);
    --light: var(--light-security);
    --dark: var(--dark-security);
    --gray: var(--gray-security);
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

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

section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    color: var(--primary);
}

body.security-mode .section-title {
    color: rgb(255, 250, 250);
}

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

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary);
    color: var(--primary);
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.4);
}

body.security-mode .btn:hover {
    box-shadow: 0 5px 15px rgba(255, 85, 128, 0.4);
}

/* Theme Switch داخل الهيدر */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 30px;
}

.theme-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 8px;
    color: var(--light);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-backend);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary-security);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Header Styles */
header {
    background-color: var(--primary);
    color: var(--light);
    position: fixed;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary);
}

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

nav {
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: var(--light);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

nav ul li a:hover {
    color: var(--secondary);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
#hero {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: var(--primary);
    color: var(--light);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content h1 span {
    color: var(--secondary);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--gray);
    max-width: 600px;
}

.security-text {
    display: none;
}

body.security-mode .backend-text {
    display: none;
}

body.security-mode .security-text {
    display: block;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.hero-btns .btn {
    background-color: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.hero-btns .btn:hover {
    background-color: rgba(100, 255, 218, 0.1);
}

body.security-mode .hero-btns .btn:hover {
    background-color: rgba(255, 85, 128, 0.1);
}

/* About Section */
#about {
    background-color: var(--light);
}

body.security-mode #about {
    background-color: #0a1420;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--dark);
}

body.security-mode .about-text p {
    color: #e2e8f0;
    font-weight: 500;
}

.security-text {
    display: none;
}

body.security-mode .backend-text {
    display: none;
}

body.security-mode .security-text {
    display: block;
}

/* Security About Content */
.security-about-content {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 85, 128, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-security);
}

body.security-mode .security-about-content {
    display: block;
}

.security-about-content h3 {
    color: var(--secondary-security);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.security-about-content ul {
    list-style-type: none;
}

.security-about-content ul li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    color: var(--dark);
}

body.security-mode .security-about-content ul li {
    color: #e2e8f0;
    font-weight: 500;
}

.security-about-content ul li::before {
    content: '🔒';
    position: absolute;
    left: 0;
    color: var(--secondary-security);
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Skills Section */
#skills {
    background-color: #f1f3f5;
}

body.security-mode #skills {
    background-color: #0a1420;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.security-skills {
    display: none;
}

body.security-mode .backend-skills {
    display: none;
}

body.security-mode .security-skills {
    display: grid;
}

.skill-category {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

body.security-mode .skill-category {
    background-color: #0f2241;
    color: var(--light);
    border-left: 4px solid var(--secondary);
}

.skill-category:hover {
    transform: translateY(-10px);
}

.skill-category h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.security-mode .skill-category h3 {
    color: #ffffff;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--secondary);
}

.skill-category ul {
    list-style: none;
}

.skill-category ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    color: var(--dark);
}

body.security-mode .skill-category ul li {
    color: #e2e8f0;
    font-weight: 500;
}

.skill-category ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary);
}

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

.security-projects {
    display: none;
}

body.security-mode .backend-projects {
    display: none;
}

body.security-mode .security-projects {
    display: grid;
}

.project-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

body.security-mode .project-card {
    background-color: #0f2241;
    color: var(--light);
    border: 1px solid rgba(255, 85, 128, 0.2);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    height: 200px;
    background-color: var(--gray);
    background-size: cover;
    background-position: center;
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

body.security-mode .project-info h3 {
    color: #ffffff;
}

.project-info p {
    margin-bottom: 20px;
    color: var(--gray);
}

body.security-mode .project-info p {
    color: #e2e8f0;
}

.project-link {
    color: var(--secondary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-link i {
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: translateX(5px);
}

/* Experience Section */
#experience {
    background-color: var(--light);
}

body.security-mode #experience {
    background-color: #0a1420;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.security-experience {
    display: none;
}

body.security-mode .backend-experience {
    display: none;
}

body.security-mode .security-experience {
    display: block;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--secondary);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 100%;
    padding: 20px 40px;
}

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 40px);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 40px);
    text-align: left;
}

.timeline-item h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

body.security-mode .timeline-item h3 {
    color: #ffffff;
}

.date {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.timeline-item ul li {
    color: var(--dark);
}

body.security-mode .timeline-item ul li {
    color: #e2e8f0;
    font-weight: 500;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--secondary);
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

/* Certifications Section */
#certifications {
    background-color: #f1f3f5;
    display: none;
}

body.security-mode #certifications {
    display: block;
    background-color: #0a1420;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.certification-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

body.security-mode .certification-card {
    background-color: #0f2241;
    color: var(--light);
    border-left: 4px solid var(--secondary);
}

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

.certification-card h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

body.security-mode .certification-card h4 {
    color: #ffffff;
}

.certification-card p {
    color: var(--gray);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

body.security-mode .certification-card p {
    color: #e2e8f0;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}

.status-in-progress {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-completed {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

/* Future Goals Section */
.future-goals {
    background-color: rgba(255, 85, 128, 0.1);
    padding: 25px;
    border-radius: 8px;
    margin-top: 40px;
    border-left: 4px solid var(--secondary-security);
}

.future-goals h3 {
    color: var(--secondary-security);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.future-goals p {
    color: var(--dark);
    line-height: 1.6;
}

body.security-mode .future-goals p {
    color: #e2e8f0;
}

/* Contact Section */
#contact {
    background-color: var(--primary);
    color: var(--light);
}

#contact .section-title {
    color: var(--light);
}

#contact .section-title::after {
    background-color: var(--light);
}

.contact-container {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--secondary);
}

.contact-info p {
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(100, 255, 218, 0.1);
    color: var(--secondary);
    transition: all 0.3s ease;
}

body.security-mode .social-links a {
    background-color: rgba(255, 85, 128, 0.1);
}

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

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

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light);
    font-family: 'Open Sans', sans-serif;
}

.contact-form textarea {
    height: 150px;
    resize: none;
}

.contact-form .btn {
    align-self: flex-start;
    background-color: var(--secondary);
    color: var(--primary);
}

/* Footer */
footer {
    background-color: #020c1b;
    color: var(--light);
    padding: 30px 0;
    text-align: center;
}

body.security-mode footer {
    background-color: #050c1b;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--gray);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary);
}

.copyright {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }

    .contact-container {
        flex-direction: column;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        padding-left: 80px !important;
        padding-right: 20px !important;
        text-align: left !important;
    }

    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: 20px;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-btns {
        flex-direction: column;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--primary);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    nav ul.show {
        display: flex;
    }

    nav ul li {
        margin: 0;
        text-align: center;
        padding: 15px 0;
    }

    .hamburger {
        display: block;
        color: var(--light);
        font-size: 1.5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-switch-wrapper {
        margin-left: 15px;
    }
    
    .theme-label {
        font-size: 0.8rem;
    }
    
    .theme-switch {
        width: 40px;
        height: 20px;
    }
    
    .slider:before {
        height: 14px;
        width: 14px;
    }
    
    input:checked + .slider:before {
        transform: translateX(20px);
    }

    .certifications-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-content h1 {
        font-size: 2.2rem !important;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1rem !important;
    }

    .hero-btns {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .about-image {
        margin-top: 30px;
    }

    .timeline-item {
        padding: 15px 20px 15px 60px !important;
    }

    .timeline::before {
        left: 20px !important;
    }

    .timeline-item::before {
        left: 10px !important;
    }
    
    .skill-category {
        padding: 20px;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .theme-switch-wrapper {
        order: 3;
        width: 100%;
        justify-content: center;
        margin: 15px 0 0 0;
    }

    .certification-card {
        padding: 15px;
    }
}

/* Landscape Fix */
@media (max-height: 500px) and (orientation: landscape) {
    #hero {
        height: auto;
        padding: 100px 0;
    }

    .hero-content {
        padding: 40px 0;
    }
}

/* Extra Large Screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
}