/* Sikho Guru 1.1 - Complete Glass Design */
/* iOS-style liquid glass with dark/light themes */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Glass Effects */
    --glass-blur: 20px;
    --glass-saturate: 180%;

    /* Sikho Brand Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #8b5cf6;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Light Theme Glass */
    --glass-bg-light: rgba(255, 255, 255, 0.15);
    --glass-border-light: rgba(255, 255, 255, 0.3);
    --glass-shadow-light: 0 8px 32px rgba(31, 38, 135, 0.15);
    --text-light: #1a1a1a;
    --text-secondary-light: #666666;

    /* Dark Theme Glass */
    --glass-bg-dark: rgba(0, 0, 0, 0.2);
    --glass-border-dark: rgba(255, 255, 255, 0.1);
    --glass-shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-dark: #ffffff;
    --text-secondary-dark: #a0a0a0;
}

/* ==================== BASE RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Dark Theme */
body[data-theme="dark"] {
    background: #0a0e27;
    color: var(--text-dark);
}

/* Light Theme */
body[data-theme="light"] {
    background: #f5f7fa;
    color: var(--text-light);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 80px;
    height: 100vh;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border-right: 1px solid var(--glass-border-dark);
    box-shadow: var(--glass-shadow-dark);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
}

.sidebar:hover,
.sidebar.expanded {
    width: 240px;
}

body[data-theme="light"] .sidebar {
    background: var(--glass-bg-light);
    border-right-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border-dark);
}

body[data-theme="light"] .sidebar-header {
    border-bottom-color: var(--glass-border-light);
}

.sidebar-header i {
    font-size: 28px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 28px;
}

.sidebar-header span {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-header span,
.sidebar.expanded .sidebar-header span {
    opacity: 1;
}

.sidebar-content {
    padding: 20px 16px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.new-chat-btn span {
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .new-chat-btn span,
.sidebar.expanded .new-chat-btn span {
    opacity: 1;
}

#conversationsList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conv-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.conv-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.conv-item.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
    border-left: 3px solid var(--primary);
}

.conv-title {
    flex: 1;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-btn {
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.conv-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* ==================== MAIN CONTENT ==================== */
.main {
    margin-left: 80px;
    width: calc(100vw - 80px);
    min-height: 100vh;
    position: relative;
    transition: margin-left 0.3s;
}

.sidebar:hover + .main,
.sidebar.expanded + .main {
    margin-left: 280px;
    width: calc(100vw - 280px);
}

/* ==================== MAGICAL ORB ==================== */
.orb-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.orb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(102, 126, 234, 0.9),
        rgba(118, 75, 162, 0.7),
        rgba(139, 92, 246, 0.5)
    );
    box-shadow:
        0 0 40px rgba(102, 126, 234, 0.6),
        0 0 80px rgba(118, 75, 162, 0.4),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    animation: orbPulse 4s ease-in-out infinite;
    transition: all 0.3s;
}

.orb:hover {
    transform: scale(1.2);
    box-shadow:
        0 0 50px rgba(102, 126, 234, 0.8),
        0 0 100px rgba(118, 75, 162, 0.6),
        inset 0 0 50px rgba(255, 255, 255, 0.2);
}

.orb::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, rgba(255,255,255,0.6), transparent);
    border-radius: 50%;
    filter: blur(8px);
}

@keyframes orbPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        transform: scale(1.08);
        opacity: 0.95;
        filter: brightness(1.2);
    }
}

/* ==================== CHAT INPUT CONTAINER ==================== */
.chat-input-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    z-index: 200;
    transition: all 0.3s;
}

.glass-box {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border-dark);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--glass-shadow-dark);
}

body[data-theme="light"] .glass-box {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

#chatInput {
    width: 100%;
    min-height: 60px;
    max-height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    color: inherit;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body[data-theme="light"] #chatInput {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.input-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.model-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.model-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.send-btn {
    width: 52px;
    height: 52px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

/* ==================== MODEL DROPDOWN ==================== */
.model-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    z-index: 300;
}

body[data-theme="light"] .model-dropdown {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

.model-option {
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.model-option:last-child {
    margin-bottom: 0;
}

.model-option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.model-option.active {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.2),
        rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.model-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.model-option .icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.model-option .info {
    flex: 1;
}

.model-option strong {
    display: block;
    font-size: 15px;
    margin-bottom: 3px;
}

.model-option small {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

.model-option .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.badge.active {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.badge.soon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge.premium {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* ==================== CHAT ARTIFACT ==================== */
.chat-artifact {
    position: fixed;
    right: 40px;
    top: 40px;
    width: 600px;
    max-width: calc(100vw - 160px);
    height: calc(100vh - 100px);
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border-dark);
    border-radius: 20px;
    box-shadow: var(--glass-shadow-dark);
    display: flex;
    flex-direction: column;
    z-index: 150;
    transition: all 0.3s;
}

body[data-theme="light"] .chat-artifact {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

.chat-artifact.minimized {
    height: 60px;
}

.chat-artifact.minimized .messages {
    display: none;
}

.chat-artifact.maximized {
    width: calc(100vw - 120px);
    height: calc(100vh - 80px);
    right: 40px;
    top: 40px;
}

.artifact-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

body[data-theme="light"] .artifact-header {
    border-bottom-color: var(--glass-border-light);
}

.artifact-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.artifact-header i {
    color: var(--primary);
}

.controls {
    display: flex;
    gap: 8px;
}

.controls button {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Custom scrollbar */
.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: messageSlide 0.3s ease-out;
}

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

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message.user .avatar {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.content {
    max-width: 80%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    line-height: 1.6;
    font-size: 15px;
}

body[data-theme="light"] .content {
    background: rgba(0, 0, 0, 0.03);
}

.message.user .content {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.15),
        rgba(118, 75, 162, 0.15));
}

/* ==================== SIDEBAR FOOTER ==================== */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    border-top: 1px solid var(--glass-border-dark);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body[data-theme="light"] .sidebar-footer {
    border-top-color: var(--glass-border-light);
}

.clear-all-btn,
.dashboard-link {
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    text-decoration: none;
}

.dashboard-link {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.clear-all-btn:hover,
.dashboard-link:hover {
    transform: translateX(4px);
    background: rgba(239, 68, 68, 0.2);
}

.dashboard-link:hover {
    background: rgba(59, 130, 246, 0.2);
}

.clear-all-btn span,
.dashboard-link span {
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .clear-all-btn span,
.sidebar.expanded .clear-all-btn span,
.sidebar:hover .dashboard-link span,
.sidebar.expanded .dashboard-link span {
    opacity: 1;
}

/* ==================== FLOATING ACTION BUTTONS ==================== */
.fab-cluster {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 300;
}

.fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-dark);
    box-shadow: var(--glass-shadow-dark);
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] .fab {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
    color: var(--text-light);
}

.fab:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

.fab-theme {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-color: rgba(245, 158, 11, 0.3);
}

.fab-background {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: rgba(139, 92, 246, 0.3);
}

/* ==================== BACKGROUND MENU ==================== */
.bg-menu {
    position: fixed;
    bottom: 120px;
    right: 30px;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    z-index: 250;
    min-width: 200px;
}

body[data-theme="light"] .bg-menu {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.bg-menu div {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.bg-menu div:last-child {
    margin-bottom: 0;
}

.bg-menu div:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

/* ==================== BACKGROUND CANVAS ==================== */
#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }

    .sidebar.expanded {
        width: 280px;
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100vw;
    }

    .chat-input-container {
        width: 95%;
    }

    .chat-artifact {
        width: calc(100vw - 40px);
        right: 20px;
        top: 20px;
        height: calc(100vh - 40px);
    }

    .fab-cluster {
        bottom: 20px;
        right: 20px;
    }

    .fab {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .orb {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .chat-input-container {
        width: 100%;
        max-width: none;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 20px 20px 0 0;
    }

    .orb {
        width: 80px;
        height: 80px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== UTILITY CLASSES ==================== */
.glass {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border-dark);
    box-shadow: var(--glass-shadow-dark);
}

body[data-theme="light"] .glass {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

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

/* ==================== LOADING STATES ==================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary);
    margin-left: 4px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

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

.model-badge {
    margin-top: 8px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(102,126,234,0.15), rgba(118,75,162,0.15));
    border: 1px solid rgba(102,126,234,0.3);
    border-radius: 8px;
    font-size: 11px;
    color: var(--primary);
    display: inline-block;
}

.model-badge i {
    margin-right: 4px;
}

/* ==================== THEME TRANSITIONS ==================== */
* {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Disable transitions during theme switch for instant change */
body.theme-switching * {
    transition: none !important;
}

/* ==================== ARTIFACT WINDOWS ==================== */
.artifact-window {
    position: fixed;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 200;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] .artifact-window {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    box-shadow: var(--glass-shadow-light);
}

.artifact-window.minimized {
    height: 60px !important;
}

.artifact-window.minimized .artifact-body {
    display: none;
}

.artifact-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.artifact-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.artifact-header i {
    color: var(--primary);
}

.artifact-controls {
    display: flex;
    gap: 6px;
}

.artifact-controls button {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.artifact-controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.artifact-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

.artifact-body::-webkit-scrollbar {
    width: 6px;
}

.artifact-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.artifact-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.artifact-footer {
    padding: 10px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    opacity: 0.5;
    text-align: center;
}

.artifact-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.spinner-artifact {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* YouTube Artifact Specific Styles */
.youtube-search-section {
    text-align: center;
    padding: 20px;
}

.youtube-search-section h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    opacity: 0.8;
}

.search-query {
    background: rgba(102, 126, 234, 0.1);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
}

.youtube-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.youtube-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.suggested-topics {
    margin-top: 20px;
}

.suggested-topics h5 {
    margin: 0 0 14px 0;
    font-size: 14px;
    opacity: 0.8;
}

.topic-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.topic-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-left: 3px solid var(--primary);
}

.topic-link i {
    color: #FF0000;
}

.video-card-youtube {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.video-card-youtube:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.video-card-info {
    padding: 12px 14px;
}

.video-card-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.video-card-info p {
    font-size: 12px;
    opacity: 0.7;
    margin: 0;
}

.video-card-info i {
    font-size: 10px;
    margin-right: 4px;
}

.error {
    color: #ef4444;
    text-align: center;
    padding: 40px 20px;
}

/* YouTube Playlist Grid Styles */
.video-playlist-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
}

.video-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.video-thumbnail {
    width: 112px;
    height: 63px;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.video-thumbnail i.fa-youtube {
    font-size: 32px;
    color: white;
    opacity: 0.3;
}

.play-overlay {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF0000;
    font-size: 12px;
    padding-left: 2px;
}

.video-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.video-title {
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 10px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-desc {
    font-size: 10px;
    opacity: 0.6;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Artifact z-index - behind chat input */
.artifact-window {
    z-index: 150 !important;
}

.chat-input-container {
    z-index: 200 !important;
}

/* Enhanced Mobile Optimizations */
@media (max-width: 768px) {
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        max-width: 85%;
        font-size: 15px;
    }
    
    .chat-input {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px 15px;
    }
    
    .send-button,
    .attach-button {
        min-width: 44px;
        min-height: 44px; /* Touch-friendly */
    }
}

@media (max-width: 480px) {
    .guru-header {
        padding: 12px 15px;
        font-size: 1.1rem;
    }
    
    .message {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .fab-cluster {
        bottom: 15px;
        right: 15px;
    }
}
