/* Ubuntu-inspired Shell Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fullscreen overlay animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fullscreen-overlay {
    animation: fadeIn 0.3s ease;
}

.fullscreen-close {
    animation: fadeIn 0.5s ease 0.2s both;
}

/* Restaurant menu specific animations */
.restaurant-menu-content h1 {
    animation: slideInDown 0.6s ease;
}

.restaurant-menu-content h2 {
    animation: slideInLeft 0.5s ease;
}

.restaurant-menu-content .menu-item {
    animation: fadeInUp 0.4s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Showcase icon - no animation */
.app-icon.showcase {
    /* animation removed */
}

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

/* Sistemica-inspired background with stars */
@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Constellation drift animation - optimized with will-change and GPU acceleration */
@keyframes constellationDrift {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    33% {
        transform: translate3d(30px, -20px, 0) rotate(120deg);
    }
    66% {
        transform: translate3d(-20px, 30px, 0) rotate(240deg);
    }
    100% {
        transform: translate3d(0, 0, 0) rotate(360deg);
    }
}

/* Reduce animation for performance */
@media (prefers-reduced-motion: reduce) {
    .constellation-group {
        animation: none !important;
    }
    .twinkle-star {
        animation: none !important;
    }
}

.desktop {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom right, #8B4513, #B8860B, #DAA520);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Star background layer */
.star-background {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
}

/* Generate stars dynamically with CSS */
.star-background::before,
.star-background::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #FFE4B5;
    border-radius: 50%;
    box-shadow: 
        100px 100px 0 #FFE4B5,
        200px 150px 0 #FFE4B5,
        300px 80px 0 #FFE4B5,
        450px 200px 0 #FFE4B5,
        600px 120px 0 #FFE4B5,
        750px 180px 0 #FFE4B5,
        900px 90px 0 #FFE4B5,
        1050px 250px 0 #FFE4B5,
        1200px 160px 0 #FFE4B5,
        150px 300px 0 #FFE4B5,
        350px 400px 0 #FFE4B5,
        550px 350px 0 #FFE4B5,
        750px 450px 0 #FFE4B5,
        950px 380px 0 #FFE4B5,
        1150px 420px 0 #FFE4B5,
        100px 500px 0 #FFE4B5,
        300px 600px 0 #FFE4B5,
        500px 550px 0 #FFE4B5,
        700px 650px 0 #FFE4B5,
        900px 580px 0 #FFE4B5,
        1100px 620px 0 #FFE4B5,
        1300px 520px 0 #FFE4B5,
        200px 700px 0 #FFE4B5,
        400px 750px 0 #FFE4B5,
        600px 680px 0 #FFE4B5,
        800px 720px 0 #FFE4B5,
        1000px 690px 0 #FFE4B5,
        1200px 730px 0 #FFE4B5;
    animation: twinkle 4s ease-in-out infinite;
}

.star-background::after {
    left: 50px;
    top: 50px;
    animation-delay: 2s;
}

/* Star constellations */
.star-constellations {
    position: absolute;
    inset: 0;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.3;
}

/* Film grain effect */
.film-grain {
    position: absolute;
    inset: 0;
    z-index: 30;
    opacity: 0.35;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    filter: contrast(180%) brightness(150%);
    background-size: 150px 150px;
}

/* Blur and glow overlay - highest z-index to smooth everything */
.blur-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.1);
    mix-blend-mode: overlay;
    pointer-events: none;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);
}

/* Animate constellation stars */
.twinkle-star {
    animation: twinkle 4s ease-in-out infinite;
}

/* sistemica branding watermark - removed, now part of bottom right logo */

/* Top Bar - full width */
.top-bar {
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 228, 181, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 14px;
    backdrop-filter: blur(20px);
    z-index: 1000;
    margin-left: 0;
    width: 100vw;
    border-bottom: 1px solid rgba(255, 228, 181, 0.1);
}

.top-bar-left {
    display: flex;
    align-items: center;
}


.top-bar-right {
    display: flex;
    align-items: center;
}

.system-indicators {
    display: flex;
    align-items: center;
    gap: 12px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.indicator:hover {
    background: rgba(255, 228, 181, 0.1);
}

.indicator svg {
    opacity: 0.9;
    fill: rgba(255, 228, 181, 0.8);
}

.battery-level {
    font-size: 12px;
    font-weight: 500;
}

.datetime {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.datetime:hover {
    background: rgba(255, 228, 181, 0.1);
}

.time {
    font-weight: 600;
    font-size: 13px;
}

.date {
    font-size: 11px;
    opacity: 0.8;
}

/* Desktop Content */
.desktop-content {
    flex: 1;
    position: relative;
    padding: 20px;
    margin-left: 0; /* Full width since top bar is full width */
}

/* Taskbar - macOS style, 85% height with 7.5% margins top/bottom */
.taskbar {
    width: 64px;
    height: 85vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    z-index: 1000;
    position: fixed;
    left: 12px;
    top: 7.5vh; /* 7.5% from top */
    border-radius: 16px;
    border: 1px solid rgba(255, 228, 181, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.taskbar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.app-launcher {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #DAA520, #FFE4B5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.3);
    margin-bottom: 12px; /* Space between launcher and other icons */
}

.app-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.4);
}

.app-launcher:active {
    transform: translateY(0);
}

.app-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.app-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 228, 181, 0.1);
}

.app-icon:hover {
    background: rgba(255, 228, 181, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 228, 181, 0.2);
    border-color: rgba(255, 228, 181, 0.3);
}

.app-icon:active {
    transform: translateY(0);
}

.app-icon svg {
    transition: transform 0.2s;
    color: rgba(255, 228, 181, 0.9);
}

.app-icon:hover svg {
    transform: scale(1.1);
    color: rgba(255, 228, 181, 1);
}

/* Presentation icon specific styling - muted for dark theme */
.app-icon.presentation {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(142, 68, 173, 0.3));
}

/* Shell icon specific styling - muted for dark theme */
.app-icon.shell {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.3), rgba(44, 62, 80, 0.3));
}

/* Notes icon specific styling - muted for dark theme */
.app-icon.notes {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.3), rgba(155, 89, 182, 0.3));
}

/* Files icon specific styling - muted for dark theme */
.app-icon.files {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.3), rgba(230, 126, 34, 0.3));
}

/* Browser icon specific styling - muted for dark theme */
.app-icon.browser {
    background: linear-gradient(135deg, rgba(3, 102, 214, 0.3), rgba(0, 81, 162, 0.3));
}

/* Showcase icon specific styling - muted for dark theme */
.app-icon.showcase {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.3), rgba(194, 24, 91, 0.3));
}

.taskbar-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.taskbar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.system-tray {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tray-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tray-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tray-icon svg {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tray-icon:hover svg {
    opacity: 1;
}

/* App tooltip */
.app-icon::before {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(60, 60, 60, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.app-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(4px);
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 228, 181, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 228, 181, 0.5);
}

/* Responsive design */
@media (max-width: 768px) {
    .taskbar {
        width: 56px;
    }
    
    .desktop-content {
        margin-left: 56px;
    }
    
    .app-icons {
        gap: 4px;
    }
    
    .app-icon {
        width: 32px;
        height: 32px;
    }
    
    .app-launcher {
        width: 32px;
        height: 32px;
    }
    
    .system-indicators {
        gap: 8px;
    }
    
    .datetime {
        font-size: 11px;
    }
}

/* Background - no animations */

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Particles removed - no floating animations */

/* Window Styling - adjusted for dark background */
.window {
    position: absolute;
    min-width: 600px;
    min-height: 500px;
    width: 900px;
    height: 750px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: auto;
    overflow: hidden;
    resize: none;
    border: 1px solid rgba(255, 228, 181, 0.1);
    top: 60px;
    left: 120px;
}

.window-header {
    height: 40px;
    background: rgba(240, 240, 240, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 16px;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.window-control:hover {
    opacity: 0.8;
}

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

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

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

.window-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: rgba(60, 60, 60, 0.8);
}

.window-spacer {
    width: 60px; /* Same width as controls to center title */
}

.window-content {
    height: calc(100% - 40px);
    overflow: hidden;
    position: relative;
}

/* Terminal Styling */
.terminal {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

.terminal-output {
    margin-bottom: 16px;
}

.terminal-line {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
}

.terminal-prompt {
    color: #4ec9b0;
    font-weight: 600;
    margin-right: 8px;
}

.terminal-command {
    color: #dcdcaa;
}

.terminal-text {
    color: #d4d4d4;
}

.terminal-ascii {
    font-family: Consolas, "Courier New", monospace !important;
    white-space: pre !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
}

/* AI Assistant Loading Animations */
.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8B4513;
    opacity: 0.4;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-left: 2px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.terminal-input-line {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 8px;
}

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

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #d4d4d4;
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

.resize-n {
    top: 0;
    left: 8px;
    right: 8px;
    height: 4px;
    cursor: n-resize;
}

.resize-e {
    top: 8px;
    right: 0;
    bottom: 8px;
    width: 4px;
    cursor: e-resize;
}

.resize-s {
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 4px;
    cursor: s-resize;
}

.resize-w {
    top: 8px;
    left: 0;
    bottom: 8px;
    width: 4px;
    cursor: w-resize;
}

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

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

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

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

/* Window animations */
.window.opening {
    animation: windowOpen 0.3s ease-out;
}

.window.closing {
    animation: windowClose 0.2s ease-in;
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes windowClose {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 228, 181, 0.1);
}

.lang-option {
    width: 32px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 228, 181, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.lang-option:hover {
    color: rgba(255, 228, 181, 0.7);
    background: rgba(255, 228, 181, 0.05);
}

.lang-option.active {
    color: rgba(255, 228, 181, 0.9);
    background: rgba(255, 228, 181, 0.1);
}

/* Bottom icons */
.bottom-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bottom-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    position: relative;
}

.bottom-icon:hover {
    background: rgba(255, 228, 181, 0.1);
    transform: translateY(-1px);
}

.bottom-icon:hover svg {
    fill: rgba(255, 228, 181, 0.9);
}

.bottom-icon:active {
    transform: translateY(0);
}

/* Tooltip for bottom icons */
.bottom-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: rgba(42, 42, 42, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out 0.3s forwards;
}

@keyframes tooltipFadeIn {
    to {
        opacity: 1;
    }
}