/* Munch Brand Colors */
:root {
    --bg-primary: #0d0f1a;
    --bg-secondary: #1a1d2e;
    --bg-card: #1e2235;
    --bg-input: #252a3d;
    --yellow: #FFB800;
    --orange: #FF8C00;
    --cyan: #00D4FF;
    --pink: #FF3366;
    --purple: #7B61FF;
    --green: #00C853;
    --text-primary: #ffffff;
    --text-secondary: #8b8d9a;
    --border: #2d3348;
    --border-active: #FF3366;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ==================== SIDEBAR ==================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #FF6B6B, #FFE66D, #4ECDC4, #45B7D1, #96E6A1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: var(--text-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Stats Section */
.stats-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.progress-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--bg-primary);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-info h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stats-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.stat-success {
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-failure {
    color: var(--pink);
}

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

.dot.green {
    background: var(--green);
}

.dot.yellow {
    background: var(--yellow);
}

.dot.pink {
    background: var(--pink);
}

/* AI Tip Section */
.ai-tip-section {
    margin-bottom: 24px;
}

.ai-tip-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
}

.ai-tip-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ai-tip-card p {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.ai-tip-card .highlight {
    color: var(--cyan);
}

/* Conversation History */
.conversation-history h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.conversation-item:hover {
    background: var(--bg-input);
}

.conversation-item.active {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
}

.conv-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.conv-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.conv-status.success {
    color: var(--green);
}

.conv-status.stalled {
    color: var(--yellow);
}

.conv-status.ghosted {
    color: var(--cyan);
}

.conv-status.active {
    color: var(--pink);
}

.conv-arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

.conv-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-size: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.btn-upgrade {
    width: 100%;
    padding: 16px;
    background: var(--yellow);
    border: none;
    border-radius: 12px;
    color: var(--bg-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 184, 0, 0.3);
}

/* ==================== MAIN CONTAINER ==================== */
.main-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Promo Banner */
.promo-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-upgrade-small {
    padding: 8px 16px;
    background: var(--purple);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-upgrade-small:hover {
    opacity: 0.9;
}

/* Menu Toggle */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 100;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: var(--bg-card);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Logo */
.logo-container {
    text-align: center;
    margin: 20px 0 10px;
}

.logo {
    max-width: 200px;
    height: auto;
}

/* Status */
.status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-indicator.online {
    background: var(--green);
}

.status-indicator.offline {
    background: var(--pink);
}

/* Input Card */
.input-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid var(--border);
    margin-bottom: 20px;
}

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

.input-wrapper textarea {
    width: 100%;
    padding: 16px;
    padding-right: 50px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--cyan);
}

.input-wrapper textarea::placeholder {
    color: var(--text-secondary);
}

.upload-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.upload-btn:hover {
    color: var(--text-primary);
}

/* Response Type Selector */
.response-type-section {
    margin-bottom: 20px;
}

.response-type-section label {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.response-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.type-btn {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.type-btn.active {
    border-color: var(--pink);
    color: var(--pink);
    background: rgba(255, 51, 102, 0.1);
}

/* Analyze Button */
.btn-analyze {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    border: none;
    border-radius: 12px;
    color: var(--bg-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 184, 0, 0.3);
}

.btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    margin-bottom: 20px;
}

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

.result-card h3 {
    font-size: 16px;
    color: var(--cyan);
    margin-bottom: 12px;
}

.suggestion-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* Footer Actions */
.footer-actions {
    margin-top: auto;
    text-align: center;
    padding: 20px 0;
}

.btn-premium {
    width: 100%;
    padding: 18px;
    background: var(--yellow);
    border: none;
    border-radius: 30px;
    color: var(--bg-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 184, 0, 0.3);
}

.watch-ad-link {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.watch-ad-link:hover {
    color: var(--text-primary);
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 12px;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: var(--cyan);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-buttons button:first-child {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.modal-buttons button.btn-primary {
    background: var(--cyan);
    border: none;
    color: var(--bg-primary);
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }

    .promo-banner {
        font-size: 12px;
        padding: 10px 12px;
    }

    .logo {
        max-width: 160px;
    }

    .type-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .sidebar {
        width: 100%;
        left: -100%;
    }
}

/* SVG Gradient for Progress Ring */
svg defs {
    display: block;
}
