/**
 * Rose AI Assistant - Modern Chat Interface Styles
 */

/* Force full viewport - Override WordPress and theme styles */
body.rose-ai-page,
html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
}

/* Hide all WordPress admin elements except our chat */
body.rose-ai-page #wpadminbar,
body.rose-ai-page #adminmenumain,
body.rose-ai-page #adminmenuback,
body.rose-ai-page #wpfooter,
body.rose-ai-page .update-nag,
body.rose-ai-page .notice,
body.rose-ai-page .admin-bar,
body.rose-ai-page footer,
body.rose-ai-page .site-footer,
body.rose-ai-page .footer {
    display: none !important;
}

/* Hide site theme elements when Rose AI shortcode is present */
body:has(.rose-ai-wrap) header,
body:has(.rose-ai-wrap) .site-header,
body:has(.rose-ai-wrap) nav,
body:has(.rose-ai-wrap) .nav,
body:has(.rose-ai-wrap) .navigation,
body:has(.rose-ai-wrap) footer,
body:has(.rose-ai-wrap) .site-footer,
body:has(.rose-ai-wrap) .footer,
body:has(.rose-ai-wrap) .elementor-location-header,
body:has(.rose-ai-wrap) .elementor-location-footer {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Force body to hide overflow when Rose AI is active */
body:has(.rose-ai-wrap) {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Force WordPress content area to full viewport */
body.rose-ai-page #wpcontent,
body.rose-ai-page #wpbody,
body.rose-ai-page #wpbody-content {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
}

/* Reset and Base Styles */
.rose-ai-wrap {
    margin: 0 !important;
    padding: 0 !important;
    background: #f8f9fa;
    min-height: 100vh !important;
    height: 100vh !important;
    overflow: hidden;
    width: 100% !important;
    max-width: 100vw;
    box-sizing: border-box;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999 !important; /* Above everything */
}

/* Desktop only - Add space for floating menu on the right */
@media (min-width: 1025px) {
    .rose-ai-wrap {
        margin-right: 120px; /* Space for floating menu + buffer */
    }
}

.rose-ai-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
.rose-ai-header {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Header Controls (Left & Right) */
.rose-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rose-header-left {
    justify-content: flex-start;
    flex: 1;
}

.rose-header-right {
    justify-content: flex-end;
    flex: 1;
}

/* Center Logo */
.rose-ai-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .rose-ai-logo {
        position: static;
        transform: none;
        flex: 0;
    }
}

.rose-ai-logo svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    width: 28px;
    height: 28px;
}

/* Robot logo image */
.rose-logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.rose-ai-logo h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Rose header title with adaptive colors */
.rose-header-title {
    color: white !important;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: visible;
}

/* Desktop: Always white on purple gradient background */
@media (min-width: 769px) {
    .rose-header-title {
        color: white !important;
    }
}

/* Mobile: White text always for consistent branding */
@media (max-width: 768px) {
    .rose-header-title {
        color: #ffffff !important;
        white-space: nowrap;
    }
    
    /* Keep white in dark mode too */
    body.dark-mode .rose-header-title,
    .rose-ai-header.dark-mode .rose-header-title {
        color: #ffffff !important;
    }
}

.rose-ai-subtitle {
    display: none;
}

/* Auto-speak toggle button */
.rose-auto-speak-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rose-auto-speak-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.rose-auto-speak-toggle.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.rose-auto-speak-toggle:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

.rose-auto-speak-toggle:not(.active):hover {
    opacity: 1;
}

.rose-auto-speak-toggle.active .sound-waves {
    animation: soundWave 1.5s ease-in-out infinite;
}

@keyframes soundWave {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Hide mode selector - no longer used */
.rose-ai-mode-selector,
#rose-mode-select {
    display: none !important;
}

/* Add Task Button */
.rose-add-task-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.rose-add-task-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.rose-add-task-btn svg {
    flex-shrink: 0;
}

/* New chat controls in suggestions area */
.rose-new-chat-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: white;
    color: #7C3AED;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #7C3AED;
}

.rose-new-chat-btn:hover {
    background: #7C3AED;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.2);
}

.rose-conversation-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: 2px solid #e5e7eb;
}

.rose-conversation-indicator.active {
    background: white;
    color: #7C3AED;
    border-color: #7C3AED;
}

.rose-conversation-indicator #rose-msg-count {
    font-weight: 700;
    min-width: 12px;
    text-align: center;
}

/* Chat Area - Default Light Mode */
.rose-ai-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    transition: background-color 0.3s ease;
}

.rose-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: #ffffff;
    transition: background-color 0.3s ease;
}

/* Messages */
.rose-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rose-message-ai {
    align-self: flex-start;
}

.rose-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.rose-message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    overflow: hidden;
}

/* Robot avatar image */
.rose-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.rose-message-user .rose-message-avatar {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.rose-message-content {
    flex: 1;
}

.rose-message-text {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.rose-message-user .rose-message-text {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    color: white;
}

.rose-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 6px;
}

/* Plan Display */
.rose-plan-display {
    margin-top: 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.rose-plan-display h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.rose-plan-summary {
    background: #f9fafb;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    white-space: pre-line;
    font-size: 12px;
    line-height: 1.5;
}

.rose-schedule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.rose-schedule-item:hover {
    background: #f3f4f6;
    transform: translateX(2px);
}

.rose-schedule-time {
    font-weight: 600;
    color: #7C3AED;
    font-size: 12px;
    min-width: 80px;
}

.rose-schedule-task {
    flex: 1;
    font-size: 12px;
    color: #4b5563;
}

.rose-insights {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #1e40af;
}

/* Suggestions - Compact List Design */
.rose-ai-suggestions {
    padding: 8px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
}

.rose-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rose-suggestion-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rose-suggestion-btn:hover {
    background: #f3f4f6;
    color: #7C3AED;
}

.rose-suggestion-btn:active {
    background: #e5e7eb;
    color: #6D28D9;
}

/* Action buttons within messages (e.g., statistics suggestions) - Replit style */
.rose-suggestion-action-btn {
    padding: 8px 16px !important;
    background: #4a4a4a !important;
    border: 1px solid #5a5a5a !important;
    border-radius: 6px !important;
    color: #e0e0e0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

.rose-suggestion-action-btn:hover {
    background: #5a5a5a !important;
    border-color: #6a6a6a !important;
    transform: none !important;
    box-shadow: none !important;
}

.rose-suggestion-action-btn:active {
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4) !important;
}

/* Input Area */
.rose-ai-input-area {
    padding: 10px 16px 0 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

.rose-ai-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    padding: 10px 12px;
    transition: all 0.2s;
    margin-bottom: 0 !important;
}

.rose-ai-input-wrapper:focus-within {
    border-color: #7C3AED;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.rose-ai-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-height: 120px;
}

.rose-ai-input::placeholder {
    color: #9ca3af;
}

.rose-voice-btn,
.rose-conversation-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rose-voice-btn:hover:not(:disabled),
.rose-conversation-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.rose-voice-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rose-voice-btn.listening {
    background: #EF4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.rose-conversation-btn.active {
    background: #7C3AED;
    color: white;
    animation: pulse-conversation 2s ease-in-out infinite;
}

@keyframes pulse-conversation {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(124, 58, 237, 0);
    }
}

.rose-ai-send-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rose-ai-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.rose-ai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Speaking Waves */
.rose-speaking-waves {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #7C3AED10 0%, #9333EA10 100%);
    border-radius: 8px;
}

.rose-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
}

.rose-wave-bar {
    width: 4px;
    background: linear-gradient(180deg, #7C3AED 0%, #9333EA 100%);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.rose-wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.rose-wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.rose-wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.rose-wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.rose-wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% {
        height: 10px;
        opacity: 0.4;
    }
    50% {
        height: 40px;
        opacity: 1;
    }
}

.rose-wave-text {
    font-size: 14px;
    font-weight: 500;
    color: #7C3AED;
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Loading State */
.rose-loading {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
}

.rose-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: bounce 1.4s infinite ease-in-out;
}

.rose-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.rose-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Updates Panel */
.rose-ai-updates-panel {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rose-updates-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.rose-updates-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rose-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.rose-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.rose-updates-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.rose-update-item {
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid #7C3AED;
}

.rose-update-action {
    font-weight: 600;
    color: #7C3AED;
    margin-bottom: 4px;
}

.rose-updates-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.rose-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rose-btn-primary {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    color: white;
}

.rose-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.rose-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.rose-btn-secondary:hover {
    background: #e5e7eb;
}

/* Text List Hyperlinks */
.rose-text-list {
    margin-top: 12px;
    line-height: 1.8;
}

.rose-task-link,
.rose-team-link {
    color: #7C3AED !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}

.rose-task-link:hover,
.rose-team-link:hover {
    color: #9333EA !important;
    border-bottom: 1px solid #9333EA;
    text-decoration: none !important;
}

.rose-task-link:active,
.rose-team-link:active {
    color: #6D28D9 !important;
}

/* Mobile dark theme link colors */
@media (max-width: 768px) {
    .rose-task-link,
    .rose-team-link {
        color: #a78bfa !important;
    }
    
    .rose-task-link:hover,
    .rose-team-link:hover {
        color: #c4b5fd !important;
        border-bottom-color: #c4b5fd;
    }
}

/* Scrollbar Styles */
.rose-ai-messages::-webkit-scrollbar,
.rose-updates-content::-webkit-scrollbar {
    width: 8px;
}

.rose-ai-messages::-webkit-scrollbar-track,
.rose-updates-content::-webkit-scrollbar-track {
    background: transparent;
}

.rose-ai-messages::-webkit-scrollbar-thumb,
.rose-updates-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.rose-ai-messages::-webkit-scrollbar-thumb:hover,
.rose-updates-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .rose-ai-container {
        height: 100vh;
    }

    .rose-ai-messages {
        padding: 16px;
    }

    .rose-message {
        max-width: 85%;
    }
    
    .rose-ai-wrap {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Full viewport mobile styles - Replit-inspired */
    body.wp-admin {
        overflow-x: hidden;
        background: #1a1a1a;
    }
    
    .rose-ai-wrap {
        margin: 0;
        padding: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        background: #1a1a1a;
    }

    .rose-ai-container {
        border-radius: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        width: 100vw;
        max-width: 100vw;
        position: relative;
        overflow-x: hidden;
        background: #1a1a1a;
    }
    
    /* Fixed header at top - Replit style */
    .rose-ai-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 12px 16px;
        z-index: 100;
        box-sizing: border-box;
        background: #2a2a2a;
        border-bottom: 1px solid #3a3a3a;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Mobile View Toggle Button - Only visible on mobile */
    .rose-mobile-view-toggle {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: rgba(124, 58, 237, 0.15);
        border: 1px solid rgba(124, 58, 237, 0.3);
        border-radius: 8px;
        color: #7C3AED;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 13px;
        font-weight: 500;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .rose-mobile-view-toggle:hover {
        background: rgba(124, 58, 237, 0.25);
        border-color: rgba(124, 58, 237, 0.5);
    }
    
    .rose-mobile-view-toggle .view-label {
        color: #a78bfa;
        font-size: 12px;
    }
    
    /* Mobile view states - show chat by default */
    .rose-ai-container.mobile-view-chat .rose-ai-chat-area {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 50;
    }
    
    .rose-ai-container.mobile-view-chat .rose-ai-content-panel {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        z-index: -1 !important;
    }
    
    /* Mobile view visual - hide chat, show content */
    .rose-ai-container.mobile-view-visual .rose-ai-chat-area {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        z-index: -1 !important;
    }
    
    .rose-ai-container.mobile-view-visual .rose-ai-content-panel {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column;
        position: fixed;
        top: 60px;
        bottom: 140px;
        left: 0;
        right: 0;
        width: 100%;
        overflow: hidden;
        background: #1a1a1a;
        z-index: 50;
    }
    
    /* Content panel header - mobile dark theme */
    .rose-ai-container.mobile-view-visual .rose-content-panel-header {
        background: #2a2a2a;
        border-bottom: 1px solid #3a3a3a;
        padding: 12px 16px;
    }
    
    .rose-ai-container.mobile-view-visual .rose-content-panel-header h3 {
        color: #e0e0e0;
        font-size: 15px;
    }
    
    /* Content panel body - mobile dark theme */
    .rose-ai-container.mobile-view-visual .rose-content-panel-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        background: #1a1a1a;
    }
    
    /* Content items in mobile visual panel - dark theme */
    .rose-ai-container.mobile-view-visual .rose-task-card,
    .rose-ai-container.mobile-view-visual .rose-team-card {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .rose-ai-container.mobile-view-visual .rose-task-card:hover,
    .rose-ai-container.mobile-view-visual .rose-team-card:hover {
        background: #2f2f2f;
        border-color: #7C3AED;
    }
    
    .rose-ai-container.mobile-view-visual .rose-task-card-title,
    .rose-ai-container.mobile-view-visual .rose-team-name {
        color: #e0e0e0;
    }
    
    .rose-ai-container.mobile-view-visual .rose-task-card-description,
    .rose-ai-container.mobile-view-visual .rose-team-role {
        color: #a0a0a0;
    }
    
    .rose-ai-container.mobile-view-visual .rose-stats-display {
        background: #2a2a2a;
        border: 1px solid #3a3a3a;
    }
    
    .rose-ai-container.mobile-view-visual .rose-stats-display h4 {
        color: #e0e0e0;
    }
    
    .rose-ai-container.mobile-view-visual .rose-stat-card {
        background: #1a1a1a;
        border-color: #3a3a3a;
    }
    
    .rose-ai-container.mobile-view-visual .rose-content-empty {
        color: #888;
    }
    
    .rose-ai-container.mobile-view-visual .rose-content-empty h4 {
        color: #a0a0a0;
    }
    
    .rose-ai-container.mobile-view-visual .rose-content-empty p {
        color: #888;
    }
    
    /* Chat area with proper spacing for fixed header and bottom bar */
    .rose-ai-chat-area {
        position: fixed;
        top: 60px; /* Height of header */
        bottom: 140px; /* Space for input + bottom nav */
        left: 0;
        right: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
        background: #1a1a1a;
        z-index: 50;
    }
    
    /* Messages area - scrollable with dark theme */
    .rose-ai-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 16px 12px;
        gap: 16px;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        box-sizing: border-box;
        background: #1a1a1a;
    }
    
    /* Dark theme message bubbles */
    .rose-message-text {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .rose-message-user .rose-message-text {
        background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
        color: white;
    }
    
    /* Suggestions area - mobile dark theme compact list */
    .rose-ai-suggestions {
        display: none; /* Hidden by default, shown via JS */
        position: fixed;
        bottom: 120px; /* Above input and bottom nav */
        left: 0;
        right: 0;
        background: #2a2a2a;
        border-top: 1px solid #3a3a3a;
        padding: 8px;
        z-index: 85;
        max-height: 30vh;
        overflow-y: auto;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .rose-ai-suggestions.visible {
        display: block !important;
    }
    
    .rose-suggestions-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    /* Suggestion buttons - mobile compact list */
    .rose-ai-suggestions .rose-suggestion-btn {
        padding: 8px 12px;
        background: transparent;
        border: none;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
        color: #888;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .rose-ai-suggestions .rose-suggestion-btn:hover,
    .rose-ai-suggestions .rose-suggestion-btn:active {
        background: #3a3a3a;
        color: #a78bfa;
    }
    
    /* Input area - fixed at bottom with Replit style */
    .rose-ai-input-area {
        position: fixed;
        bottom: 60px; /* Above bottom nav */
        left: 0;
        right: 0;
        padding: 12px;
        padding-bottom: 12px;
        background: #2a2a2a;
        border-top: 1px solid #3a3a3a;
        box-sizing: border-box;
        width: 100%;
        z-index: 90;
    }

    .rose-ai-logo {
        white-space: nowrap;
        flex-wrap: nowrap;
    }
    
    .rose-ai-logo h1 {
        font-size: 16px;
        white-space: nowrap;
    }

    .rose-ai-logo svg,
    .rose-logo-image {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    
    /* Hide Add Task button text on mobile, show only icon */
    .rose-add-task-btn {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }
    
    .rose-add-task-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Hide desktop split-view toggle on mobile */
    .rose-split-view-toggle {
        display: none !important;
    }
    
    /* Ensure auto-speak toggle is visible on mobile */
    .rose-auto-speak-toggle {
        padding: 8px;
    }
    
    .rose-auto-speak-toggle svg {
        width: 20px;
        height: 20px;
    }

    .rose-message {
        max-width: 92%;
    }

    .rose-message-avatar {
        width: 32px;
        height: 32px;
    }

    .rose-message-avatar svg {
        width: 24px;
        height: 24px;
    }

    .rose-message-text {
        font-size: 14px;
        padding: 10px 14px;
        border-radius: 14px;
    }

    .rose-ai-input-wrapper {
        padding: 10px 12px;
        gap: 10px;
        box-sizing: border-box;
        background: #3a3a3a;
        border: 1px solid #4a4a4a;
        border-radius: 12px;
    }

    .rose-ai-input {
        font-size: 15px;
        background: transparent;
        color: #e0e0e0;
    }
    
    .rose-ai-input::placeholder {
        color: #888;
    }

    .rose-voice-btn,
    .rose-conversation-btn,
    .rose-ai-send-btn {
        width: 38px;
        height: 38px;
        background: transparent;
        border: 1px solid #4a4a4a;
    }
    
    .rose-voice-btn:hover,
    .rose-conversation-btn:hover {
        background: #4a4a4a;
    }

    .rose-voice-btn svg,
    .rose-conversation-btn svg {
        width: 20px;
        height: 20px;
        stroke: #e0e0e0;
    }

    .rose-ai-send-btn svg {
        width: 20px;
        height: 20px;
        stroke: white;
    }
    
    /* Bottom Navigation Bar - Replit style (show on mobile) */
    .rose-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #2a2a2a;
        border-top: 1px solid #3a3a3a;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        box-sizing: border-box;
        z-index: 95;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Bottom Nav Left & Right */
    .rose-bottom-nav-left,
    .rose-bottom-nav-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }
    
    .rose-bottom-nav-left {
        justify-content: flex-start;
    }
    
    .rose-bottom-nav-right {
        justify-content: flex-end;
    }
    
    /* Bottom Nav Center (Logo & Name) */
    .rose-bottom-nav-center {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .rose-bottom-logo {
        width: 28px;
        height: 28px;
        object-fit: contain;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }
    
    .rose-bottom-name {
        font-size: 14px;
        font-weight: 600;
        color: white;
        letter-spacing: 0.5px;
    }
    
    .rose-bottom-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #888;
        cursor: pointer;
        padding: 8px 12px;
        transition: all 0.2s;
        gap: 4px;
    }
    
    .rose-bottom-nav-btn.active {
        color: #7C3AED;
    }
    
    .rose-bottom-nav-btn:hover {
        color: #a78bfa;
    }
    
    .rose-bottom-nav-btn svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
    }
    
    .rose-bottom-nav-label {
        font-size: 10px;
        font-weight: 500;
    }
    
    /* Mobile theme toggle icon visibility and interaction */
    #rose-theme-toggle-mobile {
        outline: none;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }
    
    #rose-theme-toggle-mobile .sun-icon,
    #rose-theme-toggle-mobile .moon-icon {
        width: 24px;
        height: 24px;
        pointer-events: none;
    }

    .rose-ai-updates-panel {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
    }

    .rose-ai-suggestions {
        padding: 8px 12px;
        gap: 6px;
    }

    .rose-suggestion-btn,
    .rose-new-chat-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .rose-conversation-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }

    .rose-task-cards {
        gap: 10px;
    }

    .rose-task-card {
        padding: 12px;
    }
    
    .rose-task-card:active {
        background: #f9fafb;
    }

    .rose-task-card-title {
        font-size: 14px;
    }

    .rose-task-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .rose-plan-display {
        padding: 10px;
    }

    .rose-plan-display h4 {
        font-size: 13px;
    }

    .rose-plan-summary {
        font-size: 12px;
        padding: 8px 10px;
    }

    .rose-schedule-item {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .rose-schedule-time {
        font-size: 11px;
        min-width: 70px;
    }
    
    .rose-insights {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .rose-ai-header {
        padding: 6px 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .rose-ai-logo h1 {
        font-size: 15px;
        white-space: nowrap;
    }

    .rose-ai-logo svg,
    .rose-logo-image {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }
    
    .rose-ai-chat-area {
        top: 50px; /* Smaller header on very small screens */
    }

    .rose-message {
        max-width: 95%;
    }

    .rose-message-text {
        font-size: 13px;
        padding: 9px 12px;
    }

    .rose-ai-input-area {
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .rose-voice-btn,
    .rose-conversation-btn,
    .rose-ai-send-btn {
        width: 34px;
        height: 34px;
    }

    .rose-suggestion-btn,
    .rose-new-chat-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .rose-conversation-indicator {
        font-size: 11px;
        padding: 5px 10px;
    }

    .rose-task-card-title {
        font-size: 13px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .rose-ai-logo h1 {
        font-size: 14px;
        white-space: nowrap;
    }

    .rose-message-text {
        font-size: 12px;
    }

    .rose-suggestion-btn,
    .rose-new-chat-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .rose-ai-chat-area {
        top: 48px;
    }
}

/* iOS-specific fixes for keyboard behavior */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    @media (max-width: 768px) {
        .rose-ai-container {
            height: 100vh;
            min-height: -webkit-fill-available;
        }
        
        .rose-ai-messages {
            /* Allow smooth scrolling when keyboard opens */
            padding-bottom: 20px;
        }
    }
}

/* Prevent horizontal scroll on all mobile devices */
@media (max-width: 768px) {
    * {
        max-width: 100vw;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
}

/* Task Cards */
.rose-task-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.rose-task-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.rose-task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #7C3AED 0%, #9333EA 100%);
    border-radius: 12px 0 0 12px;
    transition: width 0.3s ease;
    opacity: 0;
}

.rose-task-card:hover {
    border-color: #7C3AED;
    box-shadow: 0 8px 16px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.rose-task-card:hover::before {
    width: 6px;
    opacity: 1;
}

.rose-task-card:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.1);
}

.rose-task-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.rose-task-status {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    margin-top: 2px;
}

.rose-task-status-todo {
    background: #FEF3C7;
    color: #F59E0B;
}

.rose-task-status-doing {
    background: #DBEAFE;
    color: #3B82F6;
}

.rose-task-status-done {
    background: #D1FAE5;
    color: #10B981;
}

.rose-task-card-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.rose-task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.rose-task-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.rose-task-card-description {
    margin: 12px 0 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

@media (max-width: 900px) {
    .rose-task-cards {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .rose-task-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Team Member Cards */
.rose-team-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.rose-team-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rose-team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(124, 58, 237, 0.15);
    border-color: #7C3AED;
}

.rose-team-card.has-active {
    border-color: #10B981;
}

.rose-team-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rose-team-avatar {
    flex-shrink: 0;
}

.rose-team-avatar svg {
    width: 36px !important;
    height: 36px !important;
}

.rose-team-info {
    flex: 1;
    min-width: 0;
}

.rose-team-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rose-team-role {
    font-size: 11px;
    color: #6b7280;
}

.rose-team-card-stats {
    display: flex;
    gap: 8px;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.rose-team-stat {
    text-align: center;
    flex: 1;
}

.rose-team-stat-number {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.rose-team-stat-label {
    display: block;
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.rose-team-stat-open .rose-team-stat-number {
    color: #F59E0B;
}

.rose-team-stat-closed .rose-team-stat-number {
    color: #10B981;
}

/* Mobile responsive for team cards */
@media (max-width: 768px) {
    .rose-team-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .rose-team-card {
        padding: 12px;
    }
    
    .rose-team-name {
        font-size: 14px;
    }
    
    .rose-team-stat-number {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rose-team-card-header {
        gap: 10px;
    }
    
    .rose-team-avatar svg {
        width: 36px;
        height: 36px;
    }
    
    .rose-team-stat-number {
        font-size: 15px;
    }
    
    .rose-team-stat-label {
        font-size: 9px;
    }
}

/* Statistics Display */
.rose-stats-display {
    margin-top: 12px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
}

.rose-stats-display h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rose-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

.rose-stat-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.2s;
}

.rose-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rose-stat-closed {
    border-color: #10B981;
    background: #D1FAE5;
}

.rose-stat-approved {
    border-color: #3B82F6;
    background: #DBEAFE;
}

.rose-stat-rejected {
    border-color: #EF4444;
    background: #FEE2E2;
}

.rose-stat-created {
    border-color: #8B5CF6;
    background: #EDE9FE;
}

.rose-stat-rate {
    border-color: #F59E0B;
    background: #FEF3C7;
}

.rose-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 6px;
}

.rose-stat-closed .rose-stat-number {
    color: #10B981;
}

.rose-stat-approved .rose-stat-number {
    color: #3B82F6;
}

.rose-stat-rejected .rose-stat-number {
    color: #EF4444;
}

.rose-stat-created .rose-stat-number {
    color: #8B5CF6;
}

.rose-stat-rate .rose-stat-number {
    color: #F59E0B;
}

.rose-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rose-stats-insights {
    margin-top: 12px;
    padding: 10px 12px;
    background: white;
    border-left: 3px solid #7C3AED;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

/* Chart Container */
.rose-chart-container {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.rose-chart-container canvas {
    max-height: 200px;
}

/* Responsive Statistics */
@media (max-width: 768px) {
    .rose-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .rose-stat-number {
        font-size: 20px;
    }
    
    .rose-stat-card {
        padding: 8px 6px;
    }
    
    .rose-chart-container {
        max-width: 100%;
        padding: 10px;
    }
    
    /* Make tables responsive on mobile */
    .rose-stats-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rose-stats-table {
        min-width: 100%;
        font-size: 12px !important;
    }
    
    .rose-stats-table th {
        padding: 8px 10px !important;
        font-size: 10px !important;
        white-space: nowrap;
    }
    
    .rose-stats-table td {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .rose-stats-display {
        padding: 12px;
        margin: 0;
    }
    
    .rose-stats-display h4 {
        font-size: 15px !important;
        margin-bottom: 12px !important;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 480px) {
        .rose-stats-table {
            display: block;
            overflow-x: auto;
        }
        
        .rose-stats-table thead {
            display: block;
        }
        
        .rose-stats-table tbody {
            display: block;
        }
        
        .rose-stats-table tr {
            display: block;
            margin-bottom: 10px;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            padding: 8px;
        }
        
        .rose-stats-table td {
            display: block;
            text-align: left !important;
            padding: 6px 8px !important;
            border: none !important;
        }
        
        .rose-stats-table td:first-child {
            font-weight: 700;
            color: #7C3AED;
            font-size: 14px !important;
            margin-bottom: 6px;
        }
        
        .rose-stats-table thead {
            display: none;
        }
    }
}

@media (max-width: 480px) {
    .rose-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .rose-stat-number {
        font-size: 18px;
    }
    
    .rose-stat-label {
        font-size: 10px;
    }
    
    .rose-chart-container {
        padding: 8px;
    }
    
    .rose-chart-container canvas {
        max-height: 180px;
    }
}

/* ========================================
   SPLIT-SCREEN VIEW (Replit-style)
   ======================================== */

/* Bottom Navigation - Hidden on Desktop */
.rose-bottom-nav {
    display: none;
}

/* Mobile View Toggle - Hidden on Desktop, Visible on Mobile */
@media (min-width: 769px) {
    .rose-mobile-view-toggle {
        display: none !important;
    }
}

/* Default: Hide on desktop */
.rose-mobile-view-toggle {
    display: none;
}

/* Header Controls Group - Already defined above, removed duplicate */

/* Split View Toggle Button */
.rose-split-view-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rose-split-view-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.rose-split-view-toggle.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Theme Toggle Button */
.rose-theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rose-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ========================================
   LIGHT MODE (Explicit Overrides)
   Note: Base styles above define light mode defaults
   This section ensures light mode is enforced
   ======================================== */

/* Light Mode - Force light colors when dark-mode class is NOT present */
.rose-ai-chat-area:not(.dark-mode) {
    background: #ffffff !important;
}

.rose-ai-chat-area:not(.dark-mode) .rose-ai-messages {
    background: #ffffff !important;
}

.rose-ai-chat-area:not(.dark-mode) .rose-message-text {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
}

.rose-ai-chat-area:not(.dark-mode) .rose-message-user .rose-message-text {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%) !important;
    color: white !important;
}

.rose-ai-chat-area:not(.dark-mode) .rose-message-time {
    color: #9ca3af !important;
}

/* Light Mode - Suggestions */
.rose-ai-suggestions:not(.dark-mode) {
    background: #fafafa !important;
    border-top-color: #e5e7eb !important;
}

.rose-ai-suggestions:not(.dark-mode) .rose-suggestion-btn {
    color: #6b7280 !important;
}

.rose-ai-suggestions:not(.dark-mode) .rose-suggestion-btn:hover {
    background: #f3f4f6 !important;
    color: #7C3AED !important;
}

/* Light Mode - Input Area */
.rose-ai-input-area:not(.dark-mode) {
    background: white !important;
    border-top-color: #e5e7eb !important;
}

.rose-ai-input-area:not(.dark-mode) .rose-ai-input-wrapper {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
}

.rose-ai-input-area:not(.dark-mode) .rose-ai-input {
    background: transparent !important;
    color: #1f2937 !important;
}

.rose-ai-input-area:not(.dark-mode) .rose-ai-input::placeholder {
    color: #9ca3af !important;
}

.rose-ai-input-area:not(.dark-mode) .rose-voice-btn,
.rose-ai-input-area:not(.dark-mode) .rose-conversation-btn {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

.rose-ai-input-area:not(.dark-mode) .rose-voice-btn:hover,
.rose-ai-input-area:not(.dark-mode) .rose-conversation-btn:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
}

/* Light Mode - Content Panel */
.rose-ai-content-panel:not(.dark-mode) {
    background: #fafafa !important;
}

.rose-ai-content-panel:not(.dark-mode) .rose-content-panel-header {
    background: white !important;
    border-bottom-color: #e5e7eb !important;
}

.rose-ai-content-panel:not(.dark-mode) .rose-content-panel-header h3 {
    color: #1f2937 !important;
}

.rose-ai-content-panel:not(.dark-mode) .rose-content-panel-body {
    background: #fafafa !important;
}

/* Light Mode - Bottom Navigation */
.rose-bottom-nav:not(.dark-mode) {
    background: #ffffff !important;
    border-top-color: #e5e7eb !important;
}

.rose-bottom-nav:not(.dark-mode) .rose-bottom-name {
    color: #1f2937 !important;
}

/* Light Mode - Links (Purple) */
.rose-ai-chat-area:not(.dark-mode) .rose-task-link,
.rose-ai-chat-area:not(.dark-mode) .rose-team-link,
.rose-ai-chat-area:not(.dark-mode) a {
    color: #7C3AED !important;
    text-decoration: none !important;
}

.rose-ai-chat-area:not(.dark-mode) .rose-task-link:hover,
.rose-ai-chat-area:not(.dark-mode) .rose-team-link:hover,
.rose-ai-chat-area:not(.dark-mode) a:hover {
    color: #9333EA !important;
    text-decoration: underline !important;
}

/* ========================================
   DARK MODE (Override Styles)
   ======================================== */

/* Dark Mode - Chat Area */
.rose-ai-chat-area.dark-mode {
    background: #1a1a1a !important;
}

.rose-ai-chat-area.dark-mode .rose-ai-messages {
    background: #1a1a1a !important;
}

.rose-ai-chat-area.dark-mode .rose-message-text {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    font-size: 14px !important;
}

.rose-ai-chat-area.dark-mode .rose-message-user .rose-message-text {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%) !important;
    color: white !important;
}

.rose-ai-chat-area.dark-mode .rose-message-time {
    color: #888 !important;
}

.rose-ai-suggestions.dark-mode {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important;
}

.rose-ai-suggestions.dark-mode .rose-suggestion-btn {
    color: #888 !important;
}

.rose-ai-suggestions.dark-mode .rose-suggestion-btn:hover {
    background: #3a3a3a !important;
    color: #a78bfa !important;
}

.rose-ai-input-area.dark-mode {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important;
}

.rose-ai-input-area.dark-mode .rose-ai-input-wrapper {
    background: #3a3a3a !important;
    border-color: #4a4a4a !important;
}

.rose-ai-input-area.dark-mode .rose-ai-input {
    background: transparent !important;
    color: #e0e0e0 !important;
}

.rose-ai-input-area.dark-mode .rose-ai-input::placeholder {
    color: #888 !important;
}

.rose-ai-input-area.dark-mode .rose-voice-btn,
.rose-ai-input-area.dark-mode .rose-conversation-btn {
    background: transparent !important;
    border-color: #4a4a4a !important;
    color: #e0e0e0 !important;
}

.rose-ai-input-area.dark-mode .rose-voice-btn:hover,
.rose-ai-input-area.dark-mode .rose-conversation-btn:hover {
    background: #4a4a4a !important;
}

/* Dark mode for content panel (visual panel) */
.rose-ai-content-panel.dark-mode {
    background: #1a1a1a !important;
}

.rose-ai-content-panel.dark-mode .rose-content-panel-header {
    background: #2a2a2a !important;
    border-bottom-color: #3a3a3a !important;
}

.rose-ai-content-panel.dark-mode .rose-content-panel-header h3 {
    color: #e0e0e0 !important;
}

.rose-ai-content-panel.dark-mode .rose-content-panel-body {
    background: #1a1a1a !important;
}

/* Dark mode for visual content inside panel */
.rose-ai-content-panel.dark-mode .rose-stats-table {
    background: #2a2a2a !important;
}

.rose-ai-content-panel.dark-mode .rose-stats-table th {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
    border-bottom-color: #3a3a3a !important;
}

.rose-ai-content-panel.dark-mode .rose-stats-table td {
    color: #e0e0e0 !important;
    border-bottom-color: #3a3a3a !important;
}

.rose-ai-content-panel.dark-mode .rose-stats-table tr {
    background: #2a2a2a !important;
}

.rose-ai-content-panel.dark-mode .rose-stats-table tr:nth-child(even) {
    background: #1f1f1f !important;
}

.rose-ai-content-panel.dark-mode .rose-stat-card {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}

.rose-ai-content-panel.dark-mode .rose-stat-number {
    color: #e0e0e0 !important;
}

.rose-ai-content-panel.dark-mode .rose-stat-label {
    color: #888 !important;
}

/* Dark mode for bottom navigation */
.rose-bottom-nav.dark-mode {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important;
}

.rose-bottom-nav.dark-mode .rose-bottom-name {
    color: #e0e0e0 !important;
}

/* Dark mode for text links - Orange like Replit */
.rose-ai-chat-area.dark-mode .rose-task-link,
.rose-ai-chat-area.dark-mode .rose-team-link,
.rose-ai-chat-area.dark-mode a {
    color: #FF9500 !important;
    text-decoration: none !important;
}

.rose-ai-chat-area.dark-mode .rose-task-link:hover,
.rose-ai-chat-area.dark-mode .rose-team-link:hover,
.rose-ai-chat-area.dark-mode a:hover {
    color: #FFB340 !important;
    text-decoration: underline !important;
}

/* Split-screen Layout */
.rose-ai-container.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "header header"
        "chat content";
}

.rose-ai-container.split-view .rose-ai-header {
    grid-area: header;
}

.rose-ai-container.split-view .rose-ai-chat-area {
    grid-area: chat;
    border-right: 1px solid #e5e7eb;
}

.rose-ai-container.split-view .rose-ai-content-panel {
    grid-area: content;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

/* Content Panel Styles */
.rose-ai-content-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    visibility: hidden;
    opacity: 0;
}

.rose-content-panel-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.rose-content-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rose-content-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* Content Panel Empty State */
.rose-content-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
    padding: 40px 20px;
}

.rose-content-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.rose-content-empty h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #6b7280;
}

.rose-content-empty p {
    font-size: 14px;
    margin: 0;
    max-width: 300px;
}

/* Content Panel Items */
.rose-content-panel-body .rose-task-cards,
.rose-content-panel-body .rose-team-cards,
.rose-content-panel-body .rose-stats-display {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rose-content-panel-body .rose-task-cards {
    padding: 16px;
}

.rose-content-panel-body .rose-stats-display {
    padding: 16px;
}

/* Adjust scrollbar for content panel */
.rose-content-panel-body::-webkit-scrollbar {
    width: 8px;
}

.rose-content-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.rose-content-panel-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.rose-content-panel-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile: Disable split view */
@media (max-width: 1024px) {
    .rose-split-view-toggle {
        display: none;
    }
    
    .rose-ai-container.split-view {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        grid-template-rows: none;
        grid-template-areas: none;
    }
    
    .rose-ai-container.split-view .rose-ai-chat-area {
        border-right: none;
    }
    
    .rose-ai-content-panel {
        display: none !important;
    }
}

/* Tablet: Adjust split proportions */
@media (min-width: 1025px) and (max-width: 1440px) {
    .rose-ai-container.split-view {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* Large screens: Better proportions */
@media (min-width: 1441px) {
    .rose-ai-container.split-view {
        grid-template-columns: 1fr 1fr;
    }
}

/* Pages Navigation Button & Dropdown (Desktop) */
.rose-pages-nav-wrapper {
    position: relative;
    display: inline-block;
}

.rose-pages-nav-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.rose-pages-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.rose-pages-nav-toggle.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.rose-pages-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.rose-pages-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlideDown 0.2s ease-out;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rose-page-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.rose-page-link:last-child {
    border-bottom: none;
}

.rose-page-link:hover {
    background: #f9fafb;
    color: #7C3AED;
}

.rose-page-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.rose-page-label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

/* Hide desktop navigation on mobile */
@media (max-width: 768px) {
    .rose-pages-nav-wrapper {
        display: none !important;
    }
}

/* Pages Navigation Button & Dropdown (Mobile) */
.rose-pages-nav-wrapper-mobile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rose-pages-logo-mobile {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.rose-pages-dropdown-mobile {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3), 0 -2px 8px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlideUp 0.2s ease-out;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.rose-page-link-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #3a3a3a;
}

.rose-page-link-mobile:last-child {
    border-bottom: none;
}

.rose-page-link-mobile:hover {
    background: #3a3a3a;
    color: #a78bfa;
}

.rose-page-link-mobile .rose-page-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.rose-page-link-mobile .rose-page-label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

/* Hide mobile navigation on desktop */
@media (min-width: 769px) {
    .rose-pages-nav-wrapper-mobile {
        display: none !important;
    }
}
