@font-face {
    font-family: 'Pixelify Sans';
    src: url('arabpixl.ttf'); 
}

#ffff {
    font-family: 'Pixelify Sans'
}

body,
html {
    background: #000022;
    color: #fff;
    cursor: crosshair;
    font-family: 'Pixelify Sans', monospace;
    line-height: 1rem;
    margin: 0;
    overflow: hidden;
    padding: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    height: 100%
}

body.inv,
html.inv {
    background: #f6fbe4;
    color: #050210
}

.bang {
    animation: bangAni 2s infinite;
    position: absolute
}

html[lang=ar] .bang {
    font-family: 'Pixelify Sans';
    font-size: 10px
}

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

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

    to {
        opacity: 0;
        transform: scale(1.5);
        visibility: hidden;
        pointer-events: none;
    }
}

.tag {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    left: 0;
    margin: auto;
    position: absolute;
    right: 0;
    text-align: center;
    top: 5px;
    width: fit-content;
    z-index: 3;
    pointer-events: none;
}

.tag .info {
    font-size: 12px;
    width: 50%
}

.anime-container {
    position: relative;
    pointer-events: none;
}

.anime-container .dot {
    background-color: #4b15a2;
    position: absolute
}

a {
    color: #fff;
    display: block;
    margin: 0;
    padding: 0;
    text-decoration: none;
    transition: color .4s ease
}

a:hover {
    color: silver
}

.list {
    line-height: 25px;
    list-style-type: none;
}

.list div {
    font-size: 18px
}

::-webkit-scrollbar {
    height: 12px;
    width: 6px
}

::-webkit-scrollbar-track {
    background: #00000000
}

::-webkit-scrollbar-thumb {
    background: #d6d6d6;
    border-radius: 10px
}

::-webkit-scrollbar-thumb:hover {
    background: #555
}

.layout {
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
}

.layout .page {
    pointer-events: auto;
    z-index: 20000
}

.layout .bold {
    font-weight: 700
}

.layout .white {
    background: #fff;
    border-radius: 50px;
    color: #000;
    font-size: 30px;
    padding: 8px 15px
}

.layout #front a {
    font-size: 15px;
    margin: auto;
    padding: 3px 20px;
    width: fit-content;
    position: relative;
    z-index: 20010;
    pointer-events: auto
}

.bio-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    z-index: 20001;
    pointer-events: auto;
}

.full-name {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    left: 20px;
    position: absolute;
    top: 17px;
    z-index: 20001;
}

html[lang=ar] .full-name .name {
    font-size: 16px;
}

.full-name .name a,
.full-name #toggleLang {
    pointer-events: auto !important;
}

#playpause {
    cursor: pointer;
    font-size: 20px
}

.social {
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    left: 0;
    padding: 20px;
    position: absolute;
    text-shadow: 5px 1px 6px #000, -5px -5px 6px #000, 5px 1px 6px #000, -5px -5px 6px #000;
    z-index: 20000
}

.social a {
    pointer-events: auto !important;
}

html[lang=ar] .social {
    font-size: 16px
}

.projects {
    bottom: 0px;
    position: absolute;
    right: 20px;
    z-index: 20000;
}

.projects a {
    margin-bottom: 20px;
}

.email {
    position: absolute;
    right: 20px;
    top: 6px;
    z-index: 20000;
}

.projects a,
.email.button {
    pointer-events: auto !important;
}

.layout .about {
    font-size: 28px;
    line-height: 1.5rem;
    margin: auto auto 20px;
    text-align: center
}

.layout .about .desc {
    color: #ccc;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    margin-bottom: 15px;
    margin-top: 15px
}

html[lang=ar] .layout .about .desc {
    color: #ccc;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    margin-bottom: 15px;
    margin-top: 15px
}

.button,
.layout .about button {
    background: #e8e8e8;
    border: none;
    border-radius: 2px;
    box-shadow: 4px 3px 0 2px #585858;
    color: #000;
    cursor: pointer;
    padding: 9px;
    transition: transform .1s;
    font-family: 'Pixelify Sans', monospace;

}

.button:active,
.layout .about button:active {
    box-shadow: none;
    transform: translate(3px, 3px) scale(.95)
}

.button.disabled {
    background: #888; /* Darker grey background */
    box-shadow: 4px 3px 0 2px #444; /* Darker shadow */
    color: #bbb; /* Lighter grey text */
    cursor: not-allowed; /* Show the 'not allowed' cursor on hover */
    pointer-events: none; /* Make it completely unclickable */
}


.layout .about .profile img {
    animation: hue-rotate-animation 10s infinite;
    border-radius: 20px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(.68, -.55, .265, 1.55)
}

a.button[data-lang-key="blogBtn"] {
    /* FIX: Replaced the rainbow with a smoother, theme-appropriate gradient. */
    background-image: linear-gradient(90deg, #ea101b, #00fd15, #f6ff4e,  #bfbaff);
    background-size: 200% 200%;
    
    /* FIX: Sped up the animation from 10s to 5s. */
    animation: hue-rotate-animation 4s linear infinite;
    font-weight: bold;
}


.layout .about .rotate-animation {
    transform: rotateY(1turn)
}

@keyframes hue-rotate-animation {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.layout .about .profile .name {
    font-family: monospace;
    font-size: 12px;
    margin-bottom: 20px;
    margin-top: 5px
}

a.button:active {
    box-shadow: none;
    transform: translate(3px, 3px) scale(.95)
}

.layout .content {
    align-items: center;
    display: flex;
    height: 100dvh;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100%;
    z-index: 1;
    pointer-events: none;
}

.layout .content .title {
    font-size: 38px;
    line-height: normal;
    text-align: center;
    width: 100%
}

.techs-front {
    bottom: 5px;
    gap: 20px;
    justify-content: center;
    margin-bottom: 10px;
    position: absolute;
    width: 100%;
    pointer-events: none;
}

.techs-front,
.techs-front .tech {
    align-items: center;
    display: flex;
    text-align: center
}

.techs-front .tech {
    border-radius: 15px;
    flex-direction: column;
    font-size: 10px;
    gap: 3px;
    padding: 5px;
    text-shadow: 5px 1px 6px #000, -5px -5px 6px #000, 5px 1px 6px #000, -5px -5px 6px #000;
    z-index: 1;
    pointer-events: auto;
}

html[lang=ar] .techs-front .tech {
    border-radius: 15px;
    flex-direction: column;
    font-size: 10px;
    gap: 3px;
    padding: 5px;
    text-shadow: 5px 1px 6px #000, -5px -5px 6px #000, 5px 1px 6px #000, -5px -5px 6px #000;
    z-index: 1;
    pointer-events: auto;
}

.techs-front .tech img {
    height: 30px;
    width: 30px
}

#loading {
    align-items: center;
    background: #020202;
    display: flex;
    height: 100dvh;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    transition: all .5s ease-out;
    width: 100%;
    z-index: 999999
}

#loading img {
    width: 420px;
    height: 330px;
}

#loading #loading-ready {
    display: none
}

.layout .page {
    position: absolute;
    transition: all .5s ease-out
}

.fadeOut {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(.5);
    transition: opacity 0.5s ease-out, visibility 0s 0.5s, transform 0.5s ease-out;
}

.fadeIn {
    opacity: 1;
    transform: scale(1)
}

.page-popup {
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.85);
    font-family: monospace;
    height: 80vh;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    overflow-y: auto;
    padding: 30px 40px;
    top: 10vh;
    box-sizing: border-box;
    z-index: 20000;
    pointer-events: auto;
}

.page-popup h1 {
    font-family: 'Pixelify Sans', monospace;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 2px 2px 0 #000, 0 0 8px #fff;
    animation: introAnimation 2s infinite;
}

.page-popup .list {
    height: calc(100% - 70px);
    overflow-y: auto;
    padding-right: 15px;
}

.layout #bio .bio-item {
    background: transparent;
    border-radius: 12px;
    margin-bottom: 18px;
    padding: 18px 18px 10px 18px;
    transition: background 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.layout #bio .bio-item .bio-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layout #bio .expand {
    color: #000;
    background: #e8e8e8;
    border-radius: 6px;
    box-shadow: 2px 2px 0 1px #585858;
    cursor: pointer;
    display: inline-block;
    font-size: 26px;
    line-height: 20px;
    padding: 7px 13px;
    margin-left: 12px;
    transition: background 0.2s, box-shadow 0.2s
}

.layout #bio .expand:active {
    box-shadow: none;
    transform: translate(2px, 2px) scale(.97)
}

.layout #bio .closed {
    height: 0;
    overflow: hidden
}

.layout #bio .open {
    height: auto;
    overflow: initial;
    margin-top: 15px;
    padding-top: 10px;
    color: #ccc;
    font-size: 17px;
    line-height: 1.5;
}

.page-popup .list::-webkit-scrollbar {
    width: 8px;
}

.page-popup .list::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.page-popup .list::-webkit-scrollbar-thumb {
    background-color: #e94560;
    border-radius: 4px;
}

.toolkit-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.project {
    background-color: rgba(30, 30, 50, 0.5);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-bottom: 25px;
    height: auto;
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.project-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #eee;
    animation: introAnimation 2s infinite;
}

.project img {
    flex: 0 0 35%;
    width: 35%;
    height: auto;
    max-width: 400px;
    object-fit: cover;
    object-position: top;
    border-radius: 10px;
}

.project .desc {
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 15px;
}

.project-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.project-techs span {
    background-color: rgba(0, 0, 0, 0.3);
    color: #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.project-techs span:hover {
    background: #474747
}


.toolkit-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* A bit more space between tags */
    padding-top: 10px;
}

.toolkit-tags-container span {
    background-color: rgba(152, 152, 152, 0.707);
    color: #ddd;
    padding: 8px 14px; /* Slightly larger padding */
    border-radius: 5px;
    font-size: 16px; /* Larger font for better readability */
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toolkit-tags-container span:hover {
    background-color: #e94560; /* Use the theme's highlight color */
    color: #fff;
    transform: translateY(-2px); /* Add a little lift effect */
}


.case-study-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}
.case-study-item h3 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #e94560;
}
.case-study-item p {
    font-size: 15px;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 10px;
}
.case-study-item p strong {
    color: #fff;
}

.research-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}
.research-item h3 {
    font-size: 18px;
    margin-top: 0;
}
.research-item .publication-source {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 15px;
}
.research-item p {
    font-size: 15px;
    line-height: 1.6;
    color: #ccc;
}

.research-item .button.publication-link {
    margin-top: 15px; /* Give it some space from the text above */
    display: inline-block; /* Ensure it behaves like a block element for margin */
    color: #000 !important; /* Force the text color to be black to match other buttons */
    text-decoration: none; /* Remove underline */
}



.toolkit-grid {
    display: grid;
    /* Create two columns of equal width */
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px; /* Vertical and horizontal gap */
    height: 100%;
}

.toolkit-category h3 {
    font-size: 20px;
    color: #e94560; /* Highlight color for category titles */
    margin-bottom: 15px;
    border-bottom: 1px solid #e94560;
    padding-bottom: 5px;
}

.toolkit-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Space between tags */
}

.toolkit-tags span {
    background-color: rgba(152, 152, 152, 0.707);
    color: #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px; /* Slightly larger for readability */
    transition: background-color 0.2s ease;
}
.toolkit-tags span:hover {
    background-color: #474747;
}

#blog-wip.page-popup {
    max-width: 500px; /* Makes the popup much narrower */
    height: auto;     /* Lets the content define the height, removing extra space */
    padding: 20px;    /* Adds some nice internal spacing */
    
    /* This is a more robust way to center a popup of a specific size */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #585858;

}

#blog-wip .wip-popup-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#blog-wip .wip-popup-content img {
    /* FIX: Reduced the GIF size from 150px to 120px */
    width: 50px;
    height: auto;
    margin-bottom: 15px;
}

#blog-wip .wip-popup-content p {
    font-size: 16px;
    font-family: 'Pixelify Sans', monospace;
    color: #ccc;
    line-height: 1.6;
}

@keyframes border-dance {
    0% {
        background-position: 0 0, 100% 100%, 0 100%, 100% 0
    }

    to {
        background-position: left 15px top, right 15px bottom, left bottom 15px, right top 15px
    }
}

.bg-over {
    height: 100dvh;
    overflow: hidden;
    width: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-gif,
.bg-over {
    bottom: 0;
    left: 0;
    position: absolute
}

.bg-gif {
    animation: cityAnmi 180s linear infinite;
    background-image: url(../imgs/gifs/bg.gif);
    background-repeat: repeat-x;
    background-size: auto 100%;
    box-shadow: inset -9px -45px 45px 18px rgba(0, 0, 0, .6);
    height: 300px;
    width: 200%;
    z-index: 0
}

@keyframes cityAnmi {
    0% {
        transform: translateX(0)
    }

    100% {
        transform: translateX(-50%)
    }
}

.fly {
    cursor: pointer;
    left: 100%;
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.fly.b1 {
    top: 40%;
    width: 30px;
    animation: flyAnimationB1 50s linear infinite;
    animation-delay: 7s
}

.fly.b2 {
    top: 19%;
    transform: rotateY(180deg);
    width: 30px;
    animation: flyAnimationB2 100s linear infinite;
    animation-delay: 17s
}

.fly.b3 {
    left: 70%;
    top: 130%;
    transform: rotate(-90deg);
    width: 100px;
    animation: flyAnimationCar 30s forwards;
    animation-delay: 26s
}

.fly.b4 {
    filter: invert(1);
    left: 30px;
    top: 20%;
    width: 128px
}

.fly.b4.c1 {
    animation: flyCloud 100s forwards;
    left: 30px;
    top: 10%
}

.fly.b4.c2 {
    animation: flyCloud 124s forwards;
    left: 10px;
    top: 12%
}

.fly.b4.c3 {
    animation: flyCloud 129s forwards;
    left: 20px;
    top: 16%
}

@keyframes flyCloud {
    0% {
        left: 100%
    }

    to {
        left: -50%
    }
}

@keyframes flyAnimationB1 {
    0% {
        left: 100%
    }

    to {
        left: -50%
    }
}

@keyframes flyAnimationB2 {
    0% {
        left: 100%
    }

    to {
        left: -50%;
        top: 12%
    }
}

@keyframes flyAnimationCar {
    0% {
        top: 130%;
        transform: scale(1) rotate(-90deg) rotateY(0deg)
    }

    50% {
        top: 50%;
        transform: scale(.7) rotate(-90deg) rotateY(20deg)
    }

    90% {
        top: 10%;
        transform: scale(0) rotate(-90deg) rotateY(90deg)
    }

    to {
        top: -50%;
        transform: scale(0) rotate(-90deg) rotateY(90deg)
    }
}

.layout .intro {
    font-size: 34px;
    line-height: 30px;
    margin-top: 10px;
    animation: introAnimation 2s infinite;
    color: #f5f5f5;
}

html[lang=ar] .layout .intro {
    font-size: 34px;
    line-height: 30px;
    margin-top: 10px
}

@keyframes introAnimation {
    0% {
        text-shadow: 2px 0 0 #00f, -2px 0 0 red
    }

    50% {
        text-shadow: -1px -2px 0 red, 1px 2px 0 #00f
    }

    to {
        text-shadow: 2px 0 0 #00f, -2px 0 0 red
    }
}

.moon {
    filter: hue-rotate(43deg);
    opacity: .8;
    position: absolute;
    right: 18%;
    top: 16%;
    width: 50px;
    pointer-events: none;
}

.about-img {
    border-radius: 35px;
    width: 30%
}

#stars {
    height: 70%;
    overflow: hidden;
    position: absolute;
    width: 100%;
    z-index: 0;
}

#stars div {
    background-color: #2196f3;
    height: 1px;
    width: 1px
}

.invert {
    filter: invert(1)
}

#pdfOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#pdfOverlay .pdf-container {
    position: relative;
    width: 85%;
    height: 90%;
    background-color: #282c34;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#pdfOverlay .pdf-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 5px;
    transition: background-color 0.3s ease;
}

#pdfOverlay .pdf-close-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#pdfOverlay embed {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 5px;
}

.metal-slug {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    left: -100px;
    width: 50px;
}

.metal-slug-animation {
    animation: flyAnimationMetalSlug 15s linear forwards;
}

@keyframes flyAnimationMetalSlug {
  0% {
    left: -100px;
  }
  to {
    left: calc(100% + 100px);
  }
}

#terminal {
    position: fixed;
    /* FIX: Changed from 'bottom' to 'top' for easier JS calculation */
    top: calc(100vh - 420px); /* Position 20px from the bottom initially */
    left: 20px;
    width: 600px;
    height: 400px;
    background-color: rgba(0, 0, 15, 0.9);
    border: 2px solid #585858;
    box-shadow: 0 0 15px rgba(71, 155, 223, 0.4);
    z-index: 50000;
    display: flex;
    flex-direction: column;
    font-family: 'Pixelify Sans', monospace;
    color: #eee;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}


#terminal.hidden {
    display: none;
}

#terminal-header {
    background-color: #585858;
    color: #eee;
    padding: 3px 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* FIX: Add the move cursor to indicate it's draggable */
    cursor: move;
}

#terminal-close {
    cursor: pointer;
    font-size: 20px;
}
#terminal-close:hover {
    color: #e94560;
}

#terminal-output {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 16px;
    line-height: 1.2; /* Tighter line-height for ASCII art */
}

.terminal-line {
    white-space: pre-wrap; /* Allows text to wrap */
}
.terminal-line.command {
    color: #88ddff; /* Light blue for user commands */
}
.terminal-line.error {
    color: #e94560; /* Red for errors */
}

#terminal-input-line {
    display: flex;
    align-items: center;
    padding: 0 10px 10px;
}

.prompt {
    margin-right: 8px;
    color: #50fa7b; /* Green prompt like many terminals */
}

#terminal-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #eee;
    font-family: 'Pixelify Sans', monospace;
    font-size: 16px;
    caret-color: transparent; /* Hide the default caret */
}

/* Blinking Cursor Effect */
#terminal-input:focus::after {
    content: '_';
    display: inline-block;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}


/* FIX: Target the new <pre> tags and remove default margins */
#terminal-output .terminal-line {
    margin: 0;
    font-family: 'Pixelify Sans', monospace; /* Ensure monospace font */
    white-space: pre-wrap; /* Allow wrapping for long lines, but preserve spaces */
}

/* Specific styling for the ASCII art itself */
.terminal-line.ascii {
    color: #50fa7b;
    margin-bottom: 1em;
    /* FIX: Use a true monospace font stack for perfect alignment */
    font-family: 'Consolas', 'Courier New', monospace;
}

