/* Cooper Status Dashboard Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connection-status {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4ade80;
}

.connection-status.disconnected {
    color: #ef4444;
}

/* Main Layout */
.main {
    flex: 1;
    display: flex;
    padding: 40px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.left-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CSS CAT AVATAR */
.cat-container {
    width: 280px;
    height: 280px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cat Base Styles */
.cat {
    position: relative;
    width: 120px;
    height: 100px;
}

/* Cat Body */
.cat-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px 50px 40px 40px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Cat Head */
.cat-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 40px;
    z-index: 10;
}

/* Cat Ears */
.cat-ear {
    position: absolute;
    top: -15px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #667eea;
}

.cat-ear.left {
    left: 5px;
    transform: rotate(-15deg);
}

.cat-ear.right {
    right: 5px;
    transform: rotate(15deg);
}

.cat-ear-inner {
    position: absolute;
    top: 8px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 15px solid #ff9ecd;
}

/* Cat Eyes */
.cat-eyes {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.cat-eye {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: relative;
}

.cat-eye::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #1a1a2e;
    border-radius: 50%;
}

/* Cat Nose */
.cat-nose {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #ff9ecd;
    border-radius: 50%;
}

/* Cat Mouth */
.cat-mouth {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border-bottom: 3px solid #ff9ecd;
    border-radius: 0 0 20px 20px;
}

/* Cat Whiskers */
.cat-whiskers {
    position: absolute;
    top: 40px;
    width: 100%;
}

.whisker {
    position: absolute;
    width: 25px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
}

.whisker.left-1 { left: -15px; top: 0; transform: rotate(10deg); }
.whisker.left-2 { left: -15px; top: 8px; }
.whisker.left-3 { left: -15px; top: 16px; transform: rotate(-10deg); }

.whisker.right-1 { right: -15px; top: 0; transform: rotate(-10deg); }
.whisker.right-2 { right: -15px; top: 8px; }
.whisker.right-3 { right: -15px; top: 16px; transform: rotate(10deg); }

/* Cat Tail */
.cat-tail {
    position: absolute;
    bottom: 10px;
    right: -20px;
    width: 50px;
    height: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transform-origin: left center;
}

/* Cat Paws */
.cat-paws {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
}

.cat-paw {
    width: 18px;
    height: 12px;
    background: #ff9ecd;
    border-radius: 10px 10px 5px 5px;
}

/* ========== IDLE ANIMATION (Sleeping) ========== */
.cat.idle .cat-body {
    animation: breathe 3s ease-in-out infinite;
}

.cat.idle .cat-head {
    animation: headBreathe 3s ease-in-out infinite;
}

.cat.idle .cat-eyes {
    opacity: 0;
}

.cat.idle .cat-eyes-closed {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.cat.idle .closed-eye {
    width: 14px;
    height: 3px;
    background: #1a1a2e;
    border-radius: 3px;
}

/* Zzz Animation */
.zzz-container {
    position: absolute;
    top: -30px;
    right: 20px;
}

.z {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    opacity: 0;
}

.z1 { animation: zFloat 3s ease-in-out infinite; }
.z2 { animation: zFloat 3s ease-in-out 1s infinite; }
.z3 { animation: zFloat 3s ease-in-out 2s infinite; }

@keyframes breathe {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

@keyframes headBreathe {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

@keyframes zFloat {
    0% { opacity: 0; transform: translateY(0) translateX(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-40px) translateX(20px); }
}

/* ========== WORKING ANIMATION (Typing) ========== */
.cat.working .cat-paw-left,
.cat.working .cat-paw-right {
    position: absolute;
    bottom: 20px;
    width: 20px;
    height: 25px;
    background: #ff9ecd;
    border-radius: 10px;
    transform-origin: top center;
}

.cat.working .cat-paw-left {
    left: 20px;
    animation: typeLeft 0.3s ease-in-out infinite;
}

.cat.working .cat-paw-right {
    right: 20px;
    animation: typeRight 0.3s ease-in-out infinite;
}

.cat.working .keyboard {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: flex;
    gap: 3px;
    padding: 3px;
    justify-content: center;
    align-items: center;
}

.cat.working .key {
    width: 8px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    animation: keyPress 0.3s ease-in-out infinite;
}

@keyframes typeLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-20deg); }
}

@keyframes typeRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
}

@keyframes keyPress {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); background: #667eea; }
}

/* ========== THINKING ANIMATION ========== */
.cat.thinking .cat-head {
    animation: thinkTilt 2s ease-in-out infinite;
}

.cat.thinking .cat-eye::after {
    animation: lookAround 3s ease-in-out infinite;
}

.thought-bubble {
    position: absolute;
    top: -60px;
    right: -40px;
    background: #fff;
    padding: 10px 15px;
    border-radius: 20px;
    color: #1a1a2e;
    font-size: 24px;
    animation: bubbleFloat 2s ease-in-out infinite;
}

.thought-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid #fff;
}

@keyframes thinkTilt {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg); }
    75% { transform: translateX(-50%) rotate(5deg); }
}

@keyframes lookAround {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 0); }
    50% { transform: translate(2px, 0); }
    75% { transform: translate(0, -1px); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========== SUCCESS ANIMATION ========== */
.cat.success {
    animation: celebrateJump 0.5s ease-in-out infinite;
}

.cat.success .cat-tail {
    animation: wagTail 0.3s ease-in-out infinite;
}

.cat.success .sparkles {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
}

.cat.success .sparkle {
    position: absolute;
    color: #fbbf24;
    font-size: 20px;
    animation: sparkleAnim 1s ease-in-out infinite;
}

.cat.success .sparkle:nth-child(1) { top: 0; left: 50%; animation-delay: 0s; }
.cat.success .sparkle:nth-child(2) { top: 30%; left: 0; animation-delay: 0.2s; }
.cat.success .sparkle:nth-child(3) { top: 30%; right: 0; animation-delay: 0.4s; }

@keyframes celebrateJump {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

@keyframes wagTail {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(30deg); }
}

@keyframes sparkleAnim {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* ========== ERROR ANIMATION ========== */
.cat.error .cat-ear.left {
    animation: droopLeft 2s ease-in-out infinite;
}

.cat.error .cat-ear.right {
    animation: droopRight 2s ease-in-out infinite;
}

.cat.error .cat-eye::after {
    animation: lookDown 2s ease-in-out infinite;
}

.cat.error .tear {
    position: absolute;
    top: 35px;
    left: 20px;
    width: 6px;
    height: 10px;
    background: #60a5fa;
    border-radius: 50%;
    opacity: 0;
    animation: tearDrop 2s ease-in-out infinite;
}

.cat.error .x-eyes {
    display: none;
}

.cat.error .cat-eyes {
    opacity: 0;
}

.cat.error .cat-eyes-x {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.cat.error .x-eye {
    width: 14px;
    height: 14px;
    position: relative;
}

.cat.error .x-eye::before,
.cat.error .x-eye::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #1a1a2e;
}

.cat.error .x-eye::before { transform: rotate(45deg); }
.cat.error .x-eye::after { transform: rotate(-45deg); }

@keyframes droopLeft {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(-25deg); }
}

@keyframes droopRight {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(25deg); }
}

@keyframes lookDown {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(0, 3px); }
}

@keyframes tearDrop {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Avatar Container */
.avatar-container {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Status Badge */
.status-badge {
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.05);
}

.status-badge.idle {
    border-color: #4ade80;
    color: #4ade80;
}

.status-badge.working {
    border-color: #60a5fa;
    color: #60a5fa;
}

.status-badge.thinking {
    border-color: #fbbf24;
    color: #fbbf24;
}

.status-badge.success {
    border-color: #22c55e;
    color: #22c55e;
}

.status-badge.error {
    border-color: #ef4444;
    color: #ef4444;
}

/* Status Card */
.status-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.status-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item:last-child {
    border-bottom: none;
}

.status-item .label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.status-item .value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
}

.status-item .value.task {
    max-width: 60%;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Activity Log */
.activity-log {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    max-height: 400px;
    overflow: hidden;
}

.activity-log h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.activity-list {
    overflow-y: auto;
    max-height: 300px;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .timestamp {
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
    min-width: 50px;
}

.activity-item .message {
    color: rgba(255, 255, 255, 0.8);
}

.empty-state {
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Footer */
.footer {
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .main {
        flex-direction: column;
        padding: 20px;
    }
    
    .left-panel {
        flex: none;
        width: 100%;
    }
    
    .avatar-container {
        width: 250px;
        height: 250px;
    }
    
    .cat {
        transform: scale(0.8);
    }
}
