/* Futuristic Blog & Projects Page Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    color: #ffffff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Navigation & Header */
.mobile-back-to-home {
    position: fixed;
    top: 1rem;
    left: 1rem;
    color: #15aa29;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(21, 170, 41, 0.3);
    transition: all 0.3s ease;
}

.mobile-back-to-home:hover {
    background-color: rgba(21, 170, 41, 0.2);
    transform: translateX(-5px);
}

header {
    text-align: center;
    padding: 3rem 0 1rem;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    background: linear-gradient(135deg, #15aa29, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

header h1::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background: #15aa29;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Category Navigation */
nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.category-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(21, 170, 41, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-link:hover,
.category-link.active {
    background-color: rgba(21, 170, 41, 0.2);
    box-shadow: 0 0 15px rgba(21, 170, 41, 0.3);
    transform: translateY(-2px);
}

.category-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.category-link:hover::after {
    left: 100%;
}

/* Projects Grid Layout */
.main {
    padding: 0 2rem 2rem;
    position: relative;
}

.category {
    display: none;
    position: relative;
}

.category.active {
    display: block;
}

.category h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #15aa29;
    position: relative;
    display: inline-block;
}

.category h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #15aa29, transparent);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Project Card */
.project-card {
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    aspect-ratio: 1 / 1; /* Make it square */
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(21, 170, 41, 0.2);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(21, 170, 41, 0.3);
}

.project-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: linear-gradient(135deg, #15aa29, transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
    animation: borderGlow 3s infinite alternate;
}

@keyframes borderGlow {
    0% {
        box-shadow: 0 0 5px rgba(21, 170, 41, 0.3);
    }
    100% {
        box-shadow: 0 0 15px rgba(21, 170, 41, 0.7);
    }
}

.project-image {
    height: 65%;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 0.4;
}

.project-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.project-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #ffffff;
}

.project-category {
    font-size: 0.8rem;
    color: #15aa29;
    margin: 0;
    display: flex;
    align-items: center;
}

.project-category::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #15aa29;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.project-description {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0.5rem 0;
    color: #cccccc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.project-date {
    font-size: 0.8rem;
    color: #999999;
}

.project-action {
    color: #15aa29;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

.project-action::after {
    content: '→';
    transition: transform 0.3s ease;
}

.project-card:hover .project-action::after {
    transform: translateX(5px);
}

/* Futuristic Elements */
.circuit-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(21, 170, 41, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 170, 41, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: rgba(21, 170, 41, 0.2);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 0 10px rgba(21, 170, 41, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(21, 170, 41, 0.5);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background-color: rgba(21, 170, 41, 0.4);
    transform: translateY(-5px);
}

/* Certificates Section */
.certificates-section {
    margin-top: 4rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.certificate-card {
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(21, 170, 41, 0.2);
    cursor: pointer;
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(21, 170, 41, 0.3);
}

.certificate-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.certificate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.certificate-card:hover .certificate-image img {
    transform: scale(1.05);
}

.certificate-content {
    padding: 1rem;
}

.certificate-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #ffffff;
}

.certificate-issuer {
    margin: 0;
    font-size: 0.8rem;
    color: #15aa29;
}

.certificate-date {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #999999;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .certificates-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .projects-grid,
    .certificates-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-back-to-home {
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .main {
        padding: 0 1rem 1rem;
    }
}

/* Modal (Popup) for Project Details */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1a1a1a;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 10px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(21, 170, 41, 0.3);
    border: 1px solid rgba(21, 170, 41, 0.3);
    animation: modalIn 0.5s ease forwards;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    color: #15aa29;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #15aa29;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-button {
    padding: 0.5rem 1.5rem;
    background-color: rgba(21, 170, 41, 0.2);
    color: #ffffff;
    border: 1px solid #15aa29;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button:hover {
    background-color: rgba(21, 170, 41, 0.4);
}

/* Animation Keyframes */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(21, 170, 41, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(21, 170, 41, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(21, 170, 41, 0);
    }
}

/* Background Animation */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.animated-background .particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: rgba(21, 170, 41, 0.5);
    border-radius: 50%;
    animation: particleMove 20s infinite linear;
}

@keyframes particleMove {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}
