/**
 * Golaux Workspaces - Frontend Styles
 */

/* ===== Context Viewer ===== */
.golaux-context-viewer {
    max-width: 100%;
    margin: 20px 0;
    padding: 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.golaux-cv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.golaux-cv-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.golaux-cv-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.golaux-cv-format {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.golaux-cv-format:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.button:hover {
    background: #5568d3;
    color: white;
    text-decoration: none;
}

.button:active {
    transform: scale(0.98);
}

.golaux-cv-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    flex-wrap: wrap;
}

.golaux-cv-stat {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.golaux-cv-stat strong {
    color: #1f2937;
}

.golaux-cv-content {
    margin-top: 20px;
}

.golaux-cv-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 600px;
    margin: 0;
}

.golaux-cv-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Loading state */
.golaux-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.golaux-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .golaux-context-viewer {
        padding: 16px;
    }
    
    .golaux-cv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .golaux-cv-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .golaux-cv-actions select,
    .golaux-cv-actions .button {
        width: 100%;
    }
    
    .golaux-cv-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .golaux-cv-content pre {
        font-size: 12px;
        padding: 12px;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .golaux-context-viewer {
        margin: 10px -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .golaux-cv-header h2 {
        font-size: 20px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .golaux-cv-actions,
    .golaux-cv-stats {
        display: none;
    }
    
    .golaux-cv-content pre {
        background: white;
        color: black;
        border: 1px solid #ccc;
        max-height: none;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .golaux-context-viewer {
        background: #1f2937;
        border-color: #374151;
    }
    
    .golaux-cv-header {
        border-bottom-color: #374151;
    }
    
    .golaux-cv-header h2 {
        color: #f9fafb;
    }
    
    .golaux-cv-format {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .golaux-cv-stats {
        background: #374151;
    }
    
    .golaux-cv-stat {
        color: #d1d5db;
    }
    
    .golaux-cv-stat strong {
        color: #f9fafb;
    }
}

/* ===== Accessibility ===== */
.golaux-context-viewer *:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.button:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===== Animation ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.golaux-context-viewer {
    animation: fadeIn 0.3s ease-out;
}
