/* ========== Global Link Styles ========== */
a, a:visited {
    color: #90caf9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
a:hover, a:focus {
    color: #42a5f5;
    text-decoration: underline;
}

/* ========== Base Styles ========== */
body {
    margin: 4px 0 0 0;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #181c20;
    color: #e0e3e7;
    padding-top: 60px;
}
.section {
    padding: 60px 20px 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== Top Section ========== */
.top-section {
    background: url('../assets/top.jpg') center/cover no-repeat;
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}
.top-section h1 {
    font-size: 2.8rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}
.top-section h2 {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
}

/* ========== Top Section Text Box ========== */
.top-text-bg {
    background: rgba(255,255,255,0.514);
    color: #181c20;
    padding: 32px 36px 24px 36px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}
.top-text-bg h1, .top-text-bg h2 {
    color: #181c20;
    text-shadow: none;
}
@media (max-width: 700px) {
    .top-text-bg {
        padding: 18px 8px 12px 8px;
        max-width: 98vw;
    }
}

/* ========== Section Containers ========== */
.about-section, .contact-section, .qual-section, .exp-section, .portfolio-section, .skill-section {
    background: #23272b;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    margin-top: 30px;
    padding: 32px 20px;
}

/* ========== About Section ========== */
.about-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: -40px;
    padding: 40px 20px;
}
.about-text {
    flex: 2;
    min-width: 250px;
    margin-right: 30px;
}
.about-img {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: 320px;
    box-sizing: border-box;
}
.about-img img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ========== Contact Section ========== */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 40px;
    margin-top: 10px;
    justify-content: center;
    text-align: center;
}
.contact-icon {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: middle;
    filter: invert(70%) sepia(10%) saturate(300%) hue-rotate(180deg);
}

/* ========== Menu Bar ========== */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(24,28,32,0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 1000;
}
.menu-bar ul {
    display: flex;
    justify-content: center;
    margin: 4px;
    padding: 0;
    list-style: none;
}
.menu-bar li {
    margin: 0 18px;
}

/* ========== Tables ========== */
.exp-table-wrapper, .qual-table-wrapper, .skills-table-wrapper {
    overflow-x: auto;
}
.exp-table, .qual-table, .skills-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    color: inherit;
}
.exp-table th, .exp-table td,
.qual-table th, .qual-table td,
.skills-table th, .skills-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #77aa;
    text-align: left;
}
.exp-table th, .qual-table th, .skills-table th {
    background: #23272b;
    color: #90caf9;
    font-weight: 700;
}
.exp-link-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: invert(70%) sepia(10%) saturate(300%) hue-rotate(180deg);
}

/* ========== Portfolio Flex Layout ========== */
.portfolio-flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 16px;
    justify-content: flex-start;
}
.portfolio-flex-wrapper .portfolio-item {
    min-width: 350px;
    flex: 1 1 400px;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

/* ========== Tags ========== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 2px 2px 0;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 500;
    color: #fff;
}
.tag-type { background: #00bcd4; color: #fff; }
.tag-skill { background: #1976d2; }
.tag-prog { background: #e65100; }
.tag-soft { background: #388e3c; }
.tag-tool { background: #ff8f00; }
.tag-cloud { background: #7b1fa2; }

/* ========== Hamburger & Mobile Menu ========== */
.hamburger {
    display: none;
    position: fixed;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    z-index: 2001;
    background: none;
    border: none;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 3px;
    margin: 4px auto;
    background: #ffffffcc;
    border-radius: 2px;
    transition: 0.3s;
}
@media (max-width: 800px) {
    .hamburger {
        display: block;
    }
}
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background: #23272b;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 2000;
    padding: 60px 0 20px 0;
}
.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mobile-menu li {
    margin: 12px 0;
}

/* ========== Portfolio Hover Card ========== */
.portfolio-hover-card .portfolio-img-hover {
    position: relative;
    width: 100%;
    min-height: 220px;
    margin: 16px 0 8px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    background: #181c20;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portfolio-hover-card .portfolio-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: filter 0.3s;
}
.portfolio-hover-card .portfolio-hover-desc {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(25, 118, 210, 0.92); /* theme blue, semi-transparent */
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 1.08em;
    padding: 24px 16px;
    text-align: center;
    border-radius: 12px;
    pointer-events: none;
}
.portfolio-hover-card .portfolio-img-hover:hover .portfolio-hover-desc,
.portfolio-hover-card .portfolio-img-hover:focus-within .portfolio-hover-desc {
    opacity: 1;
    pointer-events: auto;
}
.portfolio-hover-card .portfolio-img-hover:hover .portfolio-img-thumb,
.portfolio-hover-card .portfolio-img-hover:focus-within .portfolio-img-thumb {
    filter: blur(2px) brightness(0.7);
}
@media (max-width: 700px) {
    .portfolio-hover-card .portfolio-img-hover {
        min-height: 140px;
    }
    .portfolio-hover-card .portfolio-hover-desc {
        font-size: 0.98em;
        padding: 12px 6px;
    }
}

/* ========== Portfolio Image Modal (Lightbox) ========== */
.portfolio-img-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(24,28,32,0.92);
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.portfolio-img-modal-content {
    margin: auto;
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.25);
    background: #23272b;
    object-fit: contain;
    transition: box-shadow 0.2s;
}
.portfolio-img-modal-close {
    position: absolute;
    top: 24px;
    right: 36px;
    color: #fff;
    font-size: 2.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 3010;
    text-shadow: 0 2px 8px #181c20;
    transition: color 0.2s;
}
.portfolio-img-modal-close:hover {
    color: #90caf9;
}
@media (max-width: 700px) {
    .portfolio-img-modal-content {
        max-width: 98vw;
        max-height: 60vh;
    }
    .portfolio-img-modal-close {
        top: 8px;
        right: 16px;
        font-size: 2.2rem;
    }
}

/* ========== Portfolio Image Box ========== */
.portfolio-img-hover {
    aspect-ratio: 16/10;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    background: #181c20;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.portfolio-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: filter 0.3s;
}
@media (max-width: 700px) {
    .portfolio-img-hover {
        aspect-ratio: 16/12;
    }
}

/* ========== Responsive ========== */
@media (max-width: 700px) {
    .about-section {
        flex-direction: column;
        text-align: center;
    }
    .about-text {
        margin-right: 0;
        margin-bottom: 20px;
    }
    .about-img {
        max-width: 100%;
        margin-bottom: 20px;
    }
    .menu-bar ul {
        flex-direction: column;
    }
    .menu-bar li {
        margin: 0 0 0 0;
    }
    .section {
        padding: 32px 4px 24px 4px;
    }
    .top-section h1 {
        font-size: 2rem;
    }
    .top-section h2 {
        font-size: 1.1rem;
    }
    .skills-table th, .skills-table td,
    .qual-table th, .qual-table td,
    .exp-table th, .exp-table td {
        padding: 8px 4px;
        font-size: 0.98em;
    }
    .skills-table, .qual-table, .exp-table {
        font-size: 0.98em;
        min-width: 400px;
    }
    .skills-table-wrapper, .qual-table-wrapper, .exp-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tag {
        font-size: 0.85em;
        padding: 2px 6px;
    }
    .qual-table th, .qual-table td {
        padding: 8px 4px;
        font-size: 0.98em;
    }
}
@media (max-width: 500px) {
    .top-section h1 {
        font-size: 1.3rem;
    }
    .top-section h2 {
        font-size: 0.9rem;
    }
    .tag {
        font-size: 0.7em;
        padding: 2px 4px;
    }
}
@media (max-width: 800px) {
    .menu-bar {
        display: none;
    }
    .hamburger {
        display: block;
    }
}
