/**
 * Vertical Menu Bar Styles
 * 
 * Styles for the modular vertical menu bar component.
 * Includes responsive design and smooth animations.
 */

/* Base Menu Bar Styles */
.vertical-menu-bar {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Position Variants */
.vertical-menu-bar--right {
    top: 16px;
    right: 16px;
}

.vertical-menu-bar--left {
    top: 16px;
    left: 16px;
}

.vertical-menu-bar--bottom {
    bottom: 16px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
}

/* Visibility States */
.vertical-menu-bar.menu-bar-hidden {
    opacity: 1; /* Always visible now */
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.vertical-menu-bar--left.menu-bar-hidden {
    transform: translateX(0) scale(1);
}

.vertical-menu-bar--bottom.menu-bar-hidden {
    transform: translateX(50%) translateY(0) scale(1);
}

.vertical-menu-bar.menu-bar-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.vertical-menu-bar--bottom.menu-bar-visible {
    transform: translateX(50%) translateY(0) scale(1);
}

/* Menu Item Base Styles */
.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.menu-item:active {
    transform: scale(0.95);
}

.menu-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.menu-item:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: none;
}

/* Ripple Effect */
.menu-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.menu-item:active::before {
    width: 100%;
    height: 100%;
}

/* Specific Menu Item Styles */
.menu-item-favorite {
    /* Default favorite styles */
}

.menu-item-favorite.active {
    background: rgba(255, 59, 92, 0.3);
    border-color: rgba(255, 59, 92, 0.5);
    color: #ff3b5c;
}

.menu-item-favorite.active:hover {
    background: rgba(255, 59, 92, 0.4);
    border-color: rgba(255, 59, 92, 0.7);
}

.menu-item-download {
    /* Default download styles */
}

.menu-item-download:hover {
    background: rgba(0, 122, 255, 0.3);
    border-color: rgba(0, 122, 255, 0.5);
    color: #007aff;
}

.menu-item-info {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.menu-item-info.expanded {
    background: rgba(88, 86, 214, 0.4);
    border-color: rgba(88, 86, 214, 0.6);
    color: #5856d6;
}

.menu-item-info:hover {
    background: rgba(88, 86, 214, 0.3);
    border-color: rgba(88, 86, 214, 0.5);
    color: #5856d6;
}

.menu-item-edit {
    /* Default edit styles */
}

.menu-item-edit:hover {
    background: rgba(255, 149, 0, 0.3);
    border-color: rgba(255, 149, 0, 0.5);
    color: #ff9500;
}

.menu-item-remix {
    /* Default remix styles */
}

.menu-item-remix:hover {
    background: rgba(255, 45, 85, 0.3);
    border-color: rgba(255, 45, 85, 0.5);
    color: #ff2d55;
}

.menu-item-variation {
    /* Default variation styles */
}

.menu-item-variation:hover {
    background: rgba(88, 86, 214, 0.3);
    border-color: rgba(88, 86, 214, 0.5);
    color: #5856d6;
}

/* Bottom Position Adjustments */
.vertical-menu-bar--bottom .menu-item {
    margin: 0 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vertical-menu-bar {
        padding: 10px 6px;
        gap: 6px;
    }
    
    .vertical-menu-bar--right {
        top: 12px;
        right: 12px;
    }
    
    .vertical-menu-bar--left {
        top: 12px;
        left: 12px;
    }
    
    .vertical-menu-bar--bottom {
        bottom: 12px;
        padding: 8px 12px;
        flex-direction: row;
        gap: 8px;
    }
    
    .menu-item {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    
    /* Always visible on mobile (redundant now but keeping for clarity) */
    .vertical-menu-bar.menu-bar-hidden {
        opacity: 1 !important;
        transform: translateX(0) scale(1) !important;
        pointer-events: auto !important;
    }
    
    .vertical-menu-bar--bottom.menu-bar-hidden {
        transform: translateX(50%) translateY(0) scale(1) !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .vertical-menu-bar--bottom {
        bottom: 8px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .vertical-menu-bar--bottom.menu-bar-hidden,
    .vertical-menu-bar--bottom.menu-bar-visible {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    
    .menu-item {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .vertical-menu-bar {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid white;
    }
    
    .menu-item {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .menu-item:hover {
        background: rgba(255, 255, 255, 0.4);
        border-color: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .vertical-menu-bar,
    .menu-item,
    .menu-item::before {
        transition: none;
    }
    
    .vertical-menu-bar.menu-bar-hidden {
        display: none;
    }
    
    .vertical-menu-bar.menu-bar-visible {
        display: flex;
    }
}

/* Dark Theme Adjustments */
@media (prefers-color-scheme: dark) {
    .vertical-menu-bar {
        background: rgba(28, 28, 30, 0.9);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .menu-item {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .menu-item:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* Light Theme Adjustments */
@media (prefers-color-scheme: light) {
    .vertical-menu-bar {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.1);
        color: #333;
    }
    
    .menu-item {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
        color: #333;
    }
    
    .menu-item:hover {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
    }
    
    .menu-item::before {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Info Expanded Window Styles */
.info-expanded-window {
    position: absolute;
    top: 16px;
    right: 80px; /* Position to the left of the menu bar */
    width: 380px;
    max-width: calc(100vw - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 20;
    transform: translateX(20px) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: calc(100vh - 100px);
}

.info-expanded-window.expanded {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.info-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.info-window-title {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin: 0;
}

.info-window-close {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.info-window-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.info-window-content {
    padding: 16px 20px 20px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.info-section {
    margin-bottom: 20px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.info-copy-button {
    background: linear-gradient(135deg, #5856d6, #007aff);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-copy-button:hover {
    background: linear-gradient(135deg, #4a47c4, #0056d6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 86, 214, 0.3);
}

.info-copy-button:active {
    transform: translateY(0);
}

.info-text-display {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #333;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.info-text-display:focus {
    border-color: rgba(88, 86, 214, 0.5);
}

/* Mobile Responsive for Info Window */
@media (max-width: 768px) {
    .info-expanded-window {
        position: absolute;
        top: 16px;
        right: 80px; /* Keep next to menu bar on mobile */
        left: auto;
        transform: translateX(20px) scale(0.9);
        width: calc(100vw - 120px);
        max-width: 320px;
        max-height: calc(100vh - 100px);
    }
    
    .info-expanded-window.expanded {
        transform: translateX(0) scale(1);
    }
    
    .info-text-display {
        min-height: 70px;
        max-height: 150px;
        font-size: 0.8rem;
    }
    
    .info-window-header {
        padding: 14px 16px 10px;
    }
    
    .info-window-content {
        padding: 12px 16px 16px;
    }
    
    .info-copy-button {
        padding: 8px 12px;
        font-size: 0.7rem;
    }
    
    .info-section {
        margin-bottom: 16px;
    }
    
    .info-section-title {
        font-size: 0.85rem;
    }
}

/* Dark Theme for Info Window */
@media (prefers-color-scheme: dark) {
    .info-expanded-window {
        background: rgba(28, 28, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .info-window-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .info-window-title {
        color: #fff;
    }
    
    .info-window-close {
        color: #aaa;
    }
    
    .info-window-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .info-section-title {
        color: #fff;
    }
    
    .info-text-display {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .info-text-display:focus {
        border-color: rgba(88, 86, 214, 0.6);
    }
}

/* High Contrast Mode for Info Window */
@media (prefers-contrast: high) {
    .info-expanded-window {
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #000;
    }
    
    .info-window-header {
        border-bottom: 2px solid #000;
    }
    
    .info-text-display {
        border: 2px solid #000;
        background: #fff;
    }
    
    .info-copy-button {
        background: #000;
        border: 2px solid #000;
    }
    
    .info-copy-button:hover {
        background: #333;
    }
}

/* Reduced Motion for Info Window */
@media (prefers-reduced-motion: reduce) {
    .info-expanded-window {
        transition: none;
    }
    
    .info-expanded-window.expanded {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    
    .info-copy-button {
        transition: none;
    }
    
    .info-copy-button:hover {
        transform: none;
    }
}

/* Edit Options Panel Styles */
.edit-options-panel {
    position: absolute;
    z-index: 25;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    min-width: 180px;
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.edit-options-panel:not(.hidden) {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.edit-options-panel.hidden {
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.edit-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.edit-option:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.edit-option:active {
    transform: translateX(1px) scale(0.98);
}

.edit-option-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.edit-option-text {
    flex: 1;
    white-space: nowrap;
}

/* Specific option colors */
.edit-option[data-action="add-to-chat"]:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.edit-option[data-action="add-to-new-chat"]:hover {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.edit-option[data-action="open-in-editor"]:hover {
    background: rgba(255, 149, 0, 0.1);
    color: #ff9500;
}

/* Dark Theme for Edit Options Panel */
@media (prefers-color-scheme: dark) {
    .edit-options-panel {
        background: rgba(28, 28, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .edit-option {
        color: #fff;
    }
    
    .edit-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .edit-option[data-action="add-to-chat"]:hover {
        background: rgba(0, 122, 255, 0.2);
        color: #64b5f6;
    }
    
    .edit-option[data-action="add-to-new-chat"]:hover {
        background: rgba(52, 199, 89, 0.2);
        color: #81c784;
    }
    
    .edit-option[data-action="open-in-editor"]:hover {
        background: rgba(255, 149, 0, 0.2);
        color: #ffb74d;
    }
}

/* Mobile Responsive for Edit Options Panel */
@media (max-width: 768px) {
    .edit-options-panel {
        min-width: 160px;
        padding: 6px;
    }
    
    .edit-option {
        padding: 10px 12px;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .edit-option-icon {
        font-size: 1rem;
        width: 18px;
    }
}

/* High Contrast Mode for Edit Options Panel */
@media (prefers-contrast: high) {
    .edit-options-panel {
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #000;
    }
    
    .edit-option {
        border: 1px solid transparent;
    }
    
    .edit-option:hover {
        background: #f0f0f0;
        border-color: #000;
    }
}

/* Reduced Motion for Edit Options Panel */
@media (prefers-reduced-motion: reduce) {
    .edit-options-panel {
        transition: none;
    }
    
    .edit-option {
        transition: none;
    }
    
    .edit-option:hover {
        transform: none;
    }
    
    .edit-option:active {
        transform: none;
    }
}

/* Remix Options Panel Styles */
.remix-options-panel {
    position: absolute;
    z-index: 25;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    min-width: 180px;
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.remix-options-panel:not(.hidden) {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.remix-options-panel.hidden {
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.remix-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.remix-option:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.remix-option:active {
    transform: translateX(1px) scale(0.98);
}

.remix-option-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.remix-option-text {
    flex: 1;
    white-space: nowrap;
}

/* Specific remix option colors */
.remix-option[data-action="remix-in-chat"]:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.remix-option[data-action="remix-in-new-chat"]:hover {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.remix-option[data-action="remix-in-editor"]:hover {
    background: rgba(255, 45, 85, 0.1);
    color: #ff2d55;
}

/* Variation Options Panel Styles */
.variation-options-panel {
    position: absolute;
    z-index: 25;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    min-width: 180px;
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.variation-options-panel:not(.hidden) {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.variation-options-panel.hidden {
    transform: translateX(-10px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.variation-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.variation-option:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.variation-option:active {
    transform: translateX(1px) scale(0.98);
}

.variation-option-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.variation-option-text {
    flex: 1;
    white-space: nowrap;
}

/* Specific variation option colors */
.variation-option[data-action="variation-in-chat"]:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.variation-option[data-action="variation-in-new-chat"]:hover {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.variation-option[data-action="variation-in-editor"]:hover {
    background: rgba(88, 86, 214, 0.1);
    color: #5856d6;
}

/* Dark Theme for Remix and Variation Options Panels */
@media (prefers-color-scheme: dark) {
    .remix-options-panel,
    .variation-options-panel {
        background: rgba(28, 28, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .remix-option,
    .variation-option {
        color: #fff;
    }
    
    .remix-option:hover,
    .variation-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .remix-option[data-action="remix-in-chat"]:hover,
    .variation-option[data-action="variation-in-chat"]:hover {
        background: rgba(0, 122, 255, 0.2);
        color: #64b5f6;
    }
    
    .remix-option[data-action="remix-in-new-chat"]:hover,
    .variation-option[data-action="variation-in-new-chat"]:hover {
        background: rgba(52, 199, 89, 0.2);
        color: #81c784;
    }
    
    .remix-option[data-action="remix-in-editor"]:hover {
        background: rgba(255, 45, 85, 0.2);
        color: #ff6b9d;
    }
    
    .variation-option[data-action="variation-in-editor"]:hover {
        background: rgba(88, 86, 214, 0.2);
        color: #9c9cff;
    }
}

/* Mobile Responsive for Remix and Variation Options Panels */
@media (max-width: 768px) {
    .remix-options-panel,
    .variation-options-panel {
        min-width: 160px;
        padding: 6px;
    }
    
    .remix-option,
    .variation-option {
        padding: 10px 12px;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .remix-option-icon,
    .variation-option-icon {
        font-size: 1rem;
        width: 18px;
    }
}

/* High Contrast Mode for Remix and Variation Options Panels */
@media (prefers-contrast: high) {
    .remix-options-panel,
    .variation-options-panel {
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #000;
    }
    
    .remix-option,
    .variation-option {
        border: 1px solid transparent;
    }
    
    .remix-option:hover,
    .variation-option:hover {
        background: #f0f0f0;
        border-color: #000;
    }
}

/* Reduced Motion for Remix and Variation Options Panels */
@media (prefers-reduced-motion: reduce) {
    .remix-options-panel,
    .variation-options-panel {
        transition: none;
    }
    
    .remix-option,
    .variation-option {
        transition: none;
    }
    
    .remix-option:hover,
    .variation-option:hover {
        transform: none;
    }
    
    .remix-option:active,
    .variation-option:active {
        transform: none;
    }
} 