/* =================================================================
   AI Response Formatting Styles
   Gemensam CSS för snygg formatering av AI-svar
   Används av alla AI-verktyg i Snälla AI-Skolan
   ================================================================= */

/* Base Response Container */
.ai-response-container {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 25px;
    border-radius: 0 10px 10px 0;
    line-height: 1.8;
    color: #2c3e50;
}

/* Headers */
.ai-response-container .ai-header,
.ai-response-container h3.ai-header {
    color: #667eea;
    font-size: 1.3em;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e6ed;
}

.ai-response-container .ai-header:first-child,
.ai-response-container h3.ai-header:first-child {
    margin-top: 0;
}

/* Subheaders */
.ai-response-container .ai-subheader,
.ai-response-container h4.ai-subheader {
    color: #5a67d8;
    font-size: 1.1em;
    font-weight: 600;
    margin: 20px 0 12px 0;
}

/* Paragraphs */
.ai-response-container .ai-paragraph,
.ai-response-container p {
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: justify;
    line-height: 1.8;
}

/* Lists */
.ai-response-container .ai-list,
.ai-response-container .ai-numbered-list {
    margin: 15px 0;
    padding-left: 25px;
}

.ai-response-container .ai-list {
    list-style: none;
}

/* Bullet Points */
.ai-response-container .ai-bullet,
.ai-response-container .ai-list li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 10px;
    color: #2c3e50;
    line-height: 1.6;
}

.ai-response-container .ai-bullet::before,
.ai-response-container .ai-list li::before {
    content: "●";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* Numbered Lists */
.ai-response-container .ai-numbered-list {
    counter-reset: item;
    list-style: none;
    padding-left: 30px;
}

.ai-response-container .ai-numbered,
.ai-response-container .ai-numbered-list li {
    position: relative;
    margin-bottom: 12px;
    padding-left: 10px;
    color: #2c3e50;
    line-height: 1.6;
}

.ai-response-container .ai-numbered::before,
.ai-response-container .ai-numbered-list li::before {
    counter-increment: item;
    content: counter(item) ".";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: -25px;
}

/* Example Boxes */
.ai-response-container .ai-example {
    background: #e8f5e8;
    border-left: 3px solid #4caf50;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-style: italic;
    color: #2e7d32;
}

/* Quote Blocks */
.ai-response-container .ai-quote {
    background: #fff8e1;
    border-left: 3px solid #ffa726;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-style: italic;
    color: #ef6c00;
}

/* Warning/Important Boxes */
.ai-response-container .ai-warning {
    background: #ffebee;
    border-left: 3px solid #f44336;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    color: #c62828;
}

/* Info Boxes */
.ai-response-container .ai-info {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    color: #1565c0;
}

/* Inline Code */
.ai-response-container .ai-inline-code,
.ai-response-container code {
    background: #f3e5f5;
    color: #6a1b9a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.95em;
}

/* Code Blocks */
.ai-response-container .ai-code-block,
.ai-response-container pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Bold Text */
.ai-response-container strong,
.ai-response-container b {
    color: #1976d2;
    font-weight: 600;
}

/* Italic Text */
.ai-response-container em,
.ai-response-container i {
    color: #5e35b1;
    font-style: italic;
}

/* Links */
.ai-response-container a {
    color: #1976d2;
    text-decoration: none;
    border-bottom: 1px solid #90caf9;
    transition: border-color 0.3s ease;
}

.ai-response-container a:hover {
    border-bottom-color: #1976d2;
}

/* Tables */
.ai-response-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ai-response-container table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ai-response-container table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e6ed;
}

.ai-response-container table tr:last-child td {
    border-bottom: none;
}

.ai-response-container table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Horizontal Rule */
.ai-response-container hr {
    border: none;
    border-top: 2px solid #e0e6ed;
    margin: 25px 0;
}

/* Task Lists */
.ai-response-container .ai-task-list {
    list-style: none;
    padding-left: 5px;
}

.ai-response-container .ai-task-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 8px;
}

.ai-response-container .ai-task-item::before {
    content: "☐";
    position: absolute;
    left: 5px;
    color: #667eea;
    font-size: 1.2em;
}

.ai-response-container .ai-task-item.checked::before {
    content: "✓";
    color: #4caf50;
}

/* Highlights */
.ai-response-container .ai-highlight {
    background: #fff176;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Small Text */
.ai-response-container .ai-small,
.ai-response-container small {
    font-size: 0.9em;
    color: #666;
}

/* Dividers with Text */
.ai-response-container .ai-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #999;
    font-size: 0.9em;
    font-weight: 600;
}

.ai-response-container .ai-divider::before,
.ai-response-container .ai-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e0e6ed;
}

.ai-response-container .ai-divider::before {
    margin-right: 15px;
}

.ai-response-container .ai-divider::after {
    margin-left: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-response-container {
        padding: 15px;
    }

    .ai-response-container .ai-header {
        font-size: 1.2em;
    }

    .ai-response-container .ai-paragraph {
        text-align: left;
    }

    .ai-response-container table {
        font-size: 0.9em;
    }
}
