/* Enhanced project description styling and interaction */

/* Project overlay improvements */
.project-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95)) !important;
    padding: 20px;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Project description visibility enhancement */
.project-description {
    max-height: 80px; /* Increased max height to show more text */
    overflow: hidden;
    transition: max-height 1.2s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
    opacity: 0.9;
    margin-bottom: 15px;
    position: relative;
    padding-right: 10px; /* Add right padding to prevent text from hitting the edge */
}

.project-description p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-overflow: ellipsis; /* Add ellipsis for overflowing text */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Reduced to 2 lines for better fit */
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Standard property for compatibility */
}

/* Read more indicator */
.project-description::after {
    content: "...";
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.9) 50%);
    padding: 0 30px 0 50px;
    font-weight: bold;
    width: 100%;
    text-align: right;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Make project text always visible on hover */
.project-item:hover .project-info h3,
.project-item:hover .project-info p {
    opacity: 1;
    transform: translateY(0);
}

/* Expanded state for clicked projects */
.project-item.expanded .project-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.98)) !important;
    box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.4);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.project-item.expanded {
    z-index: 10; /* Bring expanded project to front */
    transform: scale(1.0); /* Keep the size consistent */
    transition: transform 0.4s ease, z-index 0s;
}

.project-item.expanded .project-description {
    max-height: 500px; /* Increased for longer descriptions */
    opacity: 1;
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: block; /* Override webkit-box display */
}

.project-item.expanded .project-description p {
    display: block; /* Override webkit-box display for paragraphs */
    -webkit-line-clamp: initial; /* Remove line clamp in expanded state */
    line-clamp: initial;
}

/* Remove ellipsis when expanded */
.project-item.expanded .project-description::after {
    display: none;
}

/* Show "Read More" text that appears when hovering */
.read-more-indicator {
    display: inline-block;
    margin-top: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
    font-weight: 600;
    background-color: rgba(var(--primary-color-rgb), 0.7);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.6);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.5);
    animation: pulse-light 2s infinite;
    position: relative;
    z-index: 5;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: fit-content;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes pulse-light {
    0% { box-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 12px rgba(var(--primary-color-rgb), 0.6); transform: scale(1.05); }
    100% { box-shadow: 0 0 5px rgba(var(--primary-color-rgb), 0.3); transform: scale(1); }
}

.read-more-indicator:hover {
    opacity: 1;
    text-decoration: underline;
    background-color: rgba(var(--primary-color-rgb), 0.2);
}

.project-item.expanded .read-more-indicator {
    display: none;
    animation: none;
}

/* Improved project technologies section */
.project-technologies {
    margin: 12px 0;
}

/* Make project link more prominent */
.project-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white !important;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px) rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Project click animations */
.project-item {
    transition: transform 0.5s ease, z-index 0s linear;
}

.project-item.expanded {
    z-index: 100;
    position: relative;
}

/* Clicked state */
.project-item.expanded .project-image img {
    filter: blur(1px) brightness(0.7);
}
