:root {
    --bg-dark: #0f1115;
    --bg-card: #161b22;
    --bg-card-hover: #1f2631;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border: #30363d;
    --success: #238636;
    --danger: #da3633;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent);
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

/* Sync Status */
.sync-status {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.sync-status p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), purple);
    width: 0%;
    transition: width 0.5s;
}

.sync-text {
    font-size: 0.75rem;
    text-align: right;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

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

header {
    margin-bottom: 30px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Focus Cards */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s;
}

.focus-grid.hidden {
    display: none;
}

.focus-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-card-hover));
    border: 1px solid var(--accent-glow);
    padding: 15px;
    border-radius: 12px;
    position: relative;
}

.focus-card h4 {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.focus-card p {
    font-size: 0.95rem;
    line-height: 1.4;
}

.focus-card .rank {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-card {
    grid-column: span 1;
}

.graph-card {
    grid-column: span 2;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recent-section {
    margin-top: 20px;
}

.dash-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.recent-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.agenda-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.agenda-date {
    color: var(--accent);
    font-weight: bold;
    width: 50px;
    text-align: center;
}

.agenda-details {
    flex: 1;
}

.agenda-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}



/* Standard container */

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entry-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s;
}

.entry-item:hover {
    border-color: var(--text-secondary);
    transform: translateX(5px);
}

.entry-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.entry-content {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.entry-tags {
    display: flex;
    gap: 5px;
}

.tag {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: start;
    padding-top: 15vh;
    z-index: 1000;
    transition: opacity 0.2s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background-color: var(--bg-card);
    width: 600px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 2px;
    /* Gradient border container if needed */
    overflow: hidden;
}

.overlay-header {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.overlay-header h2 {
    font-size: 1rem;
    color: var(--text-secondary);
}

.close-overlay {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.input-wrapper {
    padding: 20px;
    position: relative;
}

textarea {
    width: 100%;
    height: 100px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: var(--font-main);
    resize: none;
    outline: none;
}

.recording-visualizer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--danger);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 20px;
}

.recording-visualizer.hidden {
    display: none;
}

.wave {
    width: 3px;
    height: 10px;
    background: var(--danger);
    animation: wave 1s infinite ease-in-out;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {

    0%,
    100% {
        height: 10px;
    }

    50% {
        height: 20px;
    }
}

.overlay-actions {
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.spacer {
    flex: 1;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 10px;
}

kbd {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.action-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn.primary {
    background-color: var(--text-primary);
    color: var(--bg-dark);
}

.action-btn.primary:hover {
    background-color: white;
    transform: translateY(-1px);
}

.primary-btn.small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
}

.action-btn.record {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.action-btn.record:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.action-btn.recording {
    background-color: rgba(218, 54, 51, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Chat / Sim */
.sim-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

.sim-controls {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toggle-label input {
    accent-color: var(--accent);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.message.system {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-self: flex-start;
}

.message.user {
    background-color: var(--accent);
    color: white;
    margin-left: auto;
}

.message.ai {
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border);
    margin-right: auto;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    color: white;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--accent);
}

#simSendBtn {
    padding: 0 20px;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* Settings */
.settings-card {
    max-width: 500px;
}

.settings-card input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 6px;
    color: white;
    margin-top: 5px;
}

.settings-card .hint {
    margin-top: 5px;
    margin-bottom: 20px;
    font-size: 0.8rem;
}