/* projects.css */
/* Reset and Base Styles */
.projects-wrapper {
    padding: clamp(50px, 10vh, 100px) 5% clamp(50px, 10vh, 150px);
    min-height: 80vh;
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 clamp(20px, 5vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: clamp(20px, 4vw, 30px);
    padding-top: 80px; /* Match other pages */
    margin-top: 0;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.section-subtitle {
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: clamp(40px, 6vw, 60px);
}

.project-tabs {
    display: flex;
    justify-content: center;
    padding-top: 15px;
    padding-bottom: 40px;
    gap: clamp(20px, 3vw, 30px);
    margin-bottom: clamp(40px, 6vw, 60px);
    flex-wrap: wrap;
}

.tab-button {
    padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 25px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
    position: relative;
}

.view-button {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
    position: relative;
    z-index: 10;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--bg-primary) !important;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}


.tab-button.active {
    background: var(--accent-color);
    color: var(--bg-primary);
    border: 1px solid var(--accent-color);
}

.tab-button:hover:not(.active) {
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(40px, 5vw, 50px);
    padding: 0 clamp(10px, 2vw, 20px);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 350px;
    opacity: 0;
    animation: slideUp 0.5s ease forwards;
}

/* Updated logo styling */
.project-card img.project-logo {
    width: auto;
    height: 60px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 20px;
    display: block;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
    background: var(--card-hover);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02), transparent);
    border-radius: 16px;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::before {
    opacity: 0.1;
}

.project-card img.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: clamp(15px, 3vw, 20px);
    transition: transform 0.3s ease;
    background-color: var(--card-hover);
    position: relative;
}

.project-card:hover img.project-image {
    transform: scale(1.02);
}

.project-image::after {
    content: "Image";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 14px;
    opacity: 0.5;
    z-index: 0;
}

.project-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: clamp(10px, 2vw, 15px);
    position: relative;
    z-index: 1;
}

.project-card p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: clamp(20px, 3vw, 25px);
    position: relative;
    z-index: 1;
}

.project-card .view-button {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
}

.project-card .view-button:hover {
    background: #6b46fe;
    transform: scale(1.02);
}

.load-more {
    padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 25px);
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: clamp(40px, 6vw, 60px);
    display: none;
}

.load-more:hover {
    background: #6b46fe;
    transform: scale(1.02);
}

/* Project Modal */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px var(--shadow-color);
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.modal-content img.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: clamp(20px, 3vw, 30px);
}

.modal-content h2.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(24px, 4vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: clamp(10px, 2vw, 15px);
}

.modal-content p.modal-description {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: clamp(20px, 3vw, 25px);
}

.modal-content .contact-button {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
    border-radius: 8px;
    background: #ff6b6b;
    color: var(--bg-primary);
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 200px;
    text-align: center;
}

.modal-content .contact-button:hover {
    background: #ff4d4d;
    transform: scale(1.02);
}

.modal-content .prev-project,
.modal-content .next-project {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: clamp(10px, 2vw, 15px);
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(16px, 3vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.modal-content .prev-project {
    left: 10px;
}

.modal-content .next-project {
    right: 10px;
}

.modal-content .prev-project:hover,
.modal-content .next-project:hover {
    background: #6b46fe;
    transform: translateY(-50%) scale(1.1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20px, 4vw, 24px);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 5px 10px;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Theme switch fixes */
.theme-switch {
    position: relative;
    z-index: 10;
    margin-left: 20px;
}

#theme-toggle {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* Ensure both icons exist but display based on theme */
.sun-icon, .moon-icon {
    position: absolute;
    transition: all 0.3s ease;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Updated animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide/Show Projects Based on Category */
.project-card {
    display: block;
}

.project-card.hidden {
    display: none;
}

/* Contact popup fixes */
.popup-active {
    animation: popupFadeIn 0.3s ease forwards;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.contact-popup {
    z-index: 1001;
}

.popup-overlay {
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-wrapper {
        padding: clamp(40px, 8vh, 80px) 5% clamp(30px, 8vh, 60px);
    }

    .section-title {
        font-size: clamp(28px, 5vw, 40px);
        margin-bottom: clamp(20px, 4vw, 30px);
    }

    .section-subtitle {
        font-size: clamp(12px, 2.5vw, 14px);
        margin-bottom: clamp(35px, 5vw, 50px);
    }

    .project-tabs {
        gap: clamp(15px, 2vw, 25px);
        margin-bottom: clamp(35px, 5vw, 50px);
    }

    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: clamp(35px, 4vw, 45px);
    }

    .project-card {
        padding: clamp(18px, 3vw, 25px);
        max-width: 320px;
    }

    .project-card img.project-logo {
        height: 50px;
    }

    .load-more {
        margin-top: clamp(35px, 5vw, 50px);
    }
}

@media (max-width: 768px) {
    .projects-wrapper {
        padding: clamp(30px, 8vh, 60px) 5% clamp(20px, 8vh, 40px);
    }

    .section-title {
        font-size: clamp(24px, 4vw, 32px);
        margin-bottom: clamp(15px, 3vw, 25px);
    }

    .section-subtitle {
        font-size: clamp(12px, 2vw, 14px);
        margin-bottom: clamp(30px, 4vw, 40px);
    }

    .project-tabs {
        flex-direction: row;
        gap: clamp(10px, 2vw, 20px);
        margin-bottom: clamp(30px, 4vw, 40px);
    }

    .tab-button {
        padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
        font-size: clamp(12px, 2.5vw, 14px);
        min-width: 100px;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: clamp(30px, 3vw, 35px);
    }

    .project-card {
        padding: clamp(15px, 2vw, 20px);
        max-width: 300px;
    }

    .project-card img.project-logo {
        height: 45px;
    }

    .project-card h3 {
        font-size: clamp(18px, 3vw, 20px);
    }

    .project-card p {
        font-size: clamp(12px, 2.5vw, 14px);
    }

    .load-more {
        margin-top: clamp(30px, 4vw, 40px);
    }

    .modal-content {
        padding: clamp(15px, 2vw, 20px);
        max-width: 700px;
    }

    .modal-content img.modal-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .projects-wrapper {
        padding: clamp(20px, 6vh, 40px) 5% clamp(15px, 6vh, 30px);
    }

    .section-title {
        font-size: clamp(20px, 4vw, 24px);
        margin-bottom: clamp(10px, 2vw, 15px);
    }

    .section-subtitle {
        font-size: clamp(10px, 2vw, 12px);
        margin-bottom: clamp(25px, 3vw, 30px);
    }

    .project-tabs {
        flex-direction: column;
        gap: clamp(8px, 2vw, 15px);
        margin-bottom: clamp(20px, 3vw, 30px);
    }

    .tab-button {
        width: 100%;
        text-align: center;
        padding: clamp(8px, 2vw, 12px) clamp(10px, 2vw, 15px);
        font-size: clamp(12px, 2vw, 14px);
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: clamp(25px, 3vw, 30px);
    }

    .project-card {
        padding: clamp(12px, 2vw, 18px);
        max-width: 100%;
    }

    .project-card img.project-logo {
        height: 40px;
    }

    .project-card h3 {
        font-size: clamp(16px, 3vw, 18px);
    }

    .project-card p {
        font-size: clamp(12px, 2vw, 14px);
    }

    .project-card .view-button {
        padding: clamp(6px, 2vw, 10px) clamp(12px, 2vw, 16px);
        font-size: clamp(12px, 2vw, 14px);
    }

    .load-more {
        padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 20px);
        font-size: clamp(12px, 2vw, 14px);
        margin-top: clamp(25px, 3vw, 30px);
    }

    .modal-content {
        padding: clamp(10px, 2vw, 15px);
        max-width: 90%;
    }

    .modal-content img.modal-image {
        height: 200px;
    }

    .modal-content h2.modal-title {
        font-size: clamp(20px, 3vw, 24px);
    }

    .modal-content p.modal-description {
        font-size: clamp(12px, 2vw, 14px);
    }

    .modal-content .contact-button {
        padding: clamp(6px, 2vw, 10px) clamp(12px, 2vw, 16px);
        font-size: clamp(12px, 2vw, 14px);
    }

    .modal-content .prev-project,
    .modal-content .next-project {
        padding: clamp(8px, 2vw, 12px);
        font-size: clamp(14px, 2vw, 16px);
    }
}