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

body {
    font-family: 'Space Grotesk', Arial, sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #41417e 0%, #4d4d9b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #41417e 0%, #4d4d9b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

p {
    font-size: 1.2rem;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    color: #fff;
}

a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* About Section */
#about {
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-text {
    flex-grow: 1;
}

/* Links Section */
#links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

#links li {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #222;
    padding: 10px;
    border-radius: 8px;
}

#links li img {
    width: 30px;
    height: 30px;
}

/* Portfolio Section */
#portfolio {
    margin-top: 30px;
}

.portfolio-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.portfolio-item {
    width: 100%;
    background: linear-gradient(135deg, #0a1410 0%, #02271d 100%);
    border-radius: 12px;
    padding: 15px; /* Added padding for edge behavior */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* Active State */
.portfolio-item.active {
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
    height: auto;
}

.portfolio-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.portfolio-item.active a { /* Green color on active */
    color: #4CAF50; 
}

.portfolio-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    z-index: 0;
}

.portfolio-title {
    color: inherit;
    text-decoration: underline;
    transition: color 0.4s ease;
    z-index: 2;
    margin-bottom: 15px;
    position: relative;
}

.portfolio-item.active .portfolio-title { /* Green color on active */
    color: #4CAF50;
}

.portfolio-title a {
    color: inherit;
    text-decoration: underline;
    transition: color 0.3s; 
}

.portfolio-title a:hover {
    color: #4CAF50; 
}

.portfolio-item .original-description {
    opacity: 1;
    transition: opacity 0.8s ease; /* 2-second fade transition */
}

.portfolio-item .hover-description {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease; /* 2-second fade transition */
    pointer-events: none; 
}

/* Description Container and Overlay */
.description-container {
    position: relative;
    min-height: 200px;
}

.portfolio-item .original-description,
.portfolio-item .hover-description {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: inherit;
    transition: opacity 0.8s ease; /* 2-second fade transition */
    backface-visibility: hidden;
}

.portfolio-item .original-description {
    opacity: 1;
}

.portfolio-item .hover-description {
    opacity: 0;
}

/* Active States */
.portfolio-item.active .original-description {
  opacity: 0;
}

.portfolio-item.active .hover-description {
  opacity: 1;
}

/* Make common text green on active */
.portfolio-item.active .hover-description { 
  color: #4CAF50; 
  text-shadow: 0 0 5px #4CAF50; /* Green glow */
} 

/* Add glow to the title in the hover description */
.portfolio-item.active .hover-description .portfolio-title {
  text-shadow: 0 0 5px #4CAF50; /* Green glow */
}

.original-description,
.hover-description {
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none; 
    -ms-user-select: none; 
}

/* Text Effect Styles */
.portfolio-item.active .rough {
    color: #8B0000;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 0 5px #8B0000;
}

.portfolio-item.active .lost {
    color: #A9A9A9;
    font-style: italic;
    text-transform: uppercase;
    text-shadow: 0 0 5px #A9A9A9;
}

.portfolio-item.active .supports {
    background: linear-gradient(to right, blue, red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 5px blue, 0 0 8px red;
}

.portfolio-item.active .msrewards {
    font-weight: bold;
    font-style: italic;
    background: linear-gradient(to right, blue, red, purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 5px blue, 0 0 8px red, 0 0 10px purple;
}

.portfolio-item.active .pts {
    font-weight: bold;
    font-style: italic;
    animation: rgbTextAnimation 2s linear infinite;
    text-shadow: 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #fff,
                 0 0 25px #FF0000, 0 0 30px #FF0000, 0 0 35px #FF0000;
}

@keyframes rgbTextAnimation {
    0% { color: red; }
    20% { color: orange; }
    40% { color: yellow; }
    60% { color: green; }
    80% { color: blue; }
    100% { color: purple; }
}

.portfolio-item.active .currentpts {
    font-weight: bold;
    font-style: italic;
    background: linear-gradient(to right, purple, blue, red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 3px purple, 0 0 5px blue, 0 0 5px red;
}

.portfolio-item.active .level {
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(135deg, #41417e 0%, #4d4d9b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 5px #41417e, 0 0 8px #4d4d9b;
}

/* Default styles for .goal (white text) */
.portfolio-item .goal {  
    /* No special styling here */ 
}

.portfolio-item.active .goal {
    font-weight: bold;
    font-style: italic;
    background: linear-gradient(to right, blue, red, purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 3px blue, 0 0 5px red, 0 0 8px purple;
}

.portfolio-item.active .hover-description .goal { /* GOAL styling for hover description */
    font-weight: bold;
    font-style: italic;
}

/* Contact Section */
#contact {
    margin-top: 30px;
    text-align: center;
}

a[href^="mailto:"] {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    background: #222;
    border: none;
    color: #4CAF50;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

a[href^="mailto:"]:hover {
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 10px;
    background-color: #111;
}

footer p {
    color: #4CAF50;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #about {
        flex-direction: column;
    }

    .profile-image {
        width: 100%;
        height: auto;
    }

    .portfolio-items {
        justify-content: flex-start;
    }

    .portfolio-item {
        width: calc(100% - 10px);
        margin-bottom: 15px;
    }
}