/* Desktop/macOS UI */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.menu-bar .apple-logo {
    font-size: 16px;
    margin-right: 20px;
    cursor: default;
}

.menu-bar .menu-item {
    margin-right: 18px;
    font-size: 13px;
    color: var(--text-primary);
    user-select: none;
}

.menu-bar .menu-item:hover {
    text-decoration: underline;
}

.menu-bar .system-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.desktop-icons {
    position: fixed;
    top: 60px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 100;
}

.desktop-icon {
    position: relative;
    width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 6px;
    border-radius: 14px;
    transition: var(--transition);
}

.desktop-icon::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: radial-gradient(120% 120% at 30% 30%, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .35) 35%, rgba(255, 255, 255, .06) 100%), linear-gradient(145deg, #e9f3ff, #b8d7ff);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 22px rgba(0, 0, 0, 0.18);
}

.desktop-icon i {
    position: absolute;
    font-size: 28px;
    color: #0A84FF;
    text-shadow: 0 4px 12px rgba(10, 132, 255, 0.55);
    left: 50%;
    top: calc(10px + (72px - 28px)/2);
    transform: translateX(-50%);
}

.desktop-icon span {
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    margin-top: 4px;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.desktop-icon.selected {
    outline: 2px solid rgba(10, 132, 255, 0.45);
    outline-offset: 4px;
    background: rgba(10, 132, 255, 0.10);
}

/* Windows */
.window {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    box-shadow: var(--shadow);
    min-width: 300px;
    min-height: 200px;
    border: 1px solid var(--glass-border);
    display: none;
    transition: var(--transition);
    contain: paint;
    overflow: hidden;
}

.window.active {
    display: block;
}

.window.minimized {
    transform: scale(0.1);
    opacity: 0;
    pointer-events: none;
}

.window.maximized {
    top: 28px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 28px - 80px) !important;
    border-radius: 0 !important;
}

/* Window resizer handle */
.window-resizer {
    position: absolute;
    width: 16px;
    height: 16px;
    right: 4px;
    bottom: 4px;
    cursor: se-resize;
    border-radius: 4px;
    opacity: 0.7;
}

.window-resizer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0) 0 50%, rgba(0, 0, 0, .18) 50% 100%),
        linear-gradient(135deg, rgba(0, 0, 0, 0) calc(100% - 8px), rgba(255, 255, 255, .8) calc(100% - 8px) 100%);
    border-radius: 4px;
}

.window.maximized .window-resizer {
    display: none;
}

.window-header {
    background: rgba(255, 255, 255, 0.10);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    cursor: move;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.window-control:hover {
    transform: scale(1.2);
}

.window-control.close {
    background: #FF5F57;
}

.window-control.minimize {
    background: #FFBD2E;
}

.window-control.maximize {
    background: #28CA42;
}

.window-title {
    margin-left: 15px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.window-content {
    padding: 20px;
    height: calc(100% - 40px);
    overflow: auto;
}

.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

/* Terminal */
#terminal-window {
    top: 150px;
    left: 100px;
    width: 720px;
    height: 460px;
    background: rgba(5, 5, 7, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.terminal-content {
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 14px;
    color: #c9f4c9;
    height: calc(100% - 40px);
    overflow: auto;
}

.terminal-line {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-prompt {
    color: #7dd87d;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #c9f4c9;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex: 1;
    caret-color: #34C759;
}

.terminal-output {
    color: #f2f2f2;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.terminal-error {
    color: #ff6b6b;
    margin-bottom: 10px;
}

.terminal-success {
    color: #51cf66;
    margin-bottom: 10px;
}

/* Dock with improved spacing and cursor tracker */
.dock {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 12px 16px;
    display: flex;
    gap: 18px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    z-index: 1000;
}

.dock-container {
    display: flex;
    align-items: flex-end;
    height: 66px;
    position: relative;
    gap: 14px;
}

.dock-cursor {
    position: absolute;
    bottom: 0;
    height: 3px;
    width: 36px;
    background: linear-gradient(90deg, rgba(10, 132, 255, .0), #0A84FF, rgba(10, 132, 255, .0));
    border-radius: 999px;
    transform: translateX(-50%);
    left: 50%;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.dock-item {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    background: radial-gradient(120% 120% at 30% 30%, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .35) 35%, rgba(255, 255, 255, .06) 100%), linear-gradient(145deg, #e9f3ff, #b8d7ff);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 22px rgba(0, 0, 0, 0.18);
    transform-origin: bottom center;
    transition: transform 120ms ease-out, box-shadow .2s ease;
    will-change: transform;
}

.dock-item:hover {
    transform: translateY(-10px) scale(1.12);
}

.dock-item.active {
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.35), 0 18px 26px rgba(0, 0, 0, 0.22);
    border-color: rgba(10, 132, 255, 0.45);
}

.dock-item i {
    font-size: 22px;
    color: #0A84FF;
    text-shadow: 0 3px 8px rgba(10, 132, 255, 0.35);
}

.dock-item.active i {
    color: #0A84FF;
}

.dock-tooltip {
    position: absolute;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

/* Section defaults */
#about-window {
    top: 100px;
    left: 100px;
    width: 600px;
    height: 500px;
}

#skills-window {
    top: 150px;
    left: 750px;
    width: 520px;
    height: 420px;
}

#projects-window {
    top: 200px;
    left: 200px;
    width: 820px;
    height: 520px;
}

#contact-window {
    top: 250px;
    left: 400px;
    width: 520px;
    height: 460px;
}

#resume-window {
    top: 300px;
    left: 300px;
    width: 620px;
    height: 420px;
}

/* Content components (shared on desktop) */
.about-text h3,
.resume-content h3,
.skill-icon {
    background: var(--primary-color);
    /* Solid fallback color */
    color: var(--primary-color);
    /* Ensure text is visible in light theme */
}

/* Apply gradient text only when supported to avoid transparent text in some browsers */
@supports (-webkit-background-clip: text) {

    .about-text h3,
    .resume-content h3 {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 120px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.06);
}

.project-content {
    padding: 14px;
}

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

.project-tag {
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    color: var(--text-secondary);
}

/* About section */
.about-content {
    display: flex;
    align-items: center;
    gap: 18px;
}

.about-image img {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.about-text p {
    color: var(--text-primary);
    /* Increase paragraph contrast */
    line-height: 1.6;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.skill-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow);
}

.skill-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #e9f3ff, #b8d7ff);
    color: #0A84FF;
    margin-bottom: 10px;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* Projects tabs */
.project-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Resume */
.resume-content {
    text-align: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
}

/* Contact */
.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-form .form-group:nth-child(3),
.contact-form .form-group:nth-child(4) {
    grid-column: 1 / -1;
}

.form-control,
textarea.form-control {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    outline: none;
}

.form-control:focus,
textarea.form-control:focus {
    border-color: rgba(10, 132, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.btn-submit {
    margin-top: 6px;
    justify-self: start;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
}
.desktop-icons-2 {
    left: 130px;
}