@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(25, 30, 45, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: rgba(0, 242, 254, 0.5);
    --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --bot-msg-bg: rgba(0, 242, 254, 0.1);
    --user-msg-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(79, 172, 254, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 254, 0.08), transparent 25%);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Modal Overlay (PIN Code) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(11, 15, 25, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.2);
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    display: flex;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    gap: 20px;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.sidebar {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sidebar-header h2 {
    font-weight: 600;
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dashboard Stats */
.dashboard-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--panel-border);
}
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.sidebar-title h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.goals-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
}

.goals-list::-webkit-scrollbar { width: 6px; }
.goals-list::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 4px; }

.goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.goal-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.goal-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.goal-item.done .goal-checkbox {
    background: var(--accent-gradient);
    border-color: transparent;
}
.goal-item.done .goal-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.add-goal-form {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

input:focus { border-color: rgba(0, 242, 254, 0.5); }
.add-goal-input { flex: 1; }

button {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

.chat-area {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.chat-header {
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #00f2fe;
    border-radius: 50%;
    box-shadow: 0 0 10px #00f2fe;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 242, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

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

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 4px; }

.message {
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    animation: slideUp 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

.message.bot {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.message.user {
    align-self: flex-end;
    background: var(--user-msg-bg);
    border-bottom-right-radius: 4px;
    border: 1px solid var(--panel-border);
}

/* Interaction Zone */
.interaction-zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.mood-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.02);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    width: fit-content;
}
.mood-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 4px;
}
.mood-btn {
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.2rem;
    padding: 4px;
    cursor: pointer;
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.2s;
    box-shadow: none;
}
.mood-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: none;
}
.mood-btn.active {
    opacity: 1;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
}

.chat-input-area textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    color: var(--text-primary);
    resize: none;
    min-height: 44px;
    max-height: 200px;
    outline: none;
    font-size: 1rem;
    line-height: 1.4;
    overflow-y: auto;
}
.chat-input-area button[type="submit"] {
    padding: 0 24px;
    border-radius: 10px;
}

/* Mic Button */
.mic-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0 16px;
    border-radius: 10px;
    box-shadow: none;
}
.mic-btn:hover {
    color: #4facfe;
    background: rgba(255,255,255,0.05);
    transform: none;
    box-shadow: none;
}
.mic-btn.recording {
    color: #ff4757;
    animation: pulseMic 1.5s infinite;
}
@keyframes pulseMic {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); text-shadow: 0 0 10px rgba(255,71,87,0.5); }
    100% { transform: scale(1); }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 20px;
    background: var(--bot-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
    display: none;
}

.typing-indicator.active { display: flex; }
.dot {
    width: 6px;
    height: 6px;
    background: #00f2fe;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@media (max-width: 800px) {
    body {
        height: auto;
        overflow-y: auto;
        padding-bottom: 20px;
    }
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        gap: 15px;
        padding: 10px;
    }
    .sidebar { 
        max-width: 100%; 
        min-height: auto; 
        flex: none; 
    }
    .chat-area { 
        flex: none; 
        height: 75vh; /* Чат займає основну частину екрану знизу */
    }
}
