/* ========================================
   JAIN JINVANI - macOS DOCK STYLES
   Authentic "Genie" Dock Implementation
   ======================================== */

/* ===== Dock Container ===== */
.taskbar {
    position: fixed;
    bottom: 20px;
    /* Floating at bottom */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    /* Width determined by content */
    height: auto;
    z-index: 1000;

    /* Apple Liquid Glass (Vision Pro) */
    background: var(--liquid-glass-bg);
    backdrop-filter: var(--liquid-glass-blur);
    -webkit-backdrop-filter: var(--liquid-glass-blur);

    /* Border handled by inner shadow in liquid-glass-shadow mostly, but keeping subtle outer border */
    border: 1px solid transparent;
    box-shadow: var(--liquid-glass-shadow);

    border-radius: 20px;
    padding: 8px 10px;
    transition: width 0.3s ease, padding 0.3s ease;
}

.taskbar-container {
    height: 64px;
    /* Fixed height for dock area */
    display: flex;
    align-items: flex-end;
    /* Align items to bottom */
    gap: 8px;
    /* Spacing between items */
}

/* ===== Dock Items ===== */
.taskbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* Align to bottom */
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    padding: 0;
    margin: 0;
    min-width: unset;
    /* Reset */
    min-width: unset;
    /* Reset */
    transition: transform 0.2s var(--spring-apple);
    /* Spring physics for hover */
    /* Ensure no default margin affecting layout */
    margin-bottom: 2px;
}

/* ===== Icon Wrappers ===== */
.taskbar-icon-wrapper {
    width: 50px;
    /* Base size */
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;

    /* Kumkum Red Border (Branding) */
    border: 2px solid rgba(178, 34, 34, 0.15);
    border-radius: 12px;
    /* iOS-like Squircle-ish */

    background: rgba(255, 255, 255, 0.85);
    /* Slightly opaque icon bg */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    transition: all 0.2s ease;
    transform-origin: bottom center;
    /* Scale from bottom */
}

/* Hover effects for non-JS interaction (fallback) */
.taskbar-item:hover .taskbar-icon-wrapper {
    background: white;
    border-color: var(--kumkum-red);
    box-shadow: 0 10px 25px rgba(178, 34, 34, 0.2);
}

/* Logo specific */
.taskbar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

/* SVG icons */
.taskbar-icon-wrapper svg {
    width: 28px;
    height: 28px;
    color: #444;
    /* Darker grey by default */
    stroke-width: 2;
    transition: color 0.2s;
}

.taskbar-item:hover svg {
    color: var(--kumkum-red);
}

/* Sadhana icon - Red book */
.sadhana-icon svg {
    color: #d32f2f;
    fill: #d32f2f;
}

/* More icon - Blue folder */
.more-icon svg {
    color: #1976d2;
    fill: #1976d2;
}

/* ===== Active State Indicator (Dot) ===== */
.taskbar-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    /* Position below the icon */
    width: 4px;
    height: 4px;
    background: #444;
    /* Grey dot like macOS */
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.taskbar-item.active::after {
    opacity: 1;
    background: var(--kumkum-red);
    /* Red dot for active */
    box-shadow: 0 0 4px rgba(178, 34, 34, 0.5);
}

/* Active item icon style */
.taskbar-item.active .taskbar-icon-wrapper {
    background: white;
    border-color: var(--kumkum-red);
}

/* ===== Labels (Tooltips) ===== */
.taskbar-label {
    position: absolute;
    top: -50px;
    /* Position ABOVE the dock */
    left: 50%;
    transform: translateX(-50%) scale(0.9);

    background: rgba(240, 240, 240, 0.9);
    /* Light grey tooltip */
    color: #333;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;

    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Liquid Glass for Tooltip */
    background: var(--liquid-glass-bg);
    backdrop-filter: var(--liquid-glass-blur);
    -webkit-backdrop-filter: var(--liquid-glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--liquid-glass-shadow);
}

/* Tooltip Arrow */
.taskbar-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(240, 240, 240, 0.9);
}

.taskbar-item:hover .taskbar-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
    top: -60px;
    /* Slight float up */
}

/* ===== Main Content Adjustment ===== */
.main-content {
    margin-left: 0 !important;
    padding-top: 0px;
    /* Reset top padding */
    padding-bottom: 120px;
    /* Add bottom padding for dock */
}

/* ===== Dark Mode ===== */
/* .taskbar variables handle dark mode automatically now */

[data-theme="dark"] .taskbar-icon-wrapper {
    background: rgba(60, 60, 60, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .taskbar-icon-wrapper svg {
    color: #ddd;
}

[data-theme="dark"] .taskbar-item:hover .taskbar-icon-wrapper {
    background: rgba(80, 80, 80, 0.8);
    border-color: var(--kumkum-red);
}

[data-theme="dark"] .taskbar-label {
    /* .taskbar-label variables handle dark mode automatically */
    color: white;
}

[data-theme="dark"] .taskbar-label::after {
    border-top-color: rgba(40, 40, 40, 0.9);
}

/* ===== Responsive Design ===== */

/* Mobile - Show Dock with adjusted sizing */
@media (max-width: 768px) {
    .taskbar {
        bottom: 10px;
        /* Closer to bottom on mobile */
        padding: 6px 8px;
        border-radius: 16px;
    }

    .taskbar-container {
        height: 52px;
        /* Slightly smaller on mobile */
        gap: 6px;
    }

    .taskbar-icon-wrapper {
        width: 44px;
        /* Touch-friendly size */
        height: 44px;
        font-size: 22px;
    }

    .taskbar-logo {
        width: 32px;
        height: 32px;
    }

    .taskbar-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }

    /* Hide tooltips on mobile (touch doesn't have hover) */
    .taskbar-label {
        display: none !important;
    }

    .main-content {
        padding-bottom: 90px;
        /* Space for dock */
    }
}

/* Hide old mobile bottom navigation */
.mobile-bottom-nav {
    display: none !important;
}

/* Very small screens - even more compact */
@media (max-width: 480px) {
    .taskbar {
        bottom: 8px;
        padding: 5px 6px;
    }

    .taskbar-container {
        gap: 4px;
    }

    .taskbar-icon-wrapper {
        width: 44px;
        /* Maintaining Fitts's Law min target */
        height: 44px;
    }
}

/* ===== Animations ===== */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-20px);
    }

    50% {
        transform: translateY(0);
    }

    70% {
        transform: translateY(-10px);
    }

    90% {
        transform: translateY(0);
    }
}

.bounce {
    animation: bounce 0.6s cubic-bezier(0.28, 0.84, 0.42, 1);
}