/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    height: 100vh;
    overflow-y: auto;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 12px;
    opacity: 0.9;
}

/* Prompt Selector */
.prompt-selector {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.prompt-selector label {
    font-weight: 500;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.prompt-dropdown {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.prompt-dropdown:hover {
    border-color: #667eea;
}

.prompt-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Status Messages */
.status {
    background: #e3f2fd;
    color: #1976d2;
    padding: 12px 20px;
    font-size: 13px;
    border-bottom: 1px solid #bbdefb;
    display: none;
    align-items: center;
    gap: 8px;
}

.status.visible {
    display: flex;
}

.status::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #1976d2;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Summary Container */
.summary-container {
    flex: 1;
    background: white;
    padding: 20px;
    overflow-y: auto;
    min-height: 200px;
}

.summary {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.summary:empty::before {
    content: 'Open an email to see its summary...';
    color: #999;
    font-style: italic;
}

/* Streaming cursor effect */
.summary.streaming::after {
    content: '▋';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Error Display */
.error {
    background: #ffebee;
    color: #c62828;
    padding: 16px 20px;
    margin: 20px;
    border-radius: 6px;
    border-left: 4px solid #c62828;
    font-size: 13px;
    line-height: 1.6;
}

.error.hidden {
    display: none;
}

/* Footer */
.footer {
    background: white;
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.powered-by {
    font-size: 11px;
    color: #999;
}

/* Scrollbar Styling (Webkit browsers) */
.summary-container::-webkit-scrollbar {
    width: 8px;
}

.summary-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.summary-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.summary-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive adjustments for narrow task panes */
@media (max-width: 320px) {
    .header {
        padding: 16px;
    }

    .title {
        font-size: 20px;
    }

    .prompt-selector {
        padding: 12px 16px;
    }

    .summary-container {
        padding: 16px;
    }
}
