/**
 * Outlook AI Assistant - Task Pane Styles
 * Modern, clean, and responsive design
 */

/* 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: #323130;
    background: #faf9f8;
    padding: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #e1dfdd;
    margin-bottom: 20px;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    color: #0078d4;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 12px;
    color: #605e5c;
}

/* Email Details Section */
.email-details {
    background: white;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.email-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.info-row.full-width {
    flex-direction: column;
}

.label {
    font-weight: 600;
    color: #605e5c;
    min-width: 80px;
    font-size: 13px;
}

.value {
    color: #323130;
    flex: 1;
    word-break: break-word;
    font-size: 13px;
}

.body-preview {
    background: #faf9f8;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    padding: 12px;
    margin-top: 4px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
    color: #605e5c;
    white-space: pre-wrap;
}

.body-preview::-webkit-scrollbar {
    width: 8px;
}

.body-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.body-preview::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 4px;
}

.body-preview::-webkit-scrollbar-thumb:hover {
    background: #a19f9d;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #605e5c;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error {
    padding: 20px;
    text-align: center;
    color: #d13438;
    background: #fef6f6;
    border: 1px solid #f4c2c2;
    border-radius: 4px;
}

/* Action Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:not(:disabled):active {
    transform: translateY(0);
}

.btn-primary {
    background: #0078d4;
    color: white;
}

.btn-primary:not(:disabled):hover {
    background: #106ebe;
}

.btn-secondary {
    background: #ffffff;
    color: #0078d4;
    border: 2px solid #0078d4;
}

.btn-secondary:not(:disabled):hover {
    background: #f3f2f1;
}

.btn-icon {
    font-size: 18px;
}

/* Output Section */
.output-section {
    background: white;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    padding: 16px;
    margin-top: 16px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1dfdd;
}

.output-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #323130;
}

.btn-clear {
    background: none;
    border: none;
    color: #0078d4;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-clear:hover {
    background: #f3f2f1;
}

.output-content {
    min-height: 100px;
    padding: 12px;
    background: #faf9f8;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    color: #323130;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-content .placeholder {
    color: #a19f9d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.output-content .output-title {
    font-weight: 600;
    color: #0078d4;
    margin-bottom: 8px;
    font-size: 14px;
}

.output-content .output-text {
    margin-bottom: 16px;
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 400px) {
    body {
        padding: 12px;
    }

    .header-title {
        font-size: 20px;
    }

    .btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* Smooth Transitions */
.email-info,
.output-content {
    animation: fadeIn 0.3s ease-in;
}

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