/* =========================================
   1. COMPONENTS (Buttons, Cards)
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary {
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    background: transparent;
}

.btn-primary:hover {
    background: rgba(100, 255, 218, 0.1);
}

.btn-outline {
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* =========================================
   2. SKILLS TREE (Desktop)
   ========================================= */
.skills-tree-wrapper {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 80px;
    padding: 40px 20px;
    width: 100%;
}

@media (min-width: 1025px) {
    .skills-tree-wrapper {
        display: flex;
    }

    #skills .container {
        max-width: 1300px;
    }
}

.tree-node {
    z-index: 2;
}

.node-content {
    background: var(--glass-bg);
    border: 1px solid var(--accent-cyan);
    padding: 18px 35px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    cursor: default;
    white-space: nowrap;
}

.node-content:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.3);
}

.root-node .node-content {
    padding: 25px 50px;
    font-size: 1.4rem;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.1);
}

.tree-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    width: 100%;
    position: relative;
}
.tree-grid > .tree-branch {
    flex: 1;
    min-width: 0;
}

/* Connectors */
.root-node {
    position: relative;
}

.root-node::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 50%;
    width: 2px;
    height: 80px;
    background: var(--glass-border);
    transform: translateX(-50%);
}

.tree-grid::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--glass-border);
    display: block;
}

.tree-branch::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    width: 2px;
    height: 40px;
    background: var(--glass-border);
    transform: translateX(-50%);
}

.tree-branch {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.branch-node {
    margin-bottom: 30px;
    background: rgba(10, 25, 47, 0.8);
    border-color: var(--text-secondary);
    font-size: 1.1rem;
}

.branch-node:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
}

.leaf-list li {
    background: var(--glass-bg);
    margin-bottom: 12px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.leaf-list li i {
    color: var(--accent-cyan);
}

.leaf-list li:hover {
    color: var(--accent-cyan);
    background: rgba(100, 255, 218, 0.05);
    transform: translateX(5px);
}

/* =========================================
   3. SKILLS ACCORDION (Mobile)
   ========================================= */
.skills-accordion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 1025px) {
    .skills-accordion {
        display: none;
    }
}

.accordion-item {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-bg);
}

.accordion-header {
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 50px;
    /* Touch friendly */
}

.accordion-header span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-header:hover {
    color: var(--accent-cyan);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.accordion-header[aria-expanded="true"]+.accordion-content {
    max-height: 500px;
}

.accordion-header[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
}

.chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
}

.chip i {
    margin-right: 8px;
}

/* =========================================
   4. PROJECTS SECTION
   ========================================= */
.featured-project {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
}

.fp-content {
    flex: 1.2;
    order: 1;
}

.fp-image {
    flex: 0.8;
    order: 2;
    height: auto;
    /* Removed fixed min-height and dark background */
    display: flex;
    align-items: flex-start;
    /* Align image to top or center? Center is usually safer but without bg it matters less. Let's keep flex but remove bg */
    justify-content: center;
}

.project-img-placeholder {
    font-size: 4rem;
    color: var(--text-secondary);
}

.project-img {
    width: 100%;
    height: auto;
    /* Let height adjust naturally */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
    /* Add depth */
    border: 1px solid var(--glass-border);
    /* Subtle border definition */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.featured-project:hover .project-img {
    transform: scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(100, 255, 218, 0.15);
    border-color: rgba(100, 255, 218, 0.3);
}

/* Clarification Chips Style */
.fp-desc ul li {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.3s ease;
}

.fp-desc ul li:hover {
    background: rgba(100, 255, 218, 0.05);
    border-color: rgba(100, 255, 218, 0.2);
}

@media (max-width: 768px) {
    .featured-project {
        flex-direction: column;
        gap: 20px;
    }

    .fp-image {
        width: 100%;
        height: 250px;
        order: -1;
        /* Image on top on mobile */
    }
}

.fp-overline {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.fp-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.fp-desc {
    background: transparent;
    /* Clean look */
    border: none;
    padding: 0;
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.fp-specs,
.tech-list,
.tech-list-sm {
    color: var(--text-secondary);
}

.fp-specs li {
    margin-bottom: 5px;
}

.fp-specs i {
    color: var(--accent-cyan);
    margin-right: 8px;
}

.tech-list {
    display: flex;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 25px;
    flex-wrap: wrap;
    /* Wrap tags on mobile */
}

.fp-links a {
    font-size: 1.4rem;
    margin-right: 20px;
    display: inline-block;
    padding: 10px;
    /* Better touch target */
}

.fp-links a:hover {
    color: var(--accent-cyan);
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.projects-grid > * {
    flex: 1 1 300px;
    max-width: 100%;
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-7px);
}

.pc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.folder-icon {
    font-size: 2.5rem;
    color: var(--accent-cyan);
}

.pc-links a {
    font-size: 1.2rem;
    margin-left: 15px;
    padding: 5px;
}

.pc-links a:hover {
    color: var(--accent-cyan);
}

.pc-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.pc-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.tech-list-sm {
    display: flex;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    cursor: pointer;
    text-align: left;
    padding: 10px 0;
    /* Touch friendly */
}

/* =========================================
   5. EDUCATION, CERTS, SERVICES (Grids)
   ========================================= */
.edu-grid,
.certs-grid,
.services-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.edu-grid > *,
.certs-grid > *,
.services-row > * {
    flex: 1 1 300px;
}

.edu-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
}

.edu-icon,
.cert-icon,
.svc-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.edu-status {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-cyan);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.cert-card,
.service-card {
    text-align: center;
}

.cert-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

/* =========================================
   6. CONTACT & SOCIAL
   ========================================= */
.contact-container {
    text-align: center;
}

.contact-overline {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

.contact-title {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.contact-desc {
    max-width: 600px;
    margin: 0 auto 50px auto;
    color: var(--text-secondary);
}

.big-btn {
    padding: 20px 30px;
    font-size: 1.1rem;
}

.status-badge {
    display: inline-block;
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-cyan);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    margin-bottom: 30px;
    border: 1px solid var(--accent-cyan);
}

.social-cards-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.social-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    background: rgba(100, 255, 218, 0.05);
}

.social-card i {
    font-size: 2rem;
    color: var(--accent-cyan);
}

/* =========================================
   7. GITHUB ACTIVITY (New)
   ========================================= */
#github {
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--glass-bg) 100%);
}

.repos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 40px;
}

.repos-grid > * {
    flex: 1 1 300px;
    max-width: 100%;
}

.repo-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 25px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.repo-card:hover {
    transform: translateY(-7px);
    border-color: var(--accent-cyan);
    box-shadow: var(--glass-shadow);
}

.repo-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.repo-icon {
    color: var(--accent-cyan);
    font-size: 2rem;
}

.repo-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 5;
    padding: 10px;
}

.repo-links a:hover {
    color: var(--accent-cyan);
}

.repo-title {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--font-main);
}

.repo-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Skeleton */
.github-loading {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.github-loading > .skeleton-card {
    flex: 1 1 calc(33.333% - 17px);
}

@media (max-width: 900px) {
    .github-loading > .skeleton-card {
        flex: 1 1 calc(50% - 13px);
    }
}

@media (max-width: 600px) {
    .github-loading > .skeleton-card {
        flex: 1 1 100%;
    }
}

.skeleton-card {
    height: 250px;
    background: var(--glass-bg);
    border-radius: 8px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.3;
        background-color: var(--glass-bg);
    }

    50% {
        opacity: 0.6;
        background-color: var(--glass-border);
    }

    100% {
        opacity: 0.3;
        background-color: var(--glass-bg);
    }
}

.view-all-link {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
}

.github-error i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}

/* =========================================
   8. ANIMATIONS & MODALS
   ========================================= */
.fade-in-up {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-200 {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--accent-cyan);
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: auto;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover {
    color: var(--accent-cyan);
}

/* =========================================
   9. MOBILE SPECIFIC COMPONENT FIXES
   ========================================= */
@media (max-width: 768px) {

    /* Grids: Force Single Column on Mobile */
    .edu-grid,
    .certs-grid,
    .services-row,
    .projects-grid,
    .repos-grid {
        flex-direction: column;
    }

    .edu-grid > *,
    .certs-grid > *,
    .services-row > *,
    .projects-grid > *,
    .repos-grid > * {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    /* Reduce Padding in Cards */
    .glass-card,
    .edu-card,
    .repo-card {
        padding: 20px;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {

    /* Extra spacing adjustments for small screens */
    .contact-title {
        font-size: 2rem;
    }

    .big-btn {
        width: 100%;
        display: block;
    }

    .social-cards-grid {
        flex-direction: column;
    }

    .social-card {
        width: 100%;
        justify-content: center;
    }
}

/* Certificate Layouts */
.cert-split-layout {
    display: flex;
    align-items: center;
    gap: 30px;
    text-align: left;
}

.cert-split-layout img {
    width: 60%;
    margin-bottom: 0;
    max-height: 400px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.cert-split-layout .cert-content-side {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.cert-centered-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (max-width: 768px) {
    .cert-split-layout {
        flex-direction: column;
        text-align: center;
    }

    .cert-split-layout img,
    .cert-split-layout .cert-content-side {
        width: 100%;
        align-items: center;
    }
}