/* Base and Body Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    background-image: url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?q=80&w=2071&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    color: #e5e5e5;
    height: 100vh;
    overflow: hidden;
}
body.dragging, body.dragging * {
    user-select: none;
}

/* Desktop and Menu Bar */
#desktop {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 28px;
}
#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background-color: rgba(25, 25, 25, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.menu-bar-section { display: flex; align-items: center; gap: 1.5rem; }
.menu-bar-item { cursor: pointer; font-weight: 500; }
.menu-bar-item:hover { opacity: 0.8; }

/* Window Styling */
.window {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    background-color: rgba(25, 25, 25, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    resize: both;
    overflow: hidden;
    min-width: 350px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.window.minimized { opacity: 0; transform: scale(0.8); pointer-events: none; }
.window.active { display: flex; flex-direction: column; }
.window.maximized {
    width: 90vw;
    height: 85vh;
    top: 5vh !important;
    left: 5vw !important;
    resize: none;
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease;
}

/* Title Bar */
.title-bar {
    height: 36px;
    background-color: rgba(45, 45, 45, 0.7);
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    cursor: grab;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.title-bar:active { cursor: grabbing; }
.title-bar-buttons { display: flex; gap: 0.5rem; }
.title-bar-button { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); cursor: pointer; }
.close { background-color: #ff5f57; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #28c940; }
.window-title { font-weight: 600; color: #f5f5f5; margin: 0 auto; }

/* Window Body */
.window-body { flex-grow: 1; position: relative; overflow: hidden; }

/* Dock */
#dock {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    height: 70px;
    background-color: rgba(25, 25, 25, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 0.75rem;
    z-index: 9999;
}
.dock-item {
    width: 52px;
    height: 52px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), margin 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    /* Reset button styles */
    background: none;
    border: none;
    padding: 0;
}
#dock:hover .dock-item:hover { 
    transform: scale(1.5) translateY(-10px); 
    margin: 0 0.5rem; 
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.3);
}
#dock:hover .dock-item:hover + .dock-item, .dock-item:has(+ .dock-item:hover) { 
    transform: scale(1.2) translateY(-5px); 
    margin: 0 0.25rem; 
}
.active-dot { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background-color: #fff; border-radius: 50%; display: none; }
.dock-item.app-open .active-dot { display: block; }
.dock-tooltip {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(25, 25, 25, 0.8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}
.dock-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border-width: 5px; border-style: solid; border-color: rgba(25, 25, 25, 0.8) transparent transparent transparent;
}
#dock:hover .dock-item:hover .dock-tooltip {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Project Window */
.projects-body { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; }
#project-list { width: 280px; flex-shrink: 0; border-right: 1px solid rgba(255,255,255,0.15); overflow-y: auto; padding: 0.5rem; background-color: rgba(0,0,0,0.1); }
#project-display { flex-grow: 1; overflow-y: auto; }
.project-list-item { cursor: pointer; padding: 0.75rem; border-radius: 0.5rem; width: 100%; text-align: left; background: none; border: none; }
.project-list-item.selected, .project-list-item:hover { background-color: rgba(255,255,255,0.1); }
.tech-tag { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 500; line-height: 1; }

/* README Content Styles */
.readme-content h1, .readme-content h2, .readme-content h3 { font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 0.5rem; margin-top: 1.5rem; margin-bottom: 1rem; }
.readme-content h1 { font-size: 1.75rem; }
.readme-content h2 { font-size: 1.25rem; }
.readme-content h3 { font-size: 1.1rem; }
.readme-content p, .readme-content ul, .readme-content ol { margin-bottom: 1rem; color: #ccc; line-height: 1.6; }
.readme-content a { color: #60a5fa; text-decoration: underline; }
.readme-content ul, .readme-content ol { list-style-position: inside; }
.readme-content ul { list-style-type: disc; }
.readme-content ol { list-style-type: decimal; }
.readme-content code { background-color: rgba(0,0,0,0.3); padding: 0.2em 0.4em; margin: 0; font-size: 85%; border-radius: 6px; }
.readme-content pre { background-color: rgba(0,0,0,0.3); padding: 1rem; border-radius: 6px; overflow-x: auto; }
.readme-content pre code { padding: 0; margin: 0; background: none; }

/* General Scrollable Window Body */
#about-syad .window-body, #contact .window-body { overflow-y: auto; }

/* About Window Tabs */
.about-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.about-tabs { display: flex; padding: 0.75rem 1rem 0; gap: 0.25rem; border-bottom: 1px solid rgba(255,255,255,0.15); background-color: rgba(45, 45, 45, 0.7); }
.about-tab { padding: 0.5rem 1rem; border-radius: 0.375rem 0.375rem 0 0; font-size: 0.875rem; font-weight: 500; cursor: pointer; color: #a0a0a0; border: 1px solid transparent; border-bottom: none; background: none; }
.about-tab.active { background-color: rgba(25, 25, 25, 0.75); color: #fff; border-color: rgba(255,255,255,0.15); }
.about-content { display: none; padding: 1.5rem; }
.about-content.active { display: block; }

/* AI Assistant Chat */
.chat-message.user { text-align: right; }
.chat-message.user p { background-color: #581c87; color: white; }
.chat-message.assistant p { background-color: rgba(55, 65, 81, 1); color: #e5e7eb; }
.chat-message p { max-width: 80%; padding: 0.75rem; border-radius: 0.75rem; display: inline-block; text-align: left; }
.prose-invert { --tw-prose-bullets: #9ca3af; }
#gemini-summary-content { word-wrap: break-word; overflow-wrap: break-word; }

/* Responsive Styles */
@media screen and (max-width: 768px) {
    body { height: 100%; overflow-y: auto; }
    #desktop { display: flex; flex-direction: column; min-height: calc(100vh - 56px); padding-top: 56px; padding-bottom: 70px; }
    #menu-bar { height: 56px; padding: 0 1rem; }
    .menu-bar-section #open-tabs { display: none; }
    .menu-bar-section .font-bold { font-size: 1.125rem; }
    #datetime { font-size: 0.75rem; }

    .window {
        position: relative;
        width: 100%;
        flex-grow: 1;
        height: auto;
        top: 0 !important;
        left: 0 !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
        resize: none;
        display: none;
    }
    .window.active { display: flex !important; }
    .window.maximized {
        width: 100%; height: auto; top: 0; left: 0;
    }
    .title-bar { display: none; }
     #dock {
        position: fixed; width: 100%; bottom: 0; left: 0; transform: none;
        border-radius: 0; border-left: none; border-right: none; border-bottom: none;
        justify-content: space-around; height: 70px;
    }
    .dock-item {
        transform: none !important; margin: 0 !important; box-shadow: none !important;
        width: 48px; height: 48px;
    }
    #dock:hover .dock-item:hover, 
    #dock:hover .dock-item:hover + .dock-item, 
    .dock-item:has(+ .dock-item:hover) {
        transform: none !important; margin: 0 !important;
    }
    .dock-tooltip { display: none; }
    .active-dot { bottom: 2px; }
    
    .projects-body { position: static; flex-direction: column; }
    #project-list { width: 100%; flex-shrink: 1; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.15); max-height: 40vh; }
    #project-display, .readme-content, #gemini-controls { padding: 1rem; }
}
