/* wsp.ai - Version Control - Material Design 3 */

/* ============================================
   VERSION CONTAINER
   ============================================ */

.version-container {
    position: relative;
    margin-left: var(--spacing-md);
}

/* ============================================
   VERSION BUTTON (Split Button Style)
   ============================================ */

.version-button {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(144, 202, 249, 0.3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 120px;
    height: 36px;
}

.version-button:hover {
    border-color: rgba(144, 202, 249, 0.5);
    background-color: rgba(144, 202, 249, 0.05);
}

.version-button-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px 12px;
    color: #90caf9;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid rgba(144, 202, 249, 0.2);
    transition: background-color var(--transition-fast);
    min-width: 80px;
    justify-content: center;
}

.version-button-main:hover {
    background-color: rgba(144, 202, 249, 0.08);
}

.version-button-main .material-symbols-outlined {
    font-size: 18px;
}

.version-button-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    color: #90caf9;
    transition: all var(--transition-fast);
}

.version-button-dropdown:hover {
    background-color: rgba(144, 202, 249, 0.08);
}

.version-button-dropdown .material-symbols-outlined {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

.version-container.open .version-button-dropdown .material-symbols-outlined {
    transform: rotate(180deg);
}

/* ============================================
   VERSION DROPDOWN
   ============================================ */

.version-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background-color: rgba(37, 37, 37, 0.95);
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1000;
}

.version-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   VERSION LIST
   ============================================ */

.version-list {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-xs) 0;
}

.version-list::-webkit-scrollbar {
    width: 6px;
}

.version-list::-webkit-scrollbar-track {
    background: transparent;
}

.version-list::-webkit-scrollbar-thumb {
    background: rgba(144, 202, 249, 0.3);
    border-radius: 3px;
}

.version-list::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 202, 249, 0.5);
}

/* ============================================
   VERSION OPTIONS
   ============================================ */

.version-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px 16px;
    color: var(--md-sys-color-on-surface);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.version-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(144, 202, 249, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.version-option:active::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

.version-option:hover {
    background-color: rgba(144, 202, 249, 0.1);
}

.version-option:active {
    background-color: rgba(144, 202, 249, 0.2);
}

.version-option .material-symbols-outlined {
    font-size: 20px;
    color: #90caf9;
    flex-shrink: 0;
}

.version-option-text {
    flex: 1;
    font-weight: 400;
}

/* Version Badge */
.version-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-badge.current {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.15));
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81C784;
}

/* ============================================
   VERSION FOOTER (Add Revision)
   ============================================ */

.version-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(144, 202, 249, 0.1);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.add-revision-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    background: rgba(144, 202, 249, 0.08);
    border: 1px solid rgba(144, 202, 249, 0.2);
    border-radius: 24px;
    color: #90caf9;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.add-revision-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(144, 202, 249, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.add-revision-btn:active::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

.add-revision-btn:hover {
    background: rgba(144, 202, 249, 0.15);
    border-color: rgba(144, 202, 249, 0.4);
    box-shadow: 0 4px 12px rgba(144, 202, 249, 0.2);
    transform: translateY(-1px);
}

.add-revision-btn:active {
    transform: translateY(0);
}

.add-revision-btn .material-symbols-outlined {
    font-size: 20px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .version-button {
        min-width: 100px;
        height: 32px;
    }
    
    .version-button-main {
        min-width: 60px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .version-dropdown {
        width: 240px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Staggered entrance for version options */
.version-option {
    animation: slideInVersion 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) backwards;
}

.version-option:nth-child(1) { animation-delay: 0.05s; }
.version-option:nth-child(2) { animation-delay: 0.1s; }
.version-option:nth-child(3) { animation-delay: 0.15s; }
.version-option:nth-child(4) { animation-delay: 0.2s; }
.version-option:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInVersion {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Add button entrance */
.add-revision-btn {
    animation: fadeInScale 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) 0.3s backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
