/*
 * File: tab-styles.css
 * Desc: Tab Manager Positioning - now just the tab bar
 */

.tab-manager {
    position: absolute;
    bottom: 60px; /* Above footer */
    left: vaar(--sidebar-width);
    right: 0;
    background: transparent;
    z-index: 100;
}

.tab-bar {
    display: flex;
    align-items: center;
    background: #f0f5f5;
    /* border-bottom: 2px solid #e1e5e9; */
    border-bottom: 2px solid #6600ff;
    padding: 5 1rem;
    min-height: 40;
}

.tab-list {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    background: white;
    border: 1px solid #e1e5e9;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    min-width: 140px;
    max-width: 200px;
    position: relative;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
}

.tab.active {
    background: linear-gradient(135deg, #8B5FBF, #7B68EE);
    color: white;
    border-color: #8B5FBF;
    box-shadow: 0 -2px 8px rgba(139, 95, 191, 0.2);
}

.tab-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.tab.active .tab-icon {
    filter: brightness(0) invert(1);
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    font-weight: 500;
}

.tab-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.2rem;
    margin-left: 0.5rem;
    border-radius: 3px;
    font-size: 1.1rem;
    line-height: 1;
    transition: background-color 0.2s;
}

.tab-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.tab.active .tab-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.unsaved-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #E53E3E;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tab-controls {
    display: flex;
    margin-left: 0.5rem;
}

.scroll-left, .scroll-right {
    background: #e1e5e9;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 0.2rem;
    color: #666;
    transition: all 0.2s;
}

.scroll-left:hover, .scroll-right:hover {
    background: #d1d5db;
    color: #333;
}

/* Tab Content Display Area (separate from tab manager) */
.tab-content-display {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-top: 1rem;
    min-height: 300px;
    overflow-y: auto;
}

.no-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
    font-style: italic;
}

.tab-content-wrapper {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 6px;
    margin: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.action-button {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-button:hover {
    background: #e9ecef;
    border-color: #d1d5db;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.content-header h3 {
    color: #8B5FBF;
    font-size: 1.3rem;
    margin: 0;
}

.content-meta {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
}

.save-status {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.save-status.saved {
    color: #48BB78;
}

.save-status.unsaved {
    color: #D69E2E;
}

.timestamp {
    color: #999;
    font-size: 0.8rem;
}

.content-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-text {
    flex: 1;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Open Sans', Roboto, Ubuntu, Oxygen, Cantarell, sans-serif;
    line-height: 1.6;
    resize: none;
    transition: border-color 0.2s;
}

.content-text:focus {
    outline: none;
    border-color: #8B5FBF;
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.primary-button, .secondary-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.primary-button {
    background: linear-gradient(135deg, #8B5FBF, #7B68EE);
    color: white;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.3);
}

.secondary-button {
    background: #48BB78;
    color: white;
}

.secondary-button:hover {
    background: #38A169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.genie-output-area {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
    margin-top: 1rem;
}

.ai-response {
    line-height: 1.6;
}

.ai-response h4 {
    color: #8B5FBF;
    margin-bottom: 1rem;
}

.ai-response ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.placeholder {
    color: #999;
    font-style: italic;
}


/* Tab Manager Hidden State */
.tab-manager:not(:has(.tab)) {
    display: none;
}

/* Animation for tab creation */
.tab {
    animation: tabSlideIn 0.3s ease-out;
}

@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .tab-manager {
        max-height: 60vh;
    }
    
    .tab {
        min-width: 120px;
        max-width: 150px;
        padding: 0.4rem 0.8rem;
    }
    
    .tab-title {
        font-size: 0.85rem;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-meta {
        text-align: left;
        margin-top: 0.5rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
}

