/* Taskbar Styles */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: linear-gradient(to bottom, #3b83f4 0%, #286add 7%, #1f54c4 45%, #1740a6 100%);
    border-top: 1px solid #0E3A8E;
    display: flex;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.3);
}

/* Start Button */
.start-button {
    height: calc(100% - 2px);
    min-width: 102px;
    margin: 1px 0 1px 1px;
    padding: 0 17px 0 8px;
    background:
        radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.75), transparent 35%),
        linear-gradient(to bottom, #8ad453 0%, #5fb331 44%, #398823 100%);
    border: 1px solid #1d7117;
    border-top-color: #d7f6b5;
    border-left-color: #d7f6b5;
    border-radius: 0 13px 13px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Tahoma', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    position: relative;
    transition:
        border-color var(--xp-motion-fast) var(--xp-ease-out),
        box-shadow var(--xp-motion-fast) var(--xp-ease-out),
        transform var(--xp-motion-fast) var(--xp-ease-out);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.45),
        inset -1px -1px 0 rgba(0,0,0,0.22),
        1px 0 2px rgba(0,0,0,0.25);
}

#start-button:hover {
    background: linear-gradient(to bottom, #88C34E 0%, #71AC42 50%, #619C32 100%); /* Degradado hover */
    border-top: 1px solid #D6E7AC;
    border-left: 1px solid #D6E7AC;
    border-right: 1px solid #4178E5;
    border-bottom: 1px solid #4178E5;
    transform: translateY(-1px);
}

#start-button:active,
#start-button.active {
    background: linear-gradient(to bottom, #518C2A 0%, #619C32 50%, #78B33E 100%); /* Degradado active */
    border-top: 1px solid #3168D5;
    border-left: 1px solid #3168D5;
    border-right: 1px solid #C6D79C;
    border-bottom: 1px solid #C6D79C;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); /* Sombra interna para presionado */
    padding: 1px 16px 0 9px;
    transform: translateY(0);
}

.start-button img {
    width: 25px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.5));
    image-rendering: auto;
}

.quick-launch-shell {
    height: 100%;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 3px 0 2px;
    border-right: 1px solid rgba(10, 42, 106, 0.72);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.22);
}

.quick-launch-grip {
    width: 3px;
    height: 19px;
    flex: 0 0 3px;
    border-left: 1px solid rgba(10, 42, 106, 0.72);
    border-right: 1px solid rgba(190, 220, 255, 0.62);
}

.quick-launch-button {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    appearance: none;
    box-shadow: none;
    transition:
        background-color var(--xp-motion-fast) var(--xp-ease-out),
        border-color var(--xp-motion-fast) var(--xp-ease-out),
        transform var(--xp-motion-fast) var(--xp-ease-out);
}

.quick-launch-button:hover,
.quick-launch-button:focus-visible {
    border-color: rgba(194, 224, 255, 0.74);
    background: rgba(118, 175, 255, 0.34);
    outline: 1px dotted rgba(255, 255, 255, 0.92);
    outline-offset: -3px;
}

.quick-launch-button.active {
    border-color: rgba(8, 40, 116, 0.86);
    background: rgba(10, 49, 147, 0.62);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.48);
}

.quick-launch-button.active img,
.quick-launch-button:active img {
    transform: translate(1px, 1px);
}

.quick-launch-button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4));
}

/* Taskbar Programs Area */
.taskbar-programs {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 5px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Taskbar Program Button */
.taskbar-program {
    height: calc(100% - 4px);
    min-width: 160px;
    max-width: 200px;
    background: linear-gradient(to bottom, #4A8FDB 0%, #3168D5 3%, #2559C6 100%);
    border: 1px solid #0E3A8E;
    border-radius: 2px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 11px;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    transition:
        border-color var(--xp-motion-fast) var(--xp-ease-out),
        box-shadow var(--xp-motion-fast) var(--xp-ease-out),
        opacity var(--xp-motion-fast) var(--xp-ease-out),
        transform var(--xp-motion-fast) var(--xp-ease-out);
    position: relative;
    overflow: hidden;
}

.taskbar-program:hover {
    background: linear-gradient(to bottom, #5A9FEB 0%, #4178E5 3%, #3569D6 100%);
    border-color: #1E4A9E;
    transform: translateY(-1px);
}

.taskbar-program.active {
    background: linear-gradient(to bottom, #1941A5 0%, #2559C6 3%, #3168D5 100%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    border-color: #0A2A6A;
    transform: translateY(0);
}

.taskbar-program.minimized {
    background: linear-gradient(to bottom, #3A7FDB 0%, #2158C5 3%, #1549B6 100%);
    opacity: 0.8;
}

.taskbar-program img {
    width: 16px;
    height: 16px;
}

.taskbar-program span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* System Tray */
.system-tray {
    height: 100%;
    background: linear-gradient(to bottom, #12A7EA 0%, #0C9CDD 3%, #0592D0 100%);
    border-left: 1px solid #0E3A8E;
    padding: 0 10px;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 100px;
}

.system-tray-bg {
    display: none;
}

.tray-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.taskbar-language {
    position: relative;
    flex: 0 0 auto;
}

.taskbar-language-trigger {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font: 700 11px/1 Tahoma, sans-serif;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    appearance: none;
}

.taskbar-language-trigger:hover,
.taskbar-language-trigger:focus-visible,
.taskbar-language-trigger[aria-expanded="true"] {
    border-top-color: rgba(211, 235, 255, 0.82);
    border-left-color: rgba(211, 235, 255, 0.82);
    border-right-color: rgba(5, 72, 135, 0.82);
    border-bottom-color: rgba(5, 72, 135, 0.82);
    background: rgba(255, 255, 255, 0.13);
    outline: 1px dotted rgba(255, 255, 255, 0.92);
    outline-offset: -3px;
}

.taskbar-language-menu {
    position: absolute;
    right: -6px;
    bottom: calc(100% + 4px);
    z-index: 1010;
    width: 132px;
    padding: 2px;
    border: 1px solid #003c74;
    background: #ece9d8;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.34);
}

.taskbar-language-menu[hidden] {
    display: none;
}

.taskbar-language-menu button {
    width: 100%;
    min-width: 0;
    min-height: 25px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #111;
    font: 11px Tahoma, sans-serif;
    text-align: left;
    cursor: pointer;
}

.taskbar-language-menu button:hover,
.taskbar-language-menu button:focus-visible {
    background: #316ac5;
    color: #fff;
    outline: none;
}

.taskbar-language-menu .language-check {
    visibility: hidden;
    justify-self: end;
    grid-column: 3;
    grid-row: 1;
    color: currentColor;
    font-weight: 700;
}

.taskbar-language-menu button.selected .language-check {
    visibility: visible;
}

.taskbar-language-menu strong {
    color: #0b3d91;
}

.taskbar-language-menu button:hover strong,
.taskbar-language-menu button:focus-visible strong {
    color: #fff;
}

.tray-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tray-removable-button {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 22px;
    min-height: 22px;
    padding: 1px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.tray-removable-button:hover,
.tray-removable-button:focus-visible {
    border-top-color: rgba(211, 235, 255, 0.82);
    border-left-color: rgba(211, 235, 255, 0.82);
    border-right-color: rgba(5, 72, 135, 0.82);
    border-bottom-color: rgba(5, 72, 135, 0.82);
    background: rgba(255, 255, 255, 0.13);
    outline: 1px dotted rgba(255, 255, 255, 0.92);
    outline-offset: -3px;
}

.tray-removable-button img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.tray-removable-button[hidden] {
    display: none;
}

.tray-icon,
.tray-network-icon,
.tray-clippy-icon,
.tray-fullscreen-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.tray-icon:hover,
.tray-network-icon:hover,
.tray-clippy-icon:hover,
.tray-fullscreen-icon:hover {
    opacity: 1;
}

/* Clock */
.time {
    color: white;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    cursor: default;
}

/* Taskbar Animations */
@keyframes taskbarProgramAppear {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.taskbar-program {
    animation: taskbarProgramAppear 0.16s var(--xp-ease-out);
}

/* Quick Launch Area (optional) */
.quick-launch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 5px;
    border-right: 1px solid #0E3A8E;
    height: 100%;
}

.quick-launch-icon {
    width: 24px;
    height: 24px;
    padding: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 2px;
    transition:
        background-color var(--xp-motion-fast) var(--xp-ease-out),
        border-color var(--xp-motion-fast) var(--xp-ease-out),
        transform var(--xp-motion-fast) var(--xp-ease-out);
}

.quick-launch-icon:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.quick-launch-icon img {
    width: 100%;
    height: 100%;
}

/* Show Desktop Button */
.show-desktop {
    width: 15px;
    height: 100%;
    background: linear-gradient(to bottom, #4A8FDB 0%, #3168D5 3%, #2559C6 100%);
    border-left: 1px solid #0E3A8E;
    cursor: pointer;
    position: relative;
}

.show-desktop:hover {
    background: linear-gradient(to bottom, #5A9FEB 0%, #4178E5 3%, #3569D6 100%);
}

.show-desktop:active {
    background: linear-gradient(to bottom, #1941A5 0%, #2559C6 3%, #3168D5 100%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .taskbar {
        height: 40px;
    }
    
    .start-button {
        padding: 0 15px;
        font-size: 10px;
    }
    
    .taskbar-program {
        min-width: 120px;
        font-size: 10px;
    }
    
    .system-tray {
        min-width: 136px;
        padding: 0 5px;
    }

    .tray-content {
        gap: 6px;
    }

    .taskbar-language-trigger {
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .quick-launch-shell {
        flex-basis: 38px;
        padding-inline: 3px;
    }

    .quick-launch-button {
        width: 30px;
        min-width: 30px;
        max-width: 30px;
        height: 30px;
    }
    
    .time {
        font-size: 10px;
    }
    
    .tray-fullscreen-icon {
        display: none;
    }
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .tray-clippy-icon {
        display: none !important;
        pointer-events: none !important;
    }
}

/* Taskbar Context Menu */
.taskbar-context-menu {
    position: absolute;
    bottom: 100%;
    background: #ECE9D8;
    border: 1px solid #919B9C;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    padding: 2px;
    margin-bottom: 2px;
    display: none;
}

.taskbar-context-menu-item {
    padding: 4px 20px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
}

.taskbar-context-menu-item:hover {
    background: #316AC5;
    color: white;
}

/* Notification Area */
.notification-balloon {
    position: absolute;
    z-index: 1200;
    right: 4px;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: min(285px, calc(100vw - 16px));
    padding: 8px 10px 9px;
    color: #111;
    background: #ffffe1;
    border: 1px solid #003c74;
    border-radius: 5px;
    box-shadow: 2px 3px 7px rgba(0, 0, 0, 0.35);
    font: 11px/1.35 Tahoma, sans-serif;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.notification-balloon-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #003c74;
}

.notification-balloon-header img {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    object-fit: contain;
}

.notification-balloon-header strong {
    font-weight: 700;
}

.notification-balloon-body {
    overflow-wrap: anywhere;
}

.notification-balloon::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #FFFFE1;
}

@media (prefers-reduced-motion: reduce) {
    .start-button,
    .quick-launch-button,
    .taskbar-program,
    .quick-launch-icon {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .start-button img,
    .taskbar-program img,
    .tray-icon {
        image-rendering: auto;
    }
}
