/* Design System Tokens */
:root {
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --bg-dark: #07080d;
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-bg-hover: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-active: rgba(236, 72, 153, 0.3);
    
    /* Curated Color Palette */
    --color-primary: #ec4899;      /* Pink / Love */
    --color-secondary: #8b5cf6;    /* Violet */
    --color-accent: #14b8a6;       /* Teal / Happy */
    --color-warning: #f59e0b;      /* Amber / Stressed */
    --color-info: #3b82f6;         /* Blue / Sleepy */
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --glow-primary: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Glassmorphism Background Glows */
.glass-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -150px;
    left: -100px;
    z-index: -1;
    pointer-events: none;
    animation: float-glow 20s infinite alternate;
}

.glass-bg-glow-secondary {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
    animation: float-glow-delayed 25s infinite alternate;
}

@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 80px) scale(1.1); }
}

@keyframes float-glow-delayed {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, -50px) scale(0.9); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Layout Container */
.dashboard-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.4));
    animation: beat 3s infinite ease-in-out;
}

.logo-group h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

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

/* Device Status Badges */
.device-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    border-color: rgba(20, 184, 166, 0.25);
    background: rgba(20, 184, 166, 0.08);
}
.status-online .status-dot {
    background-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent);
}

.status-offline {
    border-color: rgba(100, 116, 139, 0.25);
    background: rgba(100, 116, 139, 0.08);
}
.status-offline .status-dot {
    background-color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.card-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--glow-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.glass-card h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
    opacity: 0.95;
    position: relative;
    display: inline-block;
}

.glass-card h2::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: var(--glow-primary);
    bottom: -8px;
    left: 0;
}

/* Mood Card Custom Layout */
.mood-display {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 18px;
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.mood-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: var(--transition-smooth);
}

.mood-info h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.mood-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mood specific card glow animations */
.mood-love {
    border-color: rgba(236, 72, 153, 0.3) !important;
    background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.08), var(--card-bg)) !important;
    box-shadow: 0 8px 32px 0 rgba(236, 72, 153, 0.1);
}
.mood-love .mood-emoji {
    animation: heart-beat 1.5s infinite alternate ease-in-out;
}
.mood-love h3 { color: var(--color-primary); }

.mood-happy {
    border-color: rgba(20, 184, 166, 0.3) !important;
    background: radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), var(--card-bg)) !important;
    box-shadow: 0 8px 32px 0 rgba(20, 184, 166, 0.1);
}
.mood-happy .mood-emoji {
    animation: rotate-sun 10s infinite linear;
}
.mood-happy h3 { color: var(--color-accent); }

.mood-sleepy {
    border-color: rgba(59, 130, 246, 0.3) !important;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), var(--card-bg)) !important;
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.1);
}
.mood-sleepy .mood-emoji {
    animation: drift-z 3s infinite ease-in-out;
}
.mood-sleepy h3 { color: var(--color-info); }

.mood-stressed {
    border-color: rgba(245, 158, 11, 0.3) !important;
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), var(--card-bg)) !important;
    box-shadow: 0 8px 32px 0 rgba(245, 158, 11, 0.1);
}
.mood-stressed .mood-emoji {
    animation: jitter 0.5s infinite alternate linear;
}
.mood-stressed h3 { color: var(--color-warning); }

/* Device Meta Info */
.device-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.meta-icon {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 20px;
    display: inline-block;
    text-align: center;
}

.meta-label {
    color: var(--text-muted);
    margin-right: 6px;
}

.meta-value {
    font-weight: 600;
}

/* Message Compose Form */
.compose-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.15);
}

.form-group textarea {
    min-height: 100px;
    resize: none;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -4px;
}

/* Button UI */
.btn {
    background: var(--glow-primary);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45);
}

.btn:active {
    transform: translateY(1px);
}

/* Presets List */
.presets-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.presets-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* History Card */
.history-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.history-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 520px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.empty-history {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

/* History Item Styling */
.history-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    animation: slide-in 0.3s ease-out;
}

.history-item-icon {
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.icon-mood {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.icon-msg {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.history-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes beat {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    40% { transform: scale(1); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes heart-beat {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(236, 72, 153, 0.3)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.8)); }
}

@keyframes rotate-sun {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes drift-z {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(3px, -3px) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes jitter {
    0% { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

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

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .history-list {
        max-height: 400px;
    }
}
