/* ================================
   AXIO AI - MODERN UI ENHANCEMENTS
   Additional Premium Components
   ================================ */

/* ================================
   GLASSMORPHISM CARDS
   ================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow), var(--shadow-glow-primary);
    border-color: rgba(75, 85, 99, 0.3);
}

/* ================================
   ANIMATED BUTTONS
   ================================ */

.btn-modern {
    position: relative;
    overflow: hidden;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.3);
}

.btn-modern::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.6s, height 0.6s;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 85, 99, 0.4);
}

.btn-modern:active {
    transform: translateY(0);
}

/* ================================
   FLOATING ACTION BUTTON
   ================================ */

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 8px 24px rgba(75, 85, 99, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 1000;
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(75, 85, 99, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: toastSlideIn 0.3s var(--ease-out-expo);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--accent);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s var(--ease-smooth) forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ================================
   SKELETON LOADERS
   ================================ */

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 0%,
            var(--bg-hover) 50%,
            var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* ================================
   PROGRESS INDICATORS
   ================================ */

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-circular {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* ================================
   PARTICLE EFFECTS
   ================================ */

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* ================================
   ENHANCED HOVER EFFECTS
   ================================ */

.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: all var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
    border-color: var(--primary);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ================================
   BADGE COMPONENTS
   ================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(75, 85, 99, 0.2);
    color: var(--primary);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-accent {
    background: rgba(55, 65, 81, 0.2);
    color: var(--accent);
    border: 1px solid rgba(55, 65, 81, 0.3);
}

.badge-glow {
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 0 10px currentColor;
    }

    50% {
        box-shadow: 0 0 20px currentColor;
    }
}

/* ================================
   TOOLTIP
   ================================ */

.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.5rem 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--glass-border);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ================================
   ENHANCED SCROLLBAR
   ================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ================================
   RIPPLE EFFECT
   ================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    transition: 0s;
}

/* ================================
   ANIMATED ICONS
   ================================ */

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.icon-bounce {
    animation: iconBounce 1s var(--ease-bounce) infinite;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.icon-rotate {
    animation: iconRotate 2s linear infinite;
}

@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ================================
   UTILITY CLASSES
   ================================ */

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blur-bg {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glow-primary {
    box-shadow: var(--shadow-glow-primary);
}

.glow-success {
    box-shadow: var(--shadow-glow-success);
}

.glow-accent {
    box-shadow: var(--shadow-glow-accent);
}

.fade-in {
    animation: fadeIn 0.5s var(--ease-smooth);
}

.slide-up {
    animation: slideUp 0.5s var(--ease-out-expo);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zoom-in {
    animation: zoomIn 0.3s var(--ease-smooth);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================================
   CODE EXECUTE BUTTON & PREVIEW
   ================================ */

.code-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-execute-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.code-execute-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.code-execute-btn:active {
    transform: translateY(0);
}

/* Code Preview Modal */
.code-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.code-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.preview-modal-container {
    width: 90vw;
    height: 85vh;
    max-width: 1400px;
    background: linear-gradient(135deg, #1a1b2e 0%, #0d0e1a 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(75, 85, 99, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.code-preview-modal.active .preview-modal-container {
    transform: scale(1);
}

.code-preview-modal.fullscreen .preview-modal-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
}

.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.preview-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.preview-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-action-btn svg {
    width: 18px;
    height: 18px;
}

.preview-action-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.preview-action-btn.close {
    background: rgba(55, 65, 81, 0.1);
    border-color: rgba(55, 65, 81, 0.3);
    color: #f5576c;
}

.preview-action-btn.close:hover {
    background: rgba(55, 65, 81, 0.2);
    border-color: rgba(55, 65, 81, 0.5);
}

.preview-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0e1a;
}

.preview-device-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: max-width 0.3s ease;
}

.preview-device-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.preview-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-size-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-btn svg {
    width: 18px;
    height: 18px;
}

.size-btn:hover {
    background: rgba(75, 85, 99, 0.15);
    border-color: rgba(75, 85, 99, 0.3);
    color: var(--text-secondary);
}

.size-btn.active {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.3), rgba(107, 114, 128, 0.3));
    border-color: rgba(75, 85, 99, 0.5);
    color: var(--text-primary);
}

.preview-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive Preview Modal */
@media (max-width: 768px) {
    .preview-modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .preview-modal-header {
        padding: 0.75rem 1rem;
    }

    .preview-modal-header h3 {
        font-size: 1rem;
    }

    .preview-action-btn {
        width: 32px;
        height: 32px;
    }

    .preview-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .preview-modal-body {
        padding: 0.75rem;
    }

    .preview-modal-footer {
        padding: 0.5rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .preview-hint {
        font-size: 0.7rem;
    }
}

/* ================================
   GENERATION CONTROL BUTTONS
   ================================ */

.generation-controls {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.generation-controls.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.gen-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.gen-control-btn svg {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
}

.gen-control-btn::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;
}

.gen-control-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Pause Button */
.gen-control-btn.pause-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.4);
}

.gen-control-btn.pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(75, 85, 99, 0.5);
}

.gen-control-btn.pause-btn:active {
    transform: scale(0.95);
}

/* Continue/Play Button */
.gen-control-btn.continue-btn {
    background: linear-gradient(135deg, #00c853 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.gen-control-btn.continue-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.5);
}

.gen-control-btn.continue-btn:active {
    transform: scale(0.95);
}

.gen-control-btn.continue-btn svg {
    margin-left: 2px; /* Slight offset for play icon centering */
}

/* Stop Button */
.gen-control-btn.stop-btn {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(55, 65, 81, 0.4);
}

.gen-control-btn.stop-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(55, 65, 81, 0.5);
}

.gen-control-btn.stop-btn:active {
    transform: scale(0.95);
}

/* Pulse animation for active generation */
.generation-controls.visible .pause-btn {
    animation: genPulse 2s ease-in-out infinite;
}

@keyframes genPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(75, 85, 99, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(75, 85, 99, 0.6), 0 0 30px rgba(75, 85, 99, 0.3);
    }
}

/* Paused cursor style */
.typing-cursor.paused {
    color: #667eea;
    animation: pausedBlink 1s ease-in-out infinite;
}

@keyframes pausedBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Tooltip for generation controls */
.gen-control-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.4rem 0.75rem;
    background: rgba(249, 250, 251, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.gen-control-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .generation-controls {
        gap: 0.35rem;
        padding: 0 0.25rem;
    }

    .gen-control-btn {
        width: 32px;
        height: 32px;
    }

    .gen-control-btn svg {
        width: 14px;
        height: 14px;
    }

    .gen-control-btn::after {
        display: none;
    }
}

/* ================================
   ARCHITECTURE DIAGRAM BLOCKS
   ================================ */

.diagram-block-wrapper {
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.95), rgba(13, 14, 26, 0.95));
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(0, 0, 0, 0.05);
}

.diagram-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.1), rgba(107, 114, 128, 0.1));
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.diagram-tabs {
    display: flex;
    gap: 0.5rem;
}

.diagram-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.diagram-tab svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.diagram-tab:hover {
    background: rgba(75, 85, 99, 0.15);
    border-color: rgba(75, 85, 99, 0.3);
    color: var(--text-primary);
}

.diagram-tab.active {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.3), rgba(107, 114, 128, 0.3));
    border-color: rgba(75, 85, 99, 0.5);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.2);
}

.diagram-label-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.diagram-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.diagram-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.25), rgba(107, 114, 128, 0.25));
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #00f2fe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diagram-actions {
    display: flex;
    gap: 0.5rem;
}

.diagram-action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.diagram-action-btn:hover {
    background: rgba(75, 85, 99, 0.2);
    border-color: rgba(75, 85, 99, 0.4);
    color: var(--text-primary);
}

.diagram-content {
    position: relative;
    min-height: 200px;
}

.diagram-code-view {
    display: none;
    padding: 0;
}

.diagram-code-view.active {
    display: block;
}

.diagram-code-view pre {
    margin: 0;
    padding: 1.25rem;
    background: transparent;
    border-radius: 0;
}

.diagram-code-view code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.diagram-visual-view {
    display: none;
    padding: 2rem;
    min-height: 250px;
    overflow: auto;
}

.diagram-visual-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mermaid-diagram {
    max-width: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mermaid-diagram svg {
    max-width: 100%;
    height: auto;
    transition: transform 0.2s ease-out;
}

/* Diagram Loading State */
.diagram-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.diagram-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(75, 85, 99, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: diagramSpin 1s linear infinite;
}

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

.diagram-loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Diagram Error State */
.diagram-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.diagram-error .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.diagram-error .error-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f5576c;
    margin-bottom: 0.5rem;
}

.diagram-error .error-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.5rem;
    background: rgba(55, 65, 81, 0.1);
    border-radius: var(--radius-sm);
}

.diagram-error .error-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ================================
   FULLSCREEN DIAGRAM OVERLAY
   ================================ */

.diagram-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diagram-fullscreen-overlay.active {
    opacity: 1;
}

.diagram-fullscreen-overlay.closing {
    opacity: 0;
}

.diagram-fullscreen-container {
    width: 95vw;
    height: 95vh;
    max-width: 1600px;
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.98), rgba(13, 14, 26, 0.98));
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(75, 85, 99, 0.15);
}

.diagram-fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.15), rgba(107, 114, 128, 0.15));
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.diagram-fullscreen-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.diagram-fullscreen-actions {
    display: flex;
    gap: 0.5rem;
}

.diagram-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.diagram-fullscreen-btn:hover {
    background: rgba(75, 85, 99, 0.2);
    border-color: rgba(75, 85, 99, 0.4);
    color: var(--text-primary);
    transform: scale(1.05);
}

.diagram-fullscreen-btn.close {
    background: rgba(55, 65, 81, 0.1);
    border-color: rgba(55, 65, 81, 0.3);
    color: #f5576c;
}

.diagram-fullscreen-btn.close:hover {
    background: rgba(55, 65, 81, 0.2);
    border-color: rgba(55, 65, 81, 0.5);
}

.diagram-fullscreen-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

.diagram-fullscreen-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50%;
    min-height: 50%;
}

.diagram-fullscreen-view svg {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s ease-out;
}

/* ================================
   MERMAID THEME OVERRIDES
   ================================ */

.mermaid-diagram .node rect,
.mermaid-diagram .node circle,
.mermaid-diagram .node polygon {
    fill: #1a1b2e !important;
    stroke: #667eea !important;
    stroke-width: 2px !important;
}

.mermaid-diagram .node .label {
    fill: #ffffff !important;
    color: #ffffff !important;
}

.mermaid-diagram .edgePath .path {
    stroke: #00f2fe !important;
    stroke-width: 2px !important;
}

.mermaid-diagram .edgeLabel {
    background: #1a1b2e !important;
    color: #e0e0e0 !important;
}

.mermaid-diagram .cluster rect {
    fill: rgba(75, 85, 99, 0.1) !important;
    stroke: rgba(75, 85, 99, 0.5) !important;
}

.mermaid-diagram .cluster text {
    fill: #00f2fe !important;
}

/* Sequence Diagram Styles */
.mermaid-diagram .actor {
    fill: #1a1b2e !important;
    stroke: #667eea !important;
}

.mermaid-diagram .actor-line {
    stroke: rgba(75, 85, 99, 0.5) !important;
}

.mermaid-diagram .messageLine0,
.mermaid-diagram .messageLine1 {
    stroke: #00f2fe !important;
}

.mermaid-diagram .messageText {
    fill: #e0e0e0 !important;
}

.mermaid-diagram .activation0,
.mermaid-diagram .activation1 {
    fill: rgba(75, 85, 99, 0.3) !important;
    stroke: #667eea !important;
}

/* Class Diagram Styles */
.mermaid-diagram .classGroup .title {
    fill: #00f2fe !important;
}

.mermaid-diagram .classGroup line {
    stroke: rgba(75, 85, 99, 0.5) !important;
}

/* State Diagram Styles */
.mermaid-diagram .stateGroup .state-title {
    fill: #ffffff !important;
}

.mermaid-diagram .statediagram-state rect {
    fill: #1a1b2e !important;
    stroke: #667eea !important;
}

/* ER Diagram Styles */
.mermaid-diagram .er.entityBox {
    fill: #1a1b2e !important;
    stroke: #667eea !important;
}

.mermaid-diagram .er.entityLabel {
    fill: #ffffff !important;
}

.mermaid-diagram .er.relationshipLabel {
    fill: #e0e0e0 !important;
}

.mermaid-diagram .er.relationshipLine {
    stroke: #00f2fe !important;
}

/* Pie Chart Styles */
.mermaid-diagram .pieTitleText {
    fill: #ffffff !important;
}

.mermaid-diagram .slice {
    stroke: #0d0e1a !important;
}

/* Gantt Chart Styles */
.mermaid-diagram .grid .tick line {
    stroke: rgba(75, 85, 99, 0.2) !important;
}

.mermaid-diagram .section0,
.mermaid-diagram .section1 {
    fill: rgba(75, 85, 99, 0.1) !important;
}

.mermaid-diagram .task {
    fill: #667eea !important;
    stroke: #764ba2 !important;
}

.mermaid-diagram .taskText {
    fill: #ffffff !important;
}

/* ================================
   RESPONSIVE DIAGRAM STYLES
   ================================ */

@media (max-width: 768px) {
    .diagram-header {
        padding: 0.75rem 1rem;
    }

    .diagram-tabs {
        width: 100%;
    }

    .diagram-tab {
        flex: 1;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .diagram-label-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .diagram-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .diagram-action-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .diagram-visual-view {
        padding: 1rem;
        min-height: 180px;
    }

    .diagram-fullscreen-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .diagram-fullscreen-header {
        padding: 0.75rem 1rem;
    }

    .diagram-fullscreen-header h3 {
        font-size: 1rem;
    }

    .diagram-fullscreen-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .diagram-fullscreen-content {
        padding: 1rem;
    }
}