/**
 * Copilot247 Office Add-in Styles
 * Matching copilot247.com brand
 */

:root {
    --primary: #1350f7;
    --primary-hover: #0f40c9;
    --primary-light: #e8efff;
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --text: #383838;
    --text-muted: #4b5563;
    --text-light: #9ca3af;
    --bg: #ffffff;
    --bg-muted: #f3f4f6;
    --bg-hover: #f9fafb;
    --border: #e5e7eb;
    --border-focus: #93c5fd;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 6px;
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Container */
.container {
    padding: 16px;
    max-width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.header .logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* Quick Actions Grid */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.action-btn:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

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

.action-btn .label {
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.action-btn .desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Section Titles */
.section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 16px 0 8px 0;
}

/* Input Area */
.input-area {
    margin-bottom: 12px;
}

.input-area textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.15s;
}

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

.input-area textarea::placeholder {
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-light);
    background: var(--bg-hover);
}

.btn-success {
    background: var(--primary);
    color: white;
}

.btn-success:hover {
    background: var(--primary-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

/* Result Area */
.result-area {
    flex: 1;
    padding: 14px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    margin-bottom: 12px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.result-area .streaming {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.result-area code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.result-area strong {
    font-weight: 600;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--primary);
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.actions-row:last-child {
    margin-bottom: 0;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* Error */
.error {
    padding: 14px;
    background: var(--error-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--error);
    font-size: 13px;
    line-height: 1.5;
}

/* Footer */
.footer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    flex-shrink: 0;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
}

/* Context Badge */
.context-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #3b82f6;
        --primary-hover: #2563eb;
        --primary-light: #1e3a5f;
        --success: #34d399;
        --success-light: #064e3b;
        --error: #f87171;
        --error-light: #450a0a;
        --text: #f3f4f6;
        --text-muted: #9ca3af;
        --text-light: #6b7280;
        --bg: #111827;
        --bg-muted: #1f2937;
        --bg-hover: #374151;
        --border: #374151;
        --border-focus: #60a5fa;
    }

    .result-area code {
        background: var(--bg-hover);
    }
}

/* Print Styles */
@media print {
    .header, .footer, .quick-actions, .actions-row, .btn {
        display: none !important;
    }

    .result-area {
        max-height: none;
        border: none;
        padding: 0;
    }
}
