/* RaccoonMath Dashboard - Custom Styles */

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   VOICE BUTTON ANIMATIONS
   ============================================ */
#voiceBtn.listening {
    background: linear-gradient(135deg, #00d9ff 0%, #e94560 100%);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

#voiceBtn.listening #listeningPulse {
    opacity: 0.5;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.8);
    }
}

/* ============================================
   CHAT MESSAGE STYLES
   ============================================ */
.chat-message {
    animation: fadeIn 0.3s ease-out;
}

.chat-message.user {
    display: flex;
    justify-content: flex-end;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.chat-message.assistant .message-bubble {
    background: #0f3460;
}

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

/* Processing indicator dots */
.processing-dots span {
    animation: blink 1.4s infinite both;
}

.processing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.processing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* ============================================
   TASK & REMINDER ITEMS
   ============================================ */
.task-item, .reminder-item, .activity-item {
    background: rgba(15, 52, 96, 0.5);
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.task-item:hover, .reminder-item:hover, .activity-item:hover {
    background: rgba(15, 52, 96, 0.8);
    transform: translateX(4px);
}

.task-item.completed {
    opacity: 0.5;
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

/* Priority indicators */
.priority-high {
    border-left: 3px solid #e94560;
}

.priority-medium {
    border-left: 3px solid #fbbf24;
}

.priority-low {
    border-left: 3px solid #34d399;
}

/* ============================================
   CRITICAL ITEMS PULSE
   ============================================ */
.reminder-item.urgent {
    animation: urgent-pulse 2s ease-in-out infinite;
    border: 1px solid rgba(233, 69, 96, 0.5);
}

@keyframes urgent-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(233, 69, 96, 0);
    }
}

/* ============================================
   ACTIVITY TIMELINE
   ============================================ */
.activity-item {
    position: relative;
    padding-left: 1.5rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d9ff;
}

.activity-item::after {
    content: '';
    position: absolute;
    left: calc(0.5rem + 3px);
    top: 100%;
    width: 2px;
    height: 0.75rem;
    background: rgba(0, 217, 255, 0.3);
}

.activity-item:last-child::after {
    display: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    /* Stack sidebars below main content on tablet */
    .flex-col {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    /* Mobile adjustments */
    #chatContainer {
        min-height: 300px;
    }
}

/* iPad landscape optimization */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    body {
        font-size: 15px;
    }
    
    aside {
        width: 280px !important;
    }
}

/* ============================================
   WAVEFORM VISUALIZATION (for voice input)
   ============================================ */
.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 24px;
}

.waveform-bar {
    width: 3px;
    background: #00d9ff;
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite alternate;
}

.waveform-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; height: 8px; }

@keyframes wave {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1); }
}

/* ============================================
   PROJECTS PANEL
   ============================================ */
.project-item {
    background: rgba(15, 52, 96, 0.5);
    border-radius: 0.75rem;
    padding: 0;
    transition: all 0.2s ease;
    overflow: hidden;
    border-left: 3px solid transparent;
}

.project-item:hover {
    background: rgba(15, 52, 96, 0.8);
}

/* Status border colors */
.project-item.status-complete {
    border-left-color: #34d399;
}

.project-item.status-in-progress {
    border-left-color: #fbbf24;
}

.project-item.status-blocked {
    border-left-color: #e94560;
}

.project-item.status-organizing {
    border-left-color: #60a5fa;
}

.project-item.status-paused {
    border-left-color: #9ca3af;
}

.project-header {
    padding: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-status-emoji {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.project-name {
    font-weight: 500;
    font-size: 0.875rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-expand-icon {
    color: #9ca3af;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.project-expand-icon.expanded {
    transform: rotate(180deg);
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.project-status-text {
    opacity: 0.8;
}

.project-date {
    opacity: 0.6;
}

/* Expandable details section */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid transparent;
}

.project-details.expanded {
    max-height: 300px;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-description {
    font-size: 0.75rem;
    color: #d1d5db;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.project-step {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.step-label {
    color: #00d9ff;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 50px;
}

.step-text {
    color: #e5e7eb;
}

.project-domain {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.domain-label {
    font-size: 0.625rem;
}

.domain-text {
    color: #00d9ff;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.glass {
    background: rgba(22, 33, 62, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glow-text {
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
