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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Digital Clock - iOS Glass Style */
.digital-clock {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    text-align: center;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#time {
    display: block;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

#date {
    display: block;
    font-size: 15px;
    margin-top: 5px;
    opacity: 0.8;
}

/* Main Background */
.main-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.main-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop Selection Box */
.desktop-selection {
    position: fixed;
    background: transparent; /* No fill */
    border: 1px dashed #662d91; /* Dashed purple stroke */
    border-radius: 10px; /* Rounded edges */
    z-index: 50; /* Above the background, but below your windows (100) */
    display: none; /* Hidden until you click and drag */
    pointer-events: none; /* Ensures the box doesn't block your mouse */
}

/* Dock Bar */
.dock-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 10px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 10000;
}

.dock-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.dock-item:hover {
    transform: translateY(-15px) scale(1.5);
}

.dock-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: block;
}

.tooltip {
    /* 1. Placement & Animation  */
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;

    /* 2. Glass Style */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    /* 3. Text & Sizing */
    color: #ffffff; 
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 11px;
}

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

/* ─── App Windows - FIXED positioning and z-index ─────────────────────────── */
.app-window {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    min-height: 300px;
    width: 600px;
    height: 500px;
    display: none;
    overflow: hidden;
    animation: windowOpen 0.3s ease;
    z-index: 100; /* Base z-index */
    /* Remove default positions - will be set by JS */
}

/* Active window gets visual emphasis */
.app-window.active,
.project-detail-window.active {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

/* Project windows */
.project-detail-window {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 500px;
    min-height: 400px;
    width: 700px;
    height: 600px;
    overflow: hidden;
    animation: windowOpen 0.3s ease;
    z-index: 100; /* Base z-index */
    display: none; /* Start hidden */
}

/* Window header - ensure proper cursor and prevent text selection */
.window-header {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

/* NEW: Lightens the title text and gives it a native OS weight */
.window-header span {
    color: #555555; 
    font-weight: 500; 
}

.window-header:active {
    cursor: grabbing;
}

/* Window controls - ensure they're clickable */
.window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.close-btn,
.minimize-btn {
    background: #ffbd2e;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    padding-bottom: 3px;
}

.close-btn {
    background: #383838;
    color: white;
}

.close-btn:hover {
    background: #383838;
    filter: brightness(0.85);
}

.minimize-btn {
    background: #a577e0;
    color: white;
    padding-bottom: 3px;
}

.minimize-btn:hover {
    background: #a577e0;
    filter: brightness(0.85);
}

/* Resize Handle - ensure it's always accessible */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.1) 50%);
    z-index: 5;
}

.resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.2) 50%);
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes windowOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes windowClose {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

.window-closing {
    animation: windowClose 0.3s ease forwards;
    pointer-events: none;
}

@keyframes windowMinimize {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--min-x), var(--min-y)) scale(0.1);
        opacity: 0;
    }
}

.window-minimizing {
    animation: windowMinimize 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
    transform-origin: center center;
    pointer-events: none;
}

/* ─── Window content - proper scrolling ─────────────────────────────────────── */
.window-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 45px);
    width: 100%;
}
.window-header {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    cursor: move;
}

.close-btn {
    background: #383838;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.close-btn:hover {
    background: #383838;
    filter: brightness(0.85);
}

.minimize-btn {
    background: #a577e0;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    margin-right: 8px;
    padding-bottom: 3px;
}

.minimize-btn:hover {
    background: #a577e0;
    filter: brightness(0.85);
}

.window-controls {
    display: flex;
    align-items: center;
}

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

/* Project Detail Styles */
.project-detail {
    max-width: 100%;
}

.project-detail h1 {
    color: #444444; /* Softer dark gray for the title */
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
}

/* NEW: Styles the description paragraphs to be softer and easier to read */
.project-detail .description p {
    color: #555555; 
    line-height: 1.6; /* Adds breathing room between lines of text */
    font-size: 16px;
    margin-bottom: 15px;
}

/* ─── Project Images (Natural Size, No Cropping) ─────────────────────────── */
.project-detail img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* About Window */
#about-window {
    height: 700px;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: block;
    margin-top: 30px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.about-text {
    text-align: left;
}

.about-text h2 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.about-text p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    padding-left: 20px;
    padding-right: 20px;
}

/* ─── Projects Grid (Dynamic Scaling) ─────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 10px;
    width: 100%;
    height: auto;
}

.project-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
    background: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: #333;
    gap: 8px;
    overflow: hidden;
}

.project-item:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

/* Image fills proportionally inside the square */
.project-item img {
    width: 60%;
    height: auto;
    max-height: 60%;
    object-fit: contain;
    border-radius: 8px;
    pointer-events: none;
    flex-shrink: 1;
}

/* Label scales with the item */
.project-item span {
    font-size: 11px; /* Change this number right here! */
    color: #444;
    word-break: break-word;
    line-height: 1.2;
    flex-shrink: 0;
}

/* ─── Make window-content fill properly for resize ─────────────────────────── */
.app-window .window-content,
.project-detail-window .window-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 45px);
    width: 100%;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* Contact Form */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form input,
#contact-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit; /* This forces the text area to match the other inputs */
}

#contact-form textarea {
    resize: none; /* This removes the draggable corner */
    overflow-y: hidden; /* Prevents scrollbars from appearing while typing */
    min-height: 120px; /* Sets a good starting height */
}

#contact-form button {
    background: #007AFF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#contact-form button:hover {
    background: #0051D5;
}

/* Database Window */
#messages-list {
    margin-top: 15px;
}

.message-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.message-item strong {
    color: #333;
}

.message-item p {
    color: #666;
    margin-top: 5px;
}

/* Socials Window */
a.project-item {
    text-decoration: none;
}

/* Enhanced Music Player */
.now-playing {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

#current-album-art {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #ddd;
}

.song-info {
    flex: 1;
}

.song-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.time-info {
    color: #666;
    font-size: 14px;
}

.progress-container {
    margin: 20px 0;
}

#progress-bar {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #007AFF;
    border-radius: 50%;
    cursor: pointer;
}

#progress-bar::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #007AFF;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.music-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.music-controls button {
    color: #c17fdd;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    min-width: 50px;
}

.music-controls button:hover {
    background: #555;
    transform: scale(1.05);
}

.music-controls button:active {
    transform: scale(0.95);
}

.music-controls button.active {
    background: #c17fdd;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.music-item {
    cursor: pointer;
    transition: transform 0.3s ease;
    text-align: center;
}

.music-item:hover {
    transform: scale(1.05);
}

.music-item.active {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.5));
}

.music-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.music-item p {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}


/* Force window buttons to stay close together */
.window-controls {
    gap: 6px !important;
}

.window-controls .minimize-btn {
    margin-right: 0 !important;
}

/* Perfectly center the - and x inside the buttons */
.window-controls .close-btn,
.window-controls .minimize-btn {
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    line-height: 1 !important;
}

/* Nudge the minus sign up visually */
.window-controls .minimize-btn {
    padding-bottom: 3px !important;
}

/* Make the dock and its icons larger */
.dock-bar {
    padding: 5px !important; /* Adds more space inside the dock */
    gap: 15px !important; /* Adds more space between the icons */
}

.dock-item img {
    width: 65px !important; /* Increased from 50px */
    height: 65px !important; /* Increased from 50px */
}

/* Move the tooltips up so they clear the bigger icons */
.tooltip {
    bottom: 68px !important; 
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 40px;
}

#volume-bar {
    width: 60%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

#volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #007AFF;
    border-radius: 50%;
    cursor: pointer;
}

#volume-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #007AFF;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ─── Expand Button & Window State ─── */
.expand-btn {
    background: #662d91;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.expand-btn:hover {
    background: #662d91;
    filter: brightness(0.85);
}

.window-expanded {
    top: 100px !important;
    left: 15px !important;
    width: calc(100vw - 30px) !important;
    height: calc(100vh - 225px) !important;
    transform: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ─── Mobile Responsiveness ─────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    /* 1. Fix the Dock */
    .dock-bar {
        width: auto; /* Let it shrink to fit the icons */
        max-width: 95%; 
        padding: 8px 12px !important; /* Tighter padding */
        gap: 10px !important; 
        border-radius: 20px;
        bottom: 15px;
    }
    
    .dock-item img {
        width: 35px !important; /* Shrunk the icons even more */
        height: 35px !important;
        border-radius: 8px;
    }

    /* Hide tooltips on mobile since there is no 'hover' on touchscreens */
    .tooltip {
        display: none !important; 
    }

    /* 2. Fix the Clock */
    .digital-clock {
        width: auto; /* Stops it from stretching wide */
        padding: 8px 20px;
        top: 20px;
        border-radius: 20px;
    }

    #time {
        font-size: 18px; /* Smaller time */
        letter-spacing: 1px;
    }

    #date {
        font-size: 11px; /* Smaller date */
        margin-top: 2px;
    }

    /* 3. Fix the App Windows */
    .app-window, 
    .project-detail-window {
        width: 95% !important;
        min-width: unset !important;
        height: 75vh !important; 
        min-height: 400px !important;
        left: 2.5% !important; 
        top: 12% !important;
    }

    /* Ensure project grids stack nicely on very small screens */
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
}

/* ========================================= */
/* DARK MODE OVERRIDES                       */
/* ========================================= */

/* Window Backgrounds */
.app-window, 
.project-detail-window {
    background: rgba(30, 30, 30, 0.85) !important;
    color: #ffffff;
}

/* Window Headers */
.window-header {
    background: linear-gradient(to bottom, #3a3a3a, #2a2a2a) !important;
    border-bottom: 1px solid #1a1a1a !important;
}
.window-header span {
    color: #e0e0e0 !important; 
}

/* Text Colors inside Windows */
.about-text h2, 
.project-detail h1,
.song-info h3 {
    color: #ffffff !important;
}

.about-text p, 
.project-detail .description p,
.time-info,
.music-item p {
    color: #cccccc !important;
}

/* Project & Social Grid Items */
.project-item {
    background: rgba(255, 255, 255, 0.08) !important;
}
.project-item span {
    color: #e0e0e0 !important;
}
.project-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Contact Form */
#contact-form input,
#contact-form textarea {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid #444 !important;
}
#contact-form input::placeholder,
#contact-form textarea::placeholder {
    color: #888888;
}

/* Music Player */
.now-playing {
    background: rgba(255, 255, 255, 0.08) !important;
}
#current-album-art {
    background: #444 !important;
}

/* Make the close button visible on dark headers */
.close-btn {
    background: #666666 !important;
}



