/* =============================================================================
   PROJECT SHOWCASE STYLES
   ============================================================================= */

/* Projects Section */
.projects {
    padding: 60px 20px 40px; /* Added top padding to clear header */
    background-color: white;
    margin-top: 80px; /* Additional margin for extra clearance */
}

.projects h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    font-weight: 700;
}

/* Project Grid Layout */
.project-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding: 20px;
    margin-top: 40px;
}

/* Project Cards */
.project-item {
    height: 350px;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    overflow: hidden;
    margin-bottom: 30px;
    
    /* Animation */
    animation: appear 5s linear;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
}

.project-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.project-item img {
    height: 125px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.project-item h3 {
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.4;
    color: #0077cc;
    margin-bottom: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.project-item p {
    font-size: 1.1em;
    color: #444;
    line-height: 1.5;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: justify;
    flex-grow: 1;
}

.project-item .btn {
    padding: 10px 20px;
    background-color: #00c6ff;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: auto;
}

.project-item .btn:hover {
    background-color: #0077cc;
}

/* Load More Button */
.btn-cont {
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-cont .load-more-button {
    background: #1c1c1c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    margin-top: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-cont .load-more-button:hover {
    background: #000000;
}

.hide-btn {
    display: none;
}

/* =============================================================================
   MODAL STYLES
   ============================================================================= */

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    margin: 0 auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    background-color: rgb(251, 209, 120);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes appear {
    from {
        opacity: 0;
        scale: 0.4;
    }
    to {
        opacity: 1;
        scale: 1;
    }
}

/* =============================================================================
   DARK MODE STYLES
   ============================================================================= */
body.dark-theme {
  background: #1a1a1a;
  color: #ecf0f1;
}

body.dark-theme .projects {
  margin-top: 2px;
  background-color: #000;
  color: rgb(17, 1, 1);
}

body.dark-theme .project-list {
  background-color: #110101;
}

body.dark-theme .project-item {
  background-color: #1a1a1a;
  color: #ecf0f1;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

/* Large screens */
@media (max-width: 1200px) {
    .project-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium screens */
@media (max-width: 900px) {
    .project-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .project-item {
        height: auto;
        min-height: 400px;
        padding: 25px;
    }
}

/* Small screens */
@media (max-width: 600px) {
    .project-list {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }
    
    .project-item {
        height: auto;
        min-height: 350px;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .projects {
        padding: 30px 10px;
    }
    
    .projects h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }
}