/* ========================================
   GLOBAL STYLES & RESETS
   ======================================== */

* {
    box-sizing: border-box;
    margin: 0;
}

body {
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background-color: rgb(60, 70, 90);
    color: #f8f8f2;
}

h1 {
    font-family: 'Roboto', sans-serif;
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.page-header {
    margin-top: 40px;
    margin-bottom: 40px;
    font-weight: 900;
    text-align: center;
}

.main-box {
    border: 2px solid lightgrey;
    border-radius: 10px;
    margin: 20px auto;
    width: 75%;
    padding: 40px;
}

.main-container {
    max-width: 1200px;
    padding: 0 5%;
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.right-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.website-header {
    background-color: rgb(40, 45, 60);
    padding: 20px;
    display: flex;
    position: sticky;
    top: 0;
    align-items: center;
    justify-content: space-between;
    color: white;
    margin-bottom: 40px;
    height: 90px;
    z-index: 1000;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.website-header img {
    width: 130px;
    height: auto;
    margin-top: 5px;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    position: relative;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation */
.nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.nav-item,
.nav-item-current {
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    transition: all 0.5s;
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-item-current {
    text-decoration: underline;
    text-decoration-color: #667eea;
    text-underline-offset: 10px;
    text-decoration-thickness: 2px;
}

.nav a:hover {
    transform: translateY(-2px) scale(1.05);
    color: #667eea;
}

#menu-toggle {
    display: none;
}

/* ========================================
   AVATAR & PROFILE SECTION
   ======================================== */

.avatar-img {
    width: 207px;
    height: 220px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin: 0;
    object-fit: cover;
}

/* ========================================
   SOCIAL LINKS
   ======================================== */

.social-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
    background: rgb(45, 55, 75);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.social-link.github:hover {
    background: black;
    border-color: black;
}

.social-link.linkedin:hover {
    background: #0077B5;
    border-color: #0077B5;
}

.social-link.dev:hover {
    background: black;
    border-color: black;
}

.social-link.email:hover {
    background: #ea4335;
    border-color: #ea4335;
}

/* ========================================
   BUTTONS
   ======================================== */

.button-container ul {
    list-style: none;
    padding: 0;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.button-container button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.button-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========================================
   CARDS SECTION
   ======================================== */

.cards-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
}

.card {
    background: linear-gradient(135deg, rgb(45, 55, 75), rgb(50, 60, 80));
    border-radius: 15px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 24px;
    color: white;
}

.card-icon.about {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.card-icon.skills {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.card-icon.hosting {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.card-icon.education {
    background: linear-gradient(135deg, #8ed1ff, #0984e3);
    color: white;
}

.card h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #f8f8f2;
    margin: 0;
}

.card p {
    line-height: 1.6;
    margin-bottom: 16px;
    color: rgba(248, 248, 242, 0.9);
}

.card p:last-child {
    margin-bottom: 0;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 24px 0 0 0;
}

.skills-list li {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #f8f8f2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   FOOTER
   ======================================== */

.legal-footer {
    padding: 30px;
    text-align: center;
    font-size: 12px;
}

/* ========================================
   RESPONSIVE DESIGN - DESKTOP FIRST
   ======================================== */

/* Large Tablets & Small Desktops (768px and up) */
@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Screens (500px and up) */
@media (min-width: 500px) {
    body {
        font-size: 16px;
    }

    .nav-item,
    .nav-item-current {
        font-size: 18px;
        padding: 16px 20px;
    }

    .card h2 {
        font-size: 24px;
    }

    .skills-list li {
        font-size: 14px;
    }
}

/* ========================================
   MOBILE BREAKPOINTS - LARGEST TO SMALLEST
   ======================================== */

/* Tablets & Large Mobile (768px and down) */
@media (max-width: 768px) {
    .avatar-img {
        width: 175px;
        height: 180px;
    }

    .main-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
        margin-bottom: 24px;
    }

    .right-side {
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .website-header img {
        width: 95px;
    }

    .social-links {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
        margin: 0;
    }

    .social-link:hover {
        transform: translateY(-2px);
    }

    .button-container {
        display: none;
    }

    .nav-item,
    .nav-item-current {
        font-size: 16px;
        padding: 10px 14px;
    }
}

/* Mobile Navigation (668px and down) */
@media (max-width: 668px) {
    .nav-item:hover,
    .nav-item-current:hover {
        color: #667eea;
        transform: none;
    }
}

/* Standard Mobile (600px and down) */
@media (max-width: 600px) {

    /* Hide the checkbox completely */
    #menu-toggle {
        display: none;
        position: absolute;
        opacity: 0;
        visibility: hidden;
        width: 0;
        height: 0;
    }

    /* Hamburger base */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 28px;
        height: 24px;
        cursor: pointer;
        z-index: 1100;
        position: relative;
    }

    .hamburger span {
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }

    /* Hamburger animation when checked */
    #menu-toggle:checked + .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    #menu-toggle:checked + .hamburger span:nth-child(2) {
        opacity: 0;
    }
    #menu-toggle:checked + .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Menu closed state - height-based approach */
    .nav {
        position: absolute;
        top: 90px;
        right: 0;
        background: rgb(40, 45, 60);
        max-width: 300px;
        border-radius: 0 0 10px 10px;
        flex-direction: column;
        text-align: center;
        overflow: hidden;

        /* Key change: Use height instead of max-height */
        height: 0;
        /* Keep padding consistent - don't animate it */
        padding: 0 10px;

        /* Single clean transition - only animate height */
        transition: height 0.3s ease-in-out;
    }

    /* Menu open when checkbox checked - set exact height */
    #menu-toggle:checked ~ .nav {
        /* Adjust this height to match your content needs */
        /* Try different values: 250px (shorter) or 400px (taller) */
        height: 185px; /* Reduced from 300px - adjust as needed */
        /* Don't change padding during animation */
        padding: 0 10px;
    }

    /* Simplified menu items - no individual animations needed */
    .nav li {
        /* Remove transform animations that were causing timing issues */
        list-style: none;
    }

    .nav-item,
    .nav-item-current {
        display: block;
        padding: 15px 20px;
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: background-color 0.3s ease;
        margin: 2px 0; /* Add some vertical spacing */
    }

    /* Add some top/bottom spacing to the first/last items */
    .nav li:first-child .nav-item,
    .nav li:first-child .nav-item-current {
        margin-top: 15px;
    }

    .nav li:last-child .nav-item,
    .nav li:last-child .nav-item-current {
        margin-bottom: 15px;
        border-bottom: none;
    }

    .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-item-current {
        text-decoration: none;
        font-weight: 700;
    }

    .avatar-img {
        width: 155px;
        height: 160px;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .card {
        padding: 24px;
    }

    .card h2 {
        font-size: 20px;
    }

    /* Override the duplicate nav-item styles */
    .nav .nav-item,
    .nav .nav-item-current {
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* Small Mobile (500px and down) */
@media (max-width: 500px) {
    .avatar-img {
        width: 145px;
        height: 150px;
    }

    .website-header img {
        width: 80px;
        margin-top: 2px;
    }

    .nav-item,
    .nav-item-current {
        padding: 10px 10px;
        line-height: 1.2;
    }

    .nav-item-current {
        text-underline-offset: 8px;
    }

    .legal-footer {
        font-size: 10px;
    }
}