
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;600&display=swap");

:root {
    --yellow: #f9ca24;
    --whiteblack: #333;
    --black: #111;
    --halfblack: #222;
    --white-p: #eee;
    --white-h: #fff;
}

* {
    font-family: "Nunito", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    outline: none;
    border: none;
    text-transform: capitalize;
    transition: all 0.2s linear;
}

*::selection {
    background: var(--yellow);
    color: var(--whiteblack);
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

html::-webkit-scrollbar {
    width: 1.4rem;
}

html::-webkit-scrollbar-track {
    background: var(--halfblack);
}

html::-webkit-scrollbar-thumb {
    background: var(--yellow);
    border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover {
    background: var(--whiteblack);
}

/* تخصيص شريط التمرير للوضع الفاتح */
.dark-mode html::-webkit-scrollbar-thumb {
    background: #3b82f6 !important;
}

.dark-mode html::-webkit-scrollbar-thumb:hover {
    background: #1e40af !important;
}

.dark-mode html::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

/* تخصيص شريط التمرير لـ Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--yellow) var(--halfblack);
}

.dark-mode html {
    scrollbar-color: #3b82f6 #f1f5f9 !important;
}

body {
    background: var(--black);
    overflow-x: hidden;
    padding-left: 35rem;
}

section {
    min-height: 100vh;
    padding: 1rem;
}

.btn {
    padding: 0.7rem 3rem;
    background: var(--yellow);
    color: var(--white-h);
    cursor: pointer;
    margin-top: 1rem;
    font-size: 2rem;
    border-radius: 5rem;
    border: 2px solid var(--yellow);
    transition: all 0.3s ease;
}

.btn i {
    padding: 0 0.5rem;
    font-size: 1.8rem;
}

.btn:hover {
    background: transparent;
    color: var(--yellow);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.heading {
    text-align: center;
    margin: 0 6rem;
    font-size: 4rem;
    padding: 1rem;
    border-bottom: 0.1rem solid #fff4;
    color: var(--white-h);
}

.heading span {
    color: var(--yellow);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 100%;
    width: 35rem;
    background: var(--halfblack);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column;
    text-align: center;
}

header .user img {
    height: 17rem;
    width: 17rem;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 0.7rem solid var(--yellow);
}

header .user .name {
    font-size: 3.5rem;
    color: var(--white-h);
}

header .user .post {
    font-size: 2rem;
    color: var(--white-p);
}

header .navbar {
    width: 100%;
}

header .navbar ul {
    list-style: none;
    padding: 1rem 3rem;
}

header .navbar ul li a {
    display: block;
    padding: 0.7rem 1.5rem;
    margin: 0.7rem 0;
    background: var(--yellow);
    color: var(--white-h);
    font-size: 1.5rem;
    border-radius: 3rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

header .navbar ul li a:hover {
    background: transparent;
    color: var(--yellow);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--yellow);
}

header .navbar ul li a.active {
    background: transparent;
    color: var(--yellow);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--yellow);
}

#menu {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--yellow);
    color: var(--white-h);
    cursor: pointer;
    font-size: 2.5rem;
    padding: 1rem 1.5rem;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
}

#menu:hover {
    background: var(--whiteblack);
    transform: scale(1.1);
}

.home {
    display: flex;
    justify-content: center;
    flex-flow: column;
    padding: 0 15rem;
}

.home h3 {
    font-size: 2.5rem;
    color: var(--white-h);
}

.home h1 {
    font-size: 5rem;
    color: var(--white-h);
}

.home h1 span {
    color: var(--yellow);
}

.home p {
    font-size: 2rem;
    color: var(--white-p);
    padding: 1rem 0;
}

.about .row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.about .row .info {
    flex: 1 1 48rem;
    padding: 2rem 1rem;
    padding-left: 6rem;
}

.about .row .info h3 {
    font-size: 2rem;
    color: var(--yellow);
    padding: 1rem 0;
    font-weight: normal;
}

.about .row .info h3 span {
    color: var(--white-h);
    padding: 0 0.5rem;
}

.about .row .counter {
    flex: 1 1 48rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.about .row .counter .box {
    width: 20rem;
    background: var(--halfblack);
    text-align: center;
    padding: 2rem;
    margin: 2rem;
}

.about .row .counter .box span {
    font-size: 4rem;
    color: var(--yellow);
}

.about .row .counter .box h3 {
    font-size: 2rem;
    color: var(--white-h);
}

.skills-flex {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.skills-section {
    width: 100%;
    margin: 2.5rem 6rem 2rem 6rem;
    border-radius: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
}

.skills-title {
    color: var(--yellow);
    font-size: 2.3rem;
    margin-bottom: 2.2rem;
    text-align: center;
    letter-spacing: 1px;
    font-weight: bold;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.skill-box {
    background: var(--black);
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px var(--halfblack);
    border: 1.5px solid #222;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, border-color 0.2s;
    cursor: default;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .skills {
        padding: 2.5rem 0.5rem;
    }
}

.skill-box:hover {
    transform: translateY(-7px) scale(1.07);
    border-color: var(--yellow);
    box-shadow: 0 8px 32px rgba(249, 202, 36, 0.13);
}

.skill-box i {
    font-size: 3.2rem;
    color: var(--yellow);
    margin-bottom: 0.7rem;
    display: block;
}

.skill-box span {
    color: var(--white-h);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 0.3rem;
    display: block;
}

.skill-box p {
    color: var(--white-p);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    display: block;
}

@media (max-width: 900px) {
    .skills-flex {
        flex-direction: column;
        gap: 2.5rem;
    }

    .skills {
        padding: 2.5rem 0.5rem;
    }
}

section.education {
    min-height: 60vh;
}

.education .box-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem 0;
    padding-left: 3rem;
    min-height: 40vh;
}

.education .box-container .box {
    width: 90%;
    max-width: 80rem;
    margin: 0 auto;
    padding-left: 4rem;
    border-left: 0.2rem solid var(--white-h);
    position: relative;
}

.education .box-container .box span {
    font-size: 1.3rem;
    background: var(--yellow);
    color: var(--white-h);
    border-radius: 5rem;
    padding: 0.5rem 2.5rem;
}

.education .box-container .box h3 {
    font-size: 2rem;
    color: var(--white-h);
    padding-top: 1.5rem;
}

.education .box-container .box p {
    font-size: 1.4rem;
    color: var(--white-p);
    padding: 1rem 0;
}

.education .box-container .box i {
    position: absolute;
    top: -1.5rem;
    left: -2.5rem;
    height: 5rem;
    width: 5rem;
    border-radius: 50%;
    line-height: 5rem;
    text-align: center;
    font-size: 2rem;
    color: var(--white-h);
    background: var(--yellow);
}

.portfolio .box-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.portfolio .box-container .box {
    height: 20rem;
    width: 26rem;
    border-radius: 1rem;
    margin: 2rem;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.project-github-link {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    text-decoration: none;
}
.project-github-link i.fab.fa-github {
    font-size: 2.2rem;
    color: #fff;
    background: #222;
    border-radius: 50%;
    padding: 7px 8px;
    box-shadow: 0 2px 8px #0002;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.project-github-link:hover i.fab.fa-github {
    background: var(--yellow);
    color: #222;
    transform: scale(1.1) rotate(-10deg);
}

.portfolio .box-container .box img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.portfolio .box-container .box:hover img {
    transform: scale(1.2);
}

.portfolio .box-container .box .project-info {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.portfolio .box-container .box:hover .project-info {
    bottom: 0;
}

.portfolio .box-container .box .project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.portfolio .box-container .box .project-info p {
    font-size: 1.4rem;
    color: #ccc;
}

/* Portfolio Filter Buttons */
.portfolio-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    margin-top: 2rem;
    gap: 1rem;
}

.filter-btn {
    padding: 1rem 2rem;
    background: var(--halfblack);
    color: var(--white-h);
    border: 2px solid var(--yellow);
    border-radius: 5rem;
    cursor: pointer;
    font-size: 1.6rem;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--yellow);
    color: var(--white-h);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact .row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.contact .row .content {
    flex: 1 1 30rem;
    padding: 4rem;
    padding-bottom: 0;
}

.contact .row form {
    flex: 1 1 45rem;
    padding: 2rem;
    margin: 2rem;
    margin-bottom: 4rem;
}

.contact .row form .box {
    padding: 1.5rem;
    margin: 1rem 0;
    background: var(--halfblack);
    color: var(--white-h);
    text-transform: none;
    font-size: 1.7rem;
    width: 100%;
    border: 1px solid var(--halfblack);
    transition: all 0.3s ease;
}

.contact .row form .box:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Form validation styles */
.contact .row form .box:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.contact .row form .box:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.error-field {
    border-color: #ef4444 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Loading button styles */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn .fa-spinner {
    margin-right: 0.5rem;
}

/* Success/Error messages */
.alert {
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-size: 1.6rem;
    display: none;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.contact .row form .box::placeholder {
    text-transform: capitalize;
}

.contact .row form .message {
    height: 15rem;
    resize: none;
}

.contact .row .content .title {
    text-transform: uppercase;
    color: var(--white-h);
    font-size: 3rem;
    padding-bottom: 2rem;
}

.contact .row .content .info h3 {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--white-h);
    padding: 1rem 0;
    font-weight: normal;
}

.contact .row .content .info h3 i {
    padding-right: 1rem;
    color: var(--yellow);
}

/* WhatsApp Button */
.social-links {
    margin-top: 2rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 2.5rem;
    background: #25d366;
    color: white;
    border-radius: 5rem;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

.whatsapp-btn i {
    margin-right: 1rem;
    font-size: 2rem;
}

/* Form Buttons */
.form-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.whatsapp-form-btn {
    background: #25d366 !important;
    border-color: #25d366 !important;
    font-size: 1.8rem;
    padding: 1rem 2.5rem;
}

.whatsapp-form-btn:hover {
    background: transparent !important;
    color: #25d366 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.top {
    position: fixed;

    bottom: 2.5rem;
    right: 5rem;
    z-index: 100;
    display: none;
}

.top i {
    font-weight: 900;
    font-size: 35px;
    border-radius: 5px;
    opacity: 0.7;
    padding: 3px 10px;
    color: var(--white-h);
    background-color: var(--yellow);
}

.top i:hover {
    color: var(--yellow);
    background-color: var(--white-h);
}

.dark {
    position: fixed;
    top: 19rem;
    right: 0rem;
    z-index: 1000;
}

.theme-toggle {
    background: var(--yellow);
    color: var(--white-h);
    border: none;
    border-radius: 50px 0 0 50px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle i {
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-toggle .fa-sun {
    display: inline-block;
}

.theme-toggle .fa-moon {
    display: none;
}

.dark-mode .theme-toggle .fa-sun {
    display: none;
}

.dark-mode .theme-toggle .fa-moon {
    display: inline-block;
}

.dark-mode {
    --yellow: #3b82f6;
    --whiteblack: #1e40af;
    --black: #ffffff;
    --halfblack: #f1f5f9;
    --white-p: #64748b;
    --white-h: #0f172a;
}

.dark-mode header {
    background: #f1f5f9 !important;
}

.dark-mode header .user .name {
    color: #0f172a !important;
}

.dark-mode header .user .post {
    color: #64748b !important;
}

/* media queries  */

@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }

    .home {
        padding: 1rem 4rem;
    }
}

@media (max-width: 991px) {
    header {
        left: -120%;
    }

    #menu {
        display: block;
    }

    header.toggle {
        left: 0%;
    }

    body {
        padding: 0;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 50%;
    }
}

@media (max-width: 400px) {
    header {
        width: 100vw;
    }

    .heading {
        margin: 0 3rem;
    }

    .about .row .counter .box {
        width: 100%;
    }

    .education .box-container .box {
        width: 95%;
        margin: 1rem 0;
    }

    .portfolio .box-container .box {
        width: 100%;
    }

    .portfolio-filter {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.9rem 2.2rem;
        margin: 1rem 0;
        font-size: 1.7rem;
        border-radius: 4rem;
    }

    .contact .row form {
        margin: 3rem 0;
    }

    .form-buttons {
        flex-direction: column;
    }

    .whatsapp-btn {
        padding: 1rem 2rem;
        font-size: 1.6rem;
    }
}