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

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    max-width: 800px;
    margin: auto;
    padding: 20px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        rgba(255, 255, 255, 0.02) 0px,
        rgba(255, 255, 255, 0.02) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

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

iframe {
    border: none;
    max-width: 100%;
    display: block;
    margin: 10px 0;
    margin-left: auto;
    margin-right: auto;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0;
}

h1 {
    font-size: 2em;
    color: #ffffff;
}

h1, h2 , h3, h4 {
    font-family: 'VT323', monospace; /* Retro terminal look */
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0px 0px 5px rgba(255, 140, 0, 0.4); /* Orange glow */
}


/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

nav a {
    text-decoration: none;
    color: #b0b0b0; /* Dark gray */
    padding: 10px;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #ff9800; /* Orange */
}

/* Main Content */
main {
    padding: 20px;
    /* Removed background color and shadow */
    flex: 1;
}

/* Markdown Elements */
h2, h3, h4 {
    color: #ffffff;
    margin-top: 15px;
}

p {
    margin-bottom: 10px;
}

ul {
    padding-left: 20px;
}

/* Links */
a {
    color: #b0b0b0; /* Dark gray */
    text-decoration: none;
    transition: color 0.3s;
    cursor: text; /* Feels like an old terminal */
}

a:hover {
    color: #ff9800; /* Orange */
    text-decoration: underline;
}

footer {
    padding: 1rem 0;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: space-between; /* Distribute space between items */
    align-items: center; /* Center items vertically */
    margin-top: auto; /* Ensure the footer is pushed to the bottom if the content is short */
}

footer a {
    color: #ff9800;
    text-decoration: none;
    flex-grow: 1;
    text-align: center; /* Center text within each link */
}

footer a:hover {
    text-decoration: underline;
}

/* Inline code */
code {
    color: #ff9800; /* Orange */
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    background-color: #2e2e2e; /* Dark background for contrast */
    padding: 2px 4px;
    border-radius: 4px;
}

/* Code block styling */
pre code {
    display: block;
    padding: 10px 20px;
    margin: 10px 0;
    max-height: 400px; /* Set a fixed height */
    overflow-y: scroll; /* Allow vertical scrolling */
    overflow-x: auto;
    background-color: #2e2e2e;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 14px; /* Default font size */
}

pre code * {
    font-family: 'IBM Plex Mono', monospace;
}

pre code::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

pre code::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

pre code::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

pre code::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Blinking cursor effect */
@keyframes blink {
    50% { opacity: 0; }
}

.blinking-cursor::after {
    content: "_";
    animation: blink 1s step-end infinite;
}

/* Loading screen styling */
.loading-text {
    color: #ff9800; /* Vintage orange */
    font-size: 1em;
    font-family: 'VT323', monospace;
    font-weight: bold;
    display: block; /* Ensure it is displayed */
    position: relative; /* Ensure it is positioned correctly */
    z-index: 10; /* Ensure it is above other elements */
}

/* Markdown pages styling */
.profile-page img {
    max-width: 200px;
    height: auto;
    align-content: center;
    padding: 5px;
    margin: 10px auto; 
    display: block; 
    border-radius: 50%; /* Apply circular mask */
    position: relative;
}

/* PROFILE page */
.profile-page ul { 
    list-style-type: none; 
    padding-left: 0; 
    text-align: center;
    display: flex;
    justify-content: center;
}

.profile-page ul li {
    display: inline-block;
    margin-right: 10px; 
}

.profile-page ul img {
    max-width: 40px;
    height: auto;
    filter: invert(1);
    transition: filter 0.3s;
}

.profile-page ul a:hover img {
    filter: invert(0.5) sepia(1) saturate(5) brightness(1.1);
    cursor: pointer;
}

.profile-page ul a:hover {
    color: #ff9800;
    text-decoration: underline;
}

.profile-page h1 {
    display: none;
}

.profile-page h2 {
    text-align: center;
    font-size: medium;
}

/* Scroll Indicator */
.scroll-indicator {
    text-align: center;
    animation: bounce 2s infinite;
    opacity: 1;
    transition: opacity 0.5s;
    filter: invert(0.5) sepia(1) saturate(5) brightness(1.1);
}

.scroll-indicator a {
    cursor: pointer;
}

.scroll-indicator img {
    width: 60px;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Fade out when scrolled to services section */
.scroll-indicator .scrolled, 
.scroll-indicator .clicked {
    opacity: 0;
    pointer-events: none; /* Prevent further clicks */
}

#services, #science, #development, #consulting {
    padding-top: 20px;
}

.profile-page h4{
    font-family: 'VT323', monospace; /* Retro terminal look */
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0px 0px 5px rgba(255, 140, 0, 0.4);
    margin-bottom: -7px; /* Reduce margin-bottom */
}

.profile-page h3 a, 
.profile-page h4 a {
    color: inherit; /* Use the inherited color */
    text-decoration: none; /* Remove underline */
    transition: none; /* Remove transition effect */
}

.profile-page h4 a.highlight {
    text-shadow: 0px 0px 5px rgba(255, 140, 0, 1); 
    transition: color 3s ease-in-out; /* Smooth transition */
    animation: blink 0.5s step-end infinite;
}

/* add background color to each section of h4 */
.profile-page h4:nth-of-type(1),
.profile-page h4:nth-of-type(1) ~ * {
    background-color: #2e2e2e;
    padding: 5px;
    border-radius: 5px;
}

/* PROJECT page */
.projects-page h2{
    font-family: 'VT323', monospace; /* Retro terminal look */
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0px 0px 5px rgba(255, 140, 0, 0.4); 
}

.projects-page h2 a {
    color: inherit; /* Use the inherited color */
    text-decoration: none; /* Remove underline */
    transition: none; /* Remove transition effect */
}

.projects-page h2 a.highlight {
    text-shadow: 0px 0px 5px rgba(255, 140, 0, 1); 
    transition: color 3s ease-in-out; /* Smooth transition */
    animation: blink 0.5s step-end infinite;
}
/*change the horizontal lines in projects page*/
.projects-page hr {
    border: 1px solid #ff990093;
    width: 50%;
    margin: 40px auto;
}

/*add more space between ul elements*/
.projects-page ul {
    margin-top: 20px;
}
.projects-page ul li {
    margin-top: 10px;
}

/* Contact Section */

.contact-page h1{
    text-align: center;
    margin-bottom: 20px;
}

#map {
    margin-top: 40px; /* Add vertical space on top */
    width: 100%;
    height: 300px;
    background-color: #2e2e2e;
    margin-bottom: 20px;
    border-radius: 8px;
}

/* Form Styles */
#contactform {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#contactform input, #contactform textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #2e2e2e;
    color: #e0e0e0;
    font-size: 1em; /* Increase text size */
}
#contactform input::placeholder, #contactform textarea::placeholder {
    color: #b0b0b0;
    font-size: 1em; /* Increase placeholder text size */
}
#contactform textarea {
    resize: vertical;
}
/* Submit Button */
.submit-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #ff9800; /* Orange */
    color: #121212;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
}
.submit-button:hover {
    background-color: #e68900; /* Darker orange */
}

.impressum-page h1 {
    text-align: center;
}

.impressum-page h2 {
    font-size: 1.5em;
    margin-top: 1.5em; /* Add small vertical space before h2 */
}

/* make sub-headings smaller */
.impressum-page h3 {
    font-size: 1em;
}

.impressum-page p {
    /* make space between paragraphs smaller*/
    margin-bottom: 0px;
    margin-top: 0px;
}


/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        max-width: 100%;
    }

    header, nav, main {
        padding: 10px;
    }
    
    h1 {
        font-size: 1em;
    }

    .profile-page h1, .profile-page h2 {
        text-align: center; /* Center the text */
        font-size: 90%; /* Ensure the font size is responsive */
        max-width: 100%; /* Ensure the headings fit within the width of the display */
        white-space: nowrap; /* Prevent text from wrapping */
        overflow: hidden; /* Hide overflow text */
        text-overflow: ellipsis; /* Add ellipsis (...) for overflow text */
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    #map {
        width: 100%;
        height: 200px;
    }

    /* Footer: stack links vertically & center when space is limited */
    footer {
        flex-direction: column;          /* Put links on separate lines */
        justify-content: center;         /* Center vertically within footer */
        align-items: center;             /* Center each link horizontally */
        gap: 6px;                        /* Small space between links */
    }
    footer a {
        flex-grow: 0;                    /* Prevent stretching */
        width: 100%;                     /* Allow full tap area width */
        text-align: center;              /* Center text explicitly */
    }
}