/* 
 * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
 * See LICENSE in the project root for license information.
 */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

ul {
    margin: 0;
    padding: 0;
}

.ms-welcome__header {
   padding: 15px 20px;
   display: -webkit-flex;
   display: flex;
   -webkit-flex-direction: column;
   flex-direction: column;
   align-items: center;
   border-bottom: 1px solid #edebe9;
}

.ms-welcome__main {
   display: -webkit-flex;
   display: flex;
   -webkit-flex-direction: column;
   flex-direction: column;
   -webkit-flex-wrap: nowrap;
   flex-wrap: nowrap;
   -webkit-align-items: stretch;
   align-items: stretch;
   -webkit-flex: 1 0 0;
   flex: 1 0 0;
   padding: 15px 20px;
   gap: 15px;
}

.ms-welcome__main > h2 {
    width: 100%;
    text-align: center;
}

/* Email Information Styles */
.email-info-section {
   background: #f8f9fa;
   border: 1px solid #edebe9;
   border-radius: 4px;
   padding: 15px;
}

.email-info-section h3 {
   margin: 0 0 10px 0;
   color: #323130;
}

.email-details {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.email-field {
   display: flex;
   align-items: flex-start;
   gap: 8px;
}

.field-label {
   font-weight: 600;
   color: #605e5c;
   min-width: 60px;
   flex-shrink: 0;
}

.field-value {
   color: #323130;
   word-break: break-word;
   flex: 1;
}

/* Action Buttons */
.initial-action {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 12px;
   padding: 10px 0;
}

.action-buttons {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 12px;
   padding: 10px 0;
}

.action-button {
   width: 80%;
   min-height: 40px;
   padding: 8px 16px;
   border-radius: 20px;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   background: transparent;
   display: flex;
   align-items: center;
   justify-content: center;
}

/* Generate First Draft Button */
.generate-button {
   border: 2px solid #0078d4;
   color: #0078d4;
}

.generate-button:hover {
   background-color: rgba(0, 120, 212, 0.1);
   transform: translateY(-1px);
}

/* Regenerate Button */
.regenerate-button {
   border: 2px solid #ca5010;
   color: #ca5010;
}

.regenerate-button:hover {
   background-color: rgba(202, 80, 16, 0.1);
   transform: translateY(-1px);
}

/* Generate Refinement Button */
.refine-button {
   border: 2px solid #107c10;
   color: #107c10;
}

.refine-button:hover {
   background-color: rgba(16, 124, 16, 0.1);
   transform: translateY(-1px);
}

/* Accept Final Draft Button */
.accept-button {
   border: 2px solid #881798;
   color: #881798;
}

.accept-button:hover {
   background-color: rgba(136, 23, 152, 0.1);
   transform: translateY(-1px);
}

.action-button:active {
   transform: translateY(0);
}

.button-label {
   font-weight: 600;
}

/* Loading Styles */
.loading-section {
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 20px;
   gap: 10px;
}

.ms-Spinner {
   width: 32px;
   height: 32px;
   border: 3px solid #f3f2f1;
   border-top: 3px solid #0078d4;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

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

/* Response Section */
.response-section {
   display: flex;
   flex-direction: column;
   gap: 15px;
}

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

.response-header h3 {
   margin: 0;
   color: #323130;
}

.toggle-button {
   background: transparent;
   border: 1px solid #0078d4;
   color: #0078d4;
   padding: 6px 12px;
   border-radius: 4px;
   cursor: pointer;
   font-size: 12px;
   font-weight: 600;
   transition: all 0.2s ease;
}

.toggle-button:hover {
   background-color: rgba(0, 120, 212, 0.1);
}

.toggle-button:active {
   background-color: rgba(0, 120, 212, 0.2);
}

.edit-mode,
.preview-mode {
   width: 100%;
}

.response-textarea {
   width: 100%;
   min-height: 200px;
   max-height: 300px;
   padding: 12px;
   border: 1px solid #d1d1d1;
   border-radius: 4px;
   font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   font-size: 14px;
   line-height: 1.4;
   resize: vertical;
   box-sizing: border-box;
}

.response-textarea:focus {
   outline: none;
   border-color: #0078d4;
   box-shadow: 0 0 0 1px #0078d4;
}

.preview-content {
   width: 100%;
   min-height: 200px;
   max-height: 300px;
   padding: 12px;
   border: 1px solid #d1d1d1;
   border-radius: 4px;
   font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   font-size: 14px;
   line-height: 1.6;
   background-color: #fafafa;
   overflow-y: auto;
   box-sizing: border-box;
}

/* Markdown content styling */
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
   margin: 0.5em 0;
   color: #323130;
}

.preview-content p {
   margin: 0.8em 0;
   color: #323130;
}

.preview-content ul,
.preview-content ol {
   margin: 0.8em 0;
   padding-left: 20px;
}

.preview-content li {
   margin: 0.3em 0;
   color: #323130;
}

.preview-content strong {
   font-weight: 600;
}

.preview-content em {
   font-style: italic;
}

.preview-content code {
   background-color: #f1f1f1;
   padding: 2px 4px;
   border-radius: 3px;
   font-family: 'Courier New', monospace;
   font-size: 13px;
}

.preview-content pre {
   background-color: #f8f8f8;
   padding: 10px;
   border-radius: 4px;
   border: 1px solid #e1e1e1;
   overflow-x: auto;
}

.preview-content pre code {
   background: none;
   padding: 0;
}

.preview-content blockquote {
   border-left: 4px solid #0078d4;
   margin: 1em 0;
   padding-left: 15px;
   color: #605e5c;
   font-style: italic;
}

.preview-content img {
   max-width: 100%;
   height: auto;
   border-radius: 4px;
   margin: 8px 0;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-content a {
   color: #0078d4;
   text-decoration: none;
   border-bottom: 1px solid transparent;
   transition: border-bottom-color 0.2s ease;
}

.preview-content a:hover {
   border-bottom-color: #0078d4;
   text-decoration: none;
}

/* Tone Selection */
.tone-selection {
   background: #f8f9fa;
   border: 1px solid #edebe9;
   border-radius: 8px;
   padding: 20px;
   margin-top: 10px;
}

.tone-selection h4 {
   margin: 0 0 15px 0;
   color: #323130;
   font-size: 14px;
   font-weight: 600;
}

.tone-toggle-container {
   display: flex;
   justify-content: center;
}

.tone-toggle {
   position: relative;
   display: flex;
   background: #ffffff;
   border-radius: 25px;
   padding: 4px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
   border: 1px solid #e1e1e1;
}

.tone-toggle input[type="radio"] {
   display: none;
}

.tone-option {
   position: relative;
   z-index: 2;
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 10px 20px;
   border-radius: 20px;
   cursor: pointer;
   transition: all 0.3s ease;
   font-size: 13px;
   font-weight: 500;
   color: #605e5c;
   background: transparent;
   min-width: 90px;
   justify-content: center;
}

.tone-icon {
   font-size: 16px;
   transition: transform 0.2s ease;
}

.tone-label {
   font-weight: 600;
   letter-spacing: 0.3px;
}

.tone-option:hover {
   color: #323130;
}

.tone-option:hover .tone-icon {
   transform: scale(1.1);
}

/* Slider background */
.tone-slider {
   position: absolute;
   top: 4px;
   left: 4px;
   width: calc(50% - 4px);
   height: calc(100% - 8px);
   background: linear-gradient(135deg, #0078d4, #106ebe);
   border-radius: 20px;
   transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   box-shadow: 0 2px 6px rgba(0, 120, 212, 0.3);
   z-index: 1;
}

/* Active state */
input[type="radio"]:checked + .tone-option {
   color: #ffffff;
   font-weight: 600;
}

input[type="radio"]:checked + .tone-option .tone-icon {
   transform: scale(1.15);
   filter: brightness(1.2);
}

/* Move slider to informal when selected */
input[name="tone"][value="informal"]:checked ~ .tone-slider {
   transform: translateX(100%);
}

/* Responsive adjustments */
@media (max-width: 320px) {
   .tone-option {
      min-width: 75px;
      padding: 8px 15px;
      font-size: 12px;
   }
   
   .tone-icon {
      font-size: 14px;
   }
}

/* Status Messages */
.status-message {
   padding: 12px;
   border-radius: 4px;
   text-align: center;
   font-weight: 500;
}

.status-message.success {
   background-color: #dff6dd;
   color: #107c10;
   border: 1px solid #92c5f7;
}

.status-message.error {
   background-color: #fde7e9;
   color: #d13438;
   border: 1px solid #d13438;
}

.status-message.info {
   background-color: #deecf9;
   color: #0078d4;
   border: 1px solid #0078d4;
}

/* Responsive Design */
@media (max-width: 320px) {
   .ms-welcome__main {
       padding: 10px 15px;
   }
   
   .email-info-section {
       padding: 12px;
   }
   
   .response-textarea {
       min-height: 150px;
   }

   .action-button {
       width: 90%;
   }
}

b {
   font-weight: bold;
}

/* Clickable indicators */
.response-textarea {
   cursor: pointer;
   transition: all 0.2s ease;
}

.response-textarea:hover {
   background-color: #f8f9fa;
   border-color: #0078d4;
   box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.3);
}

.preview-content {
   cursor: pointer;
   transition: all 0.2s ease;
}

.preview-content:hover {
   background-color: #f3f2f1;
   border-color: #0078d4;
   box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.3);
}

/* Footer Styles */
footer {
   margin-top: auto;
   padding: 10px 20px;
   background-color: #f8f9fa;
   border-top: 1px solid #edebe9;
   text-align: center;
   flex-shrink: 0;
}

footer p {
   margin: 0;
   font-size: 11px;
   color: #605e5c;
   font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}