/* Windows 95 Retro Styling - unpkg.ai Edition */
@import url('data:font/truetype;charset=utf-8;base64,AAEAAAARAQAABAAARkZUTQAAABwAAAAcTlRNUAAAAPQAAAD0T1MvMgAAAPQAAABgY21hcAAAA1wAAAFoY3Z0IAAAAxgAAAAgZnBnbQAAAwAAAAASZ2x5ZgAAAwAAAAASaGVhZAAAAkAAAAA2aGhlYQAAApgAAAAkaG10eAAAArwAAAAQbG9jYQAAAtAAAAAMbWF4cAAAA+QAAABQPGV0dQAAAAAAAAByUE9TVAAAAwAAAAATdmlkAAAAAAAAAA==');

* {
    box-sizing: border-box;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
.win95-input,
.win95-textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #008080, #004040);
    cursor: default;
}

#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#desktop-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 64px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}

.desktop-icon:hover {
    background: rgba(0, 0, 128, 0.3);
}

.desktop-icon.celebration-icon {
    animation: celebration-pulse 2s infinite;
}

@keyframes celebration-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.icon-image {
    font-size: 32px;
    margin-bottom: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
}

.icon-image img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.icon-label {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 1px #000;
    word-wrap: break-word;
}

/* Windows */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.window-title-bar {
    background: linear-gradient(to right, #000080, #000040);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

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

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

.window-control {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.window-control:hover {
    background: #d4d0c8;
}

.window-control:active {
    border: 1px inset #c0c0c0;
}

.window-content {
    padding: 4px;
}

.window-content canvas {
    display: block;
    border: 1px inset #c0c0c0;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    z-index: 10;
}

.resize-handle.resize-n {
    top: -3px;
    left: 8px;
    right: 8px;
    height: 6px;
    cursor: n-resize;
}

.resize-handle.resize-s {
    bottom: -3px;
    left: 8px;
    right: 8px;
    height: 6px;
    cursor: s-resize;
}

.resize-handle.resize-e {
    top: 8px;
    right: -3px;
    bottom: 8px;
    width: 6px;
    cursor: e-resize;
}

.resize-handle.resize-w {
    top: 8px;
    left: -3px;
    bottom: 8px;
    width: 6px;
    cursor: w-resize;
}

.resize-handle.resize-ne {
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    cursor: ne-resize;
}

.resize-handle.resize-nw {
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    cursor: nw-resize;
}

.resize-handle.resize-se {
    bottom: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    cursor: se-resize;
}

.resize-handle.resize-sw {
    bottom: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    cursor: sw-resize;
}

.window:hover .resize-handle {
    background: rgba(0, 0, 128, 0.1);
}

.window.resizing .resize-handle {
    background: rgba(0, 0, 128, 0.3);
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #c0c0c0;
    border-top: 1px solid #white;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 1000;
}

#start-button {
    height: 32px;
    padding: 4px 8px;
    margin-right: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.start-flag {
    display: flex;
    align-items: center;
}

.start-flag-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

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

.taskbar-button {
    height: 32px;
    padding: 4px 8px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#system-tray {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px inset #c0c0c0;
    background: #c0c0c0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.unpkg-badge {
    background: linear-gradient(to bottom, #9333EA, #7E22CE);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 10px;
    animation: badge-glow 2s infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(147, 51, 234, 0.5); }
    50% { box-shadow: 0 0 8px rgba(147, 51, 234, 0.8); }
}

.package-counter {
    font-weight: bold;
    color: #10B981;
}

#clock {
    font-family: 'MS Sans Serif', monospace;
    font-size: 11px;
}

/* Windows 95 Button Style */
.win95-button {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    color: black;
    padding: 4px 12px;
    cursor: pointer;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

.win95-button:hover {
    background: #d4d0c8;
}

.win95-button:active {
    border: 2px inset #c0c0c0;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 40px;
    left: 2px;
    width: 200px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.start-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 1px solid #808080;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-menu-item:hover {
    background: #000080;
    color: white;
}

.menu-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.start-menu-separator {
    height: 1px;
    background: #808080;
    margin: 2px 8px;
}

/* Programs Menu */
.programs-submenu {
    position: fixed;
    width: 250px;
    max-height: 500px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    overflow-y: auto;
    max-width: calc(100vw - 10px);
}

.submenu-item {
    padding: 6px 16px;
    cursor: pointer;
    font-size: 11px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-item:hover {
    background: #0080ff;
    color: white;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.submenu-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.submenu-arrow {
    font-size: 10px;
    color: #808080;
}

.submenu-item.has-submenu:hover .submenu-arrow {
    color: white;
}

.submenu-separator {
    height: 1px;
    background: #808080;
    margin: 2px 8px;
}

.submenu-custom-app {
    background: #ffffe0;
    font-weight: bold;
    color: #000080;
    border-top: 2px solid #808080;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submenu-custom-app:hover {
    background: #ffff80;
    color: #000080;
}

.category-submenu {
    width: 220px;
    max-width: calc(100vw - 10px);
}

/* Modal Dialogs */
#modal-overlay, #settings-modal, #unpkg-explorer-modal, #package-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.win95-dialog {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.win95-dialog.large-dialog {
    min-width: 600px;
    max-width: 800px;
}

.dialog-title-bar {
    background: linear-gradient(to right, #000080, #000040);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.dialog-close {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dialog-content {
    padding: 16px;
}

.dialog-content p {
    margin: 0 0 12px 0;
}

.win95-input {
    width: 100%;
    padding: 4px;
    border: 2px inset #c0c0c0;
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    margin-bottom: 16px;
}

.win95-textarea {
    width: 100%;
    padding: 4px;
    border: 2px inset #c0c0c0;
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    margin-bottom: 16px;
    resize: vertical;
    min-height: 80px;
}

.help-text {
    background: #ffffcc;
    border: 1px solid #e6e600;
    padding: 8px;
    margin: 8px 0;
    font-size: 10px;
}

.help-text p {
    margin: 0;
}

.help-text code {
    background: #f0f0f0;
    padding: 1px 3px;
    font-family: 'Courier New', monospace;
    border: 1px inset #c0c0c0;
}

.unpkg-info {
    background: linear-gradient(to right, #f0e6ff, #e6d9ff);
    border: 2px solid #9333EA;
    padding: 12px;
    margin: 12px 0;
    border-radius: 4px;
}

.unpkg-info p {
    margin: 0 0 8px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.checkbox-label input[type="checkbox"] {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.dialog-buttons {
    text-align: right;
}

.dialog-buttons .win95-button {
    margin-left: 8px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    color: #000080;
}

/* unpkg.ai Explorer Styles */
.unpkg-hero {
    background: linear-gradient(to right, #9333EA, #7E22CE);
    color: white;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
}

.unpkg-hero h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.unpkg-hero p {
    margin: 0;
    font-size: 12px;
}

.package-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.package-search input {
    flex: 1;
}

.package-suggestions {
    margin-bottom: 16px;
}

.suggestion-category {
    margin-bottom: 16px;
}

.suggestion-category h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #000080;
}

.package-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.package-pill {
    background: #e0e0e0;
    border: 1px outset #c0c0c0;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
}

.package-pill:hover {
    background: #d0d0d0;
}

.package-details {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 12px;
    margin-bottom: 16px;
}

.package-details h3 {
    margin: 0 0 12px 0;
    color: #000080;
}

.import-url-display {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.import-url-display label {
    font-weight: bold;
    margin-bottom: 4px;
}

.import-url-display input {
    flex: 1;
    margin: 0;
}

/* Package Manager Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 12px;
    text-align: center;
}

.stat-card.highlight {
    background: linear-gradient(to bottom, #e6ffe6, #ccffcc);
    border-color: #10B981;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 4px;
}

.stat-card.highlight .stat-value {
    color: #10B981;
}

.stat-label {
    font-size: 10px;
    color: #666;
}

.module-list {
    background: white;
    border: 2px inset #c0c0c0;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    color: #999;
    text-align: center;
    font-style: italic;
}

.module-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.module-item:last-child {
    border-bottom: none;
}

.module-name {
    font-weight: bold;
}

.module-source {
    color: #9333EA;
    font-size: 10px;
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: linear-gradient(to bottom, #ffd700, #ffed4e);
    border: 2px outset #ffd700;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    padding: 12px;
    min-width: 300px;
    z-index: 3000;
    animation: achievement-slide-in 0.5s ease-out;
}

@keyframes achievement-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-content {
    display: flex;
    gap: 12px;
    align-items: center;
}

.achievement-icon {
    font-size: 32px;
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    font-weight: bold;
    font-size: 12px;
    color: #000080;
    margin-bottom: 4px;
}

.achievement-description {
    font-size: 10px;
    color: #333;
}

/* Utility classes */
.hidden {
    display: none !important;
}

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

::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4d0c8;
}

::-webkit-scrollbar-corner {
    background: #c0c0c0;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 45px;
    right: 10px;
    background: rgba(192, 192, 192, 0.9);
    padding: 4px 8px;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    z-index: 999;
    display: flex;
    gap: 4px;
}

.footer a {
    color: #000080;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-separator {
    color: #808080;
}