/* sidebar.css - Enhanced Navigation Styles */

/* CSS Variables for Navigation */
:root {
    --nav-item-height: 72px;
    --nav-icon-size: 40px;
    --animation-speed: 0.3s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Container */
app-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 70px;
    width: var(--sidebar-width);
    height: calc(100vh - 70px - 25px);
    background: var(--white);
    border-right: 1px solid var(--gray-medium);
    box-shadow: var(--shadow);
    z-index: 999;
    transition: var(--transition);
    overflow-y: auto;
    font-family: 'Open Sans', Roboto, Ubuntu, Oxygen, Cantarell, sans-serif;
}

.sidebar-nav {
    padding: 8px 0;
    flex: 0 0 auto;
}

/* Sparks Area positioning */
sparks-area {
    margin: 16px;
    margin-top: auto;
    flex-shrink: 0;
}

/* ============================
   SECTION HEADERS
   ============================ */

.nav-section {
    margin-bottom: 8px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 12px 8px;
    margin-top: 8px;
}

.header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(139, 126, 200, 0.3),
        transparent
    );
}

.header-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #9CA3AF;
    text-transform: uppercase;
}

/* ============================
   NAVIGATION ITEMS
   ============================ */

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 4px 8px;
    border-radius: 12px;
    transition: all var(--animation-speed) var(--animation-easing);
    text-decoration: none;
    color: #374151;
    position: relative;
    overflow: hidden;
    border: none;
    background: none;
    width: calc(100% - 16px);
    cursor: pointer;
    text-align: left;
    font-family: 'Open Sans', Roboto, Ubuntu, Oxygen, Cantarell, sans-serif;
}

/* Hover effect - subtle lift */
.nav-item:hover {
    background: #F9FAFB;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(139, 126, 200, 0.1);
}

/* Active state - gradient background */
.nav-item.active {
    background: linear-gradient(135deg,
        rgba(139, 126, 200, 0.1),
        rgba(127, 176, 105, 0.1)
    );
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    border-radius: 0 2px 2px 0;
}

/* ============================
   ICON WRAPPER
   ============================ */

.nav-icon-wrapper {
    position: relative;
    width: var(--nav-icon-size);
    height: var(--nav-icon-size);
    flex-shrink: 0;
}

.nav-icon-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    border-radius: 10px;
    opacity: 0.15;
    transition: opacity var(--animation-speed);
}

.nav-item:hover .nav-icon-bg {
    opacity: 0.25;
}

.nav-item.active .nav-icon-bg {
    opacity: 0.3;
}

.nav-emoji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform var(--animation-speed) cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-item:hover .nav-emoji {
    transform: scale(1.15);
}

/* ============================
   CONTENT (Label + Subtitle)
   ============================ */

.nav-content {
    flex: 1;
    min-width: 0;
}

.nav-label {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 2px;
}

.nav-subtitle {
    font-size: 12px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================
   BADGES
   ============================ */

.nav-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(139, 126, 200, 0.3);
    animation: badge-appear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-badge.badge-new {
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    animation: pulse 2s ease-in-out infinite;
}

.nav-badge.badge-ai {
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
}

.nav-badge.badge-count {
    background: linear-gradient(135deg, #8B7EC8, #7FB069);
}

.nav-badge .sparkle {
    margin-right: 4px;
    animation: sparkle-rotate 3s linear infinite;
}

/* ============================
   PROGRESS INDICATOR
   ============================ */

.nav-progress {
    margin-top: 6px;
}

.progress-bar {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B7EC8, #7FB069);
    transition: width 0.6s ease;
}

.progress-text {
    font-size: 11px;
    color: #6B7280;
}

/* ============================
   KEYBOARD SHORTCUTS
   ============================ */

.nav-shortcut {
    opacity: 0;
    font-size: 11px;
    color: #9CA3AF;
    font-family: 'SF Mono', 'Monaco', monospace;
    transition: opacity 0.2s;
    margin-left: auto;
}

.nav-item:hover .nav-shortcut {
    opacity: 1;
}

/* ============================
   ANIMATIONS
   ============================ */

@keyframes badge-appear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes sparkle-rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(10deg);
    }
    75% {
        transform: rotate(-10deg);
    }
}

/* Ripple effect on click */
.nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(139, 126, 200, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.nav-item:active::after {
    width: 300px;
    height: 300px;
}

/* ============================
   REDUCED MOTION
   ============================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .nav-item:hover .nav-emoji {
        transform: scale(1);
    }

    .nav-item:hover {
        transform: translateX(0);
    }
}

/* ============================
   LAPTOP RESPONSIVE
   ============================ */

@media (max-width: 1200px) {
    .nav-subtitle {
        display: none;
    }

    .nav-item {
        padding: 10px;
        gap: 10px;
    }

    .nav-icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .nav-emoji {
        font-size: 20px;
    }

    .nav-label {
        font-size: 14px;
    }

    .nav-section-header {
        padding: 12px 10px 6px;
    }

    .header-text {
        font-size: 10px;
    }

    sparks-area {
        margin: 12px;
    }
}

/* ============================
   TABLET AND MOBILE RESPONSIVE
   ============================ */

@media (max-width: 1024px) {
    app-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    app-sidebar {
        width: 280px;
    }

    /* Simplify on mobile */
    .nav-shortcut {
        display: none;
    }

    .nav-item {
        padding: 10px;
    }

    .nav-subtitle {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    app-sidebar {
        width: 100vw;
    }

    .nav-item {
        padding: 12px;
        margin: 3px 6px;
    }

    .nav-label {
        font-size: 14px;
    }

    .nav-subtitle {
        font-size: 11px;
    }

    .nav-icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .nav-emoji {
        font-size: 20px;
    }
}

/* ============================
   NAVIGATION HINTS
   ============================ */

.nav-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 8px 8px 52px; /* Indent to align with nav content */
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    position: relative;

    /* Animation setup */
    opacity: 0;
    transform: translateX(-20px);
    transition: all var(--animation-speed) var(--animation-easing);
    max-height: 0;
    overflow: hidden;
}

/* Show state (applied after creation) */
.nav-hint.show {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
    margin-bottom: 8px;
}

/* Hint content */
.nav-hint-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.nav-hint-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.nav-hint-message {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

/* Dismiss button */
.nav-hint-dismiss {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 4px;
}

.nav-hint-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.nav-hint-dismiss:active {
    transform: scale(0.95);
}

.nav-hint-dismiss svg {
    display: block;
}

/* Hint type variations (backgrounds and colors set inline via JS) */
.nav-hint[data-type="first-visit"] {
    /* Yellow theme - set inline */
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.15);
}

.nav-hint[data-type="suggested-action"] {
    /* Blue theme - set inline */
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.nav-hint[data-type="achievement"] {
    /* Green theme - set inline */
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

.nav-hint[data-type="tip"] {
    /* Indigo theme - set inline */
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
}

.nav-hint[data-type="warning"] {
    /* Red theme - set inline */
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nav-hint {
        transition: opacity 0.2s linear;
        transform: none !important;
    }

    .nav-hint.show {
        transform: none;
    }
}

/* Mobile adjustments for hints */
@media (max-width: 768px) {
    .nav-hint {
        margin-left: 44px; /* Smaller indent on mobile */
        font-size: 12px;
        padding: 8px 10px;
    }

    .nav-hint-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-hint {
        margin-left: 8px;
        margin-right: 8px;
    }
}

/* ============================
   CELEBRATION EFFECTS
   ============================ */

/* Pulse animation for fallback celebrations */
@keyframes celebrate-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 126, 200, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(139, 126, 200, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 126, 200, 0);
    }
}

.celebrate-pulse {
    animation: celebrate-pulse 0.6s ease-out;
}

/* Progress bar celebration animation */
.nav-progress.celebrating .progress-fill {
    animation: progress-celebrate 1s ease;
}

@keyframes progress-celebrate {
    0%, 100% {
        transform: scaleY(1);
    }
    25%, 75% {
        transform: scaleY(1.5);
    }
    50% {
        transform: scaleY(1);
    }
}
