/* 
 * Side Panel Styles
 * Contains styles for the fixed side panel and mobile drawer
 * To be imported in main.css
 */

.side-panel {
    position: fixed;
    top: 120px; /* Below the header */
    right: 20px;
    width: 300px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    animation: slidePanelIn 0.5s forwards;
}

@keyframes slidePanelIn {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.project-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    transform: translateX(3px);
    border-left: 4px solid var(--primary-color);
}

.nav-item.active::after {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Flash animation for clicked item */
@keyframes flash-border {
    0% {
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
        border-color: var(--border-color);
    }
    20% {
        box-shadow: 0 0 0 3px var(--primary-color);
        border-color: var(--primary-color);
        transform: translateY(-3px);
    }
    40% {
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
        border-color: var(--accent-color);
        transform: translateY(-1px);
    }
    60% {
        box-shadow: 0 0 0 4px var(--primary-color);
        border-color: var(--primary-color);
        transform: translateY(-3px);
    }
    80% {
        box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.5);
        border-color: var(--accent-color);
        transform: translateY(-2px);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
        border-color: var(--primary-color);
        transform: translateY(0);
    }
}

.nav-item.flash {
    animation: flash-border 2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 5;
}

.nav-item.flash::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius-sm);
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    z-index: -1;
    opacity: 0;
    animation: pulse-bg 2s ease-out;
}

@keyframes pulse-bg {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    30% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-size: 1.25rem;
}

.nav-content h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.nav-content p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Mobile Toggle Button */
.side-panel-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color); /* Different color */
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    z-index: 101;
    transition: var(--transition);
}

.side-panel-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.side-panel-toggle svg {
    transition: transform 0.3s ease;
}

.side-panel-toggle.active svg {
    transform: rotate(180deg);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .side-panel {
        width: 250px;
    }
}

@media (max-width: 992px) {
    /* Main content adjustment */
    .main-content {
        padding-right: 0;
    }
    
    /* Mobile side panel styles */
    .side-panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: -100%;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        box-shadow: var(--shadow-lg);
        padding: 1.5rem;
        z-index: 101;
        transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .side-panel.active {
        bottom: 0;
    }
    
    .side-panel-toggle {
        bottom: 2rem;
        right: 2rem;
        display: flex;
    }
    
    /* Add pill indicator at top of panel */
    .side-panel::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border-color);
        border-radius: 10px;
    }
    
    /* Adjust the panel header for mobile */
    .panel-header {
        text-align: center;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color);
    }
}
