/* ================================================
   MAV Portfolio
   ================================================ */

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "IBM Plex Sans" !important;
}

body {
    background: url('../images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    overflow: hidden;
}

/* Light Mode Default */
:root {
    --desktop-bg: transparent;
    --window-bg: #c0c0c0;
    --window-body-bg: #ffffff;
    --title-bar-bg: #000080;
    --title-bar-text: #ffffff;
    --text-color: #000000;
    --border-dark: #808080;
    --border-light: #ffffff;
    --border-darkest: #000000;
    --button-face: #c0c0c0;
    --button-shadow: #808080;
    --button-highlight: #ffffff;
    --link-color: #0000ff;
    --link-visited: #800080;
    --link-hover: #ff0000;
    --table-header: #000080;
    --table-header-text: #ffffff;
    --scrollbar-face: #c0c0c0;
    --header-bg: #f0f8ff;
    --header-border: #0000ff;
}

/* Dark Mode */
body.dark-mode {
    --desktop-bg: transparent;
    --window-bg: #808080;
    --window-body-bg: #c0c0c0;
    --title-bar-bg: #000000;
    --title-bar-text: #ffffff;
    --text-color: #000000;
    --border-dark: #404040;
    --border-light: #c0c0c0;
    --border-darkest: #000000;
    --button-face: #808080;
    --button-shadow: #404040;
    --button-highlight: #c0c0c0;
    --link-color: #0000ff;
    --link-visited: #800080;
    --link-hover: #ff0000;
    --table-header: #000000;
    --table-header-text: #ffffff;
    --scrollbar-face: #808080;
    --header-bg: #404040;
    --header-border: #0000ff;
}

/* Desktop */
.desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 28px);
    overflow: auto;
    background: var(--desktop-bg);
}

/* Desktop Icons */
.icon {
    width: 84px;
    height: 84px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
    position: relative;
    user-select: none;
    padding: 4px 2px;
    border-radius: 6px;
}

.icon img {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: block;
    pointer-events: none;
}

.icon span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.1;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.icon:hover {
    transform: scale(1.06);
    filter: brightness(1.05);
    background: rgba(255, 255, 255, 0.03);
}


/* Windows */
.window {
    position: absolute;
    background: var(--window-bg);
    border-top: 2px solid var(--border-light);
    border-left: 2px solid var(--border-light);
    border-right: 2px solid var(--border-darkest);
    border-bottom: 2px solid var(--border-darkest);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    min-height: 200px;
    z-index: 100;
    resize: both;
    overflow: visible;
}

.window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 28px) !important;
    resize: none;
}

.window.minimized {
    display: none !important;
}

/* Title Bar */
.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    padding: 2px 3px;
    background: var(--title-bar-bg);
    color: var(--title-bar-text);
    cursor: move;
    user-select: none;
}

.title-bar-text {
    font-weight: bold;
    font-size: 11px;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    background: var(--button-face);
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-darkest);
    border-bottom: 1px solid var(--border-darkest);
    font-size: 9px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-bar-controls button:hover {
    background: #e0e0e0;
}

.title-bar-controls button:active {
    border-top: 1px solid var(--border-darkest);
    border-left: 1px solid var(--border-darkest);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 1px 0 0 1px;
}

/* Window Body */
.window-body {
    padding: 8px;
    margin: auto;
    background: var(--window-body-bg);
    color: var(--text-color);
    border-top: 1px solid var(--border-dark);
    overflow: auto;
    max-height: calc(100% - 18px);
    font-size: 14px !important;
}

/* Projects Cards */
.projects-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.project-card {
    background: var(--window-body-bg);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    font-size: 13px;
}

.project-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.project-title {
    font-weight: 800;
    font-size: 15px;
}

.project-tech {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 45%;
}

.tech-tag {
    background: rgba(0, 0, 0, 0.04);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    white-space: nowrap;
}

.project-desc {
    flex: 1 1 auto;
    margin-bottom: 8px;
    line-height: 1.35;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.project-date {
    font-size: 12px;
    color: var(--border-dark);
}

/* Project Buttons */
.project-actions {
    display: flex;
    gap: 8px;
}

.btn-primary {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    background: var(--table-header);
    color: var(--table-header-text);
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-disabled {
    color: var(--border-dark);
    font-size: 13px;
}

.btn-toggle {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    background: var(--button-face);
    color: var(--text-color);
    border: 1px solid var(--border-dark);
    cursor: pointer;
}

.btn-toggle:hover {
    background: #e0e0e0;
}

/* Project Accordion */
.project-details {
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    overflow: hidden;
    background: var(--window-body-bg);
    margin-bottom: 8px;
}

.project-summary {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.project-body {
    padding: 8px 10px;
    border-top: 1px solid var(--border-light);
}

/* Projects Controls */
.projects-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.projects-controls input[type="search"] {
    flex: 1 1 220px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-dark);
    font-size: 13px;
    background: var(--window-body-bg);
    color: var(--text-color);
}

.projects-controls select {
    border-radius: 6px;
    border: 1px solid var(--border-dark);
    background: var(--button-face);
    font-size: 13px;
    color: var(--text-color);
}

.group-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
}

.projects-group {
    margin-bottom: 20px;
}

.group-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--table-header);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--table-header);
}

/* Experience Items */
.experience-item {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid var(--border-dark);
    background: #f0f0f0;
    border-radius: 4px;
}

.experience-item h3 {
    margin-bottom: 5px;
}

.experience-item ul {
    margin-left: 20px;
}

/* Skills Section - Enhanced */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.skill-card {
    background: var(--window-body-bg);
    border: 2px solid var(--border-dark);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.skill-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}

.skill-icon {
    width: 24px;
    height: 24px;
    font-size: 20px;
}

.skill-card-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--table-header);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    background: rgba(0, 0, 128, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 128, 0.15);
    white-space: nowrap;
    font-weight: 500;
}

body.dark-mode .skill-tag {
    background: rgba(192, 192, 192, 0.15);
    border: 1px solid rgba(192, 192, 192, 0.25);
}

/* Certifications Section - Enhanced */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.cert-card {
    background: var(--window-body-bg);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.cert-card:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.cert-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.cert-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--table-header) 0%, #000060 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.cert-content {
    flex: 1;
}

.cert-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.3;
}

.cert-issuer {
    font-size: 13px;
    color: var(--border-dark);
    margin-bottom: 3px;
}

.cert-date {
    font-size: 12px;
    color: var(--border-dark);
    font-style: italic;
}

.cert-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.cert-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--table-header);
    color: var(--table-header-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.cert-link:hover {
    background: #0000a0;
}

.cert-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ffd700;
    color: #000;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid #d4af37;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--border-dark);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--table-header);
}

.section-header-icon {
    font-size: 20px;
}

.section-header-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--table-header);
}

/* Profile Photo */
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Header */
header.window {
    position: relative;
    width: calc(100% - 16px);
    margin: 8px;
    background: var(--header-bg);
    border-bottom: 2px solid var(--header-border);
}

header .header-body {
    text-align: center;
    padding: 12px 8px;
}

header .header-body h1 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}

header .header-body p {
    font-size: 11px;
}

header .header-body h2 {
    font-size: 14px;
    margin: 10px 0 5px;
    color: #0000ff;
    border-bottom: 1px solid #0000ff;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: var(--button-face);
    border-top: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 2px;
    gap: 4px;
    z-index: 999;
}

#taskbar-buttons {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
}

#taskbar-buttons button {
    padding: 2px 8px;
    border-top: 2px solid var(--border-light);
    border-left: 2px solid var(--border-light);
    border-right: 2px solid var(--border-darkest);
    border-bottom: 2px solid var(--border-darkest);
    background: var(--button-face);
    font-size: 11px;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    min-width: 0;
}

#taskbar-buttons button:hover {
    background: #e0e0e0;
}

#taskbar-buttons button:active {
    border-top: 2px solid var(--border-darkest);
    border-left: 2px solid var(--border-darkest);
    border-right: 2px solid var(--border-light);
    border-bottom: 2px solid var(--border-light);
    padding: 3px 7px 1px 9px;
}

#taskbar-clock,
#taskbar-copyright {
    font-size: 11px;
    color: var(--text-color);
    padding: 0 8px;
}

/* Dark Mode Toggle */
#dark-mode-toggle {
    padding: 2px 6px;
    border: 2px solid var(--border-light);
    background: var(--button-face);
    cursor: pointer;
    font-size: 11px;
    height: 22px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background 0.1s;
}

#dark-mode-toggle:hover {
    background: #e0e0e0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: var(--window-body-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-face);
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-darkest);
    border-bottom: 1px solid var(--border-darkest);
}

/* Responsive: Tablet & Mobile */
@media screen and (max-width: 768px) {
    .desktop {
        padding: 12px;
        gap: 12px;
        min-height: calc(100vh-32px);
    }

    .icon {
        width: 70px;
    }

    .icon img {
        width: 42px;
        height: 42px;
    }

    .icon span {
        font-size: 10px;
        margin-top: 3px;
    }

    .window {
        min-width: 200px;
        max-width: calc(100vw-16px);
    }

    .window-body {
        padding: 6px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cert-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cert-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media screen and (max-width:480px) {
    .desktop {
        padding: 8px;
        gap: 10px;
        min-height: calc(100vh-28px)
    }

    .icon {
        width: 60px
    }

    .icon img {
        width: 36px;
        height: 36px
    }

    .icon span {
        font-size: 9px;
        margin-top: 2px
    }

    .window {
        min-width: 150px;
        max-width: calc(100vw-8px)
    }

    .window-body {
        padding: 5px;
        font-size: 10px;
        height: calc(100%-18px)
    }

    .skill-card,
    .cert-card {
        padding: 10px;
    }

    .skill-card-title {
        font-size: 13px;
    }

    .cert-name {
        font-size: 14px;
    }

    .cert-issuer,
    .cert-date {
        font-size: 12px;
    }
}

.source-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
}

.source-window {
    z-index: 100001 !important;
    min-width: 420px;
    max-width: calc(100% - 40px);
    border-radius: 4px;
    overflow: hidden;
}

.source-window .window-body {
    padding: 12px;
}

.source-window .title-bar-text {
    font-weight: 900;
    font-size: 12px;
}

.source-window .notice-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.source-window .notice-primary {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 6px;
    background: var(--table-header);
    color: var(--table-header-text);
    font-weight: 800;
    text-decoration: none;
}

.source-window .notice-neutral {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 6px;
    background: var(--button-face);
    color: var(--text-color);
    border: 1px solid var(--border-dark);
    cursor: pointer;
}

/* responsive */
@media (max-width: 520px) {
    .source-window {
        min-width: 320px;
        width: 92%;
    }
}