/* ===========================
   SKILLS SECTION - BENTO GRID
   =========================== */

.skills {
    padding: 100px 80px;
    background: #000000;
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.white-mode .skills {
    background: #ececec;
}

/* Skills Header - Right Aligned */
.skills-header {
    text-align: right;
    margin-bottom: 60px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section-title-left {
    font-size: clamp(48px, 7vw, 80px);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-subtitle-left {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bento Grid - 3 Equal Cards */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 80px;
}

/* Bento Card with Fill Effect */
.bento-card {
    background: rgba(73, 92, 174, 0.74);
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 4px 20px var(--card-shadow);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.bento-card.visible {
    opacity: 1;
    background: rgba(116, 123, 155, 0.197);
    transform: translateY(0);
}

/* Fill effect from cursor - Same as hero buttons */
.bento-card::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(116, 123, 155, 0.399);
    left: var(--x, 50%);
    top: var(--y, 50%);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                height 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 0;
    pointer-events: none;
}

.bento-card:hover::before {
    width: 200%;
    height: 200%;
}

/* Keep content on top of fill */
.bento-card > * {
    position: relative;
    z-index: 1;
}

/* No lift effect - just fill */
.bento-card:hover {
    transform: none;
    box-shadow: 0 4px 20px var(--card-shadow);
}

:root.white-mode .bento-card {
    background: rgba(110, 117, 149, 0.359);
    border: 1px solid rgba(0, 0, 0, 0);
}

:root.white-mode .bento-card::before {
    background: rgba(93, 101, 141, 0.507);
}

/* Card Visual Area */
.card-visual {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
}

.icon-abstract {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Abstract Shapes for Frontend */
.abstract-shape {
    position: absolute;
    border: 3px solid rgba(102, 126, 234, 0.455);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 40%;
    left: 30%;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 30%;
    right: 30%;
    background: rgba(0, 0, 0, 0.081);
}

.bento-card:hover .abstract-shape {
    transform: rotate(15deg);
    border-color: rgba(255, 255, 255, 0.869);
}

:root.white-mode .abstract-shape {
    border-color: rgba(0, 0, 0, 0.224);
}

:root.white-mode .shape-2 {
    border-color: rgba(0, 0, 0, 0.224);
}

/* Mobile Frame for Mobile Dev */
.mobile-frame {
    width: 70px;
    height: 120px;
    border: 3px solid #fff;
    border-radius: 16px;
    position: relative;
}

.mobile-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: rgba(0, 0, 0, 0.224);
    border-radius: 2px;
}

.mobile-notif {
    position: absolute;
    top: 20px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #f9544bed;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    z-index: 2;
}

:root.white-mode .mobile-frame {
    border-color: rgba(0, 0, 0, 0.224);
}

:root.white-mode .mobile-frame::before {
    background: rgba(0, 0, 0, 0.224);
}

:root.white-mode .mobile-notif {
    border-color: #ffffff00;
}

/* Backend Lines */
.backend-lines {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.backend-lines::before,
.backend-lines::after {
    content: '';
    width: 80%;
    height: 3px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

.backend-lines::after {
    width: 60%;
}

:root.white-mode .backend-lines::before,
:root.white-mode .backend-lines::after {
    background: rgba(0, 0, 0, 0.224);
}

/* Card Content */
.bento-card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-card-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
    flex-grow: 1;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: rgba(73, 91, 174, 0.474);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(73, 91, 174, 0.474);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.skill-tag > * {
    position: relative;
    z-index: 1;
}

.skill-tag:hover {
    background: rgba(102, 126, 234, 0.552);
    border-color: rgba(0, 0, 0, 0.224);
    transform: scale(1.05);
}

:root.white-mode .skill-tag {
    background: #ececec;
    border-color: rgba(0, 0, 0, 0.267);
}

:root.white-mode .skill-tag:hover {
    background: rgba(93, 101, 141, 0.597);
    border-color: rgba(0, 0, 0, 0);
    color: #fff;
}

/* ===========================
   EDUCATION SECTION - APPLE STYLE
   =========================== */

.education {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 800px;
    margin: 0 auto;
}

.education h3 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 600;
    margin-bottom: 48px;
    color: var(--text-color);
    text-align: center;
    letter-spacing: -0.02em;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-item {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, 
                transform 0.6s ease,
                border-color 0.3s ease;
}

.education-item:last-child {
    border-bottom: none;
}

.education-item:hover {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.education-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.education-degree {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    letter-spacing: -0.01em;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-school {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 400;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-location {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 400;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-year {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.7;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-coursework {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 400;
    font-style: italic;
    opacity: 0.8;
    line-height: 1.5;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* White mode education */
:root.white-mode .education-item {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

:root.white-mode .education-item:hover {
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

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

@media (max-width: 1024px) {
    .skills {
        padding: 80px 60px;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ===========================
   MOBILE - HORIZONTAL SCROLL (FIXED)
   =========================== */

@media (max-width: 768px) {
    .skills {
        padding: 60px 0;
        overflow-x: hidden; /* Prevent horizontal overflow */
    }

    .skills-header {
        padding: 0 24px;
        margin-bottom: 40px;
        text-align: left;
    }

    .section-title-left {
        font-size: clamp(32px, 8vw, 42px);
    }

    .section-subtitle-left {
        font-size: 16px;
    }

    /* Horizontal scroll container - FIXED */
    .bento-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0 24px 24px;
        margin: 0 0 40px 0;
        scrollbar-width: none; /* Firefox */
    }

    /* Hide scrollbar */
    .bento-grid::-webkit-scrollbar {
        display: none;
    }

    /* Each card fits perfectly on screen - FIXED */
    .bento-card {
        min-width: calc(100vw - 80px); /* Full width minus padding with buffer */
        max-width: calc(100vw - 80px);
        width: calc(100vw - 80px);
        flex-shrink: 0;
        scroll-snap-align: center;
        padding: 24px;
        border-radius: 20px;
        min-height: auto;
        max-height: none;
    }

    /* Disable fill hover for mobile */
    .bento-card::before {
        display: none !important;
    }

    /* Touch feedback */
    .bento-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px var(--card-shadow);
    }

    .bento-card:hover {
        transform: none;
    }

    .card-visual {
        height: 100px;
        margin-bottom: 20px;
    }

    /* Smaller abstract shapes for mobile */
    .shape-1 {
        width: 60px;
        height: 60px;
    }

    .shape-2 {
        width: 45px;
        height: 45px;
    }

    .mobile-frame {
        width: 60px;
        height: 100px;
    }

    .bento-card-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .bento-card-desc {
        font-size: 14px;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .skill-tag {
        font-size: 12px;
        padding: 5px 12px;
    }

    /* Education mobile */
    .education {
        padding: 0 24px;
    }

    .education h3 {
        font-size: clamp(28px, 7vw, 36px);
        margin-bottom: 32px;
    }

    .education-item {
        padding: 24px 0;
    }

    .education-degree {
        font-size: 18px;
    }

    .education-school {
        font-size: 16px;
    }

    .education-location {
        font-size: 14px;
    }
}

/* ===========================
   SMALL SCREENS (Phones) - FIXED
   =========================== */
@media (max-width: 480px) {
    .skills {
        padding: 40px 0;
    }

    .skills-header {
        padding: 0 20px;
        margin-bottom: 32px;
    }

    .section-title-left {
        font-size: clamp(28px, 9vw, 36px);
    }

    .section-subtitle-left {
        font-size: 14px;
    }

    /* Adjusted for smaller phones */
    .bento-grid {
        padding: 0 20px 20px;
        gap: 12px;
    }

    .bento-card {
        min-width: calc(100vw - 64px); /* More conservative padding */
        max-width: calc(100vw - 64px);
        width: calc(100vw - 64px);
        padding: 20px;
        border-radius: 18px;
    }

    .card-visual {
        height: 90px;
        margin-bottom: 16px;
    }

    .shape-1 {
        width: 50px;
        height: 50px;
    }

    .shape-2 {
        width: 38px;
        height: 38px;
    }

    .mobile-frame {
        width: 50px;
        height: 85px;
    }

    .bento-card-title {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .bento-card-desc {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .skill-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Education small mobile */
    .education {
        padding: 0 20px;
    }

    .education h3 {
        font-size: clamp(26px, 8vw, 32px);
    }

    .education-item {
        padding: 20px 0;
    }

    .education-degree {
        font-size: 17px;
    }

    .education-school {
        font-size: 15px;
    }

    .education-location {
        font-size: 13px;
    }

    .education-coursework {
        font-size: 12px;
    }
}

/* Extra small screens (very small phones) */
@media (max-width: 360px) {
    .bento-card {
        min-width: calc(100vw - 56px);
        max-width: calc(100vw - 56px);
        width: calc(100vw - 56px);
        padding: 18px;
    }

    .bento-grid {
        padding: 0 18px 18px;
    }

    .card-visual {
        height: 80px;
    }
}

/* Empty main card when hovering skill tag */
.bento-card.tag-hover::before {
    width: 0 !important;
    height: 0 !important;
    transition: width 0.3s ease, height 0.3s ease;
}
/* ===========================
   SCROLL DOTS / PAGE INDICATOR
   =========================== */

.scroll-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-bottom: 20px;
}

.scroll-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

.scroll-dots .dot.active {
    width: 28px;
    border-radius: 5px;
    background: #000;
}

/* Mobile styles */
@media (max-width: 768px) {
    .scroll-dots {
        display: flex;
    }
    
    .bento-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .bento-grid::-webkit-scrollbar {
        display: none;
    }
    
    .bento-card {
        min-width: 85vw !important;
        max-width: 85vw !important;
        flex-shrink: 0 !important;
        scroll-snap-align: center;
    }
}