body {
    max-width: 1000px;
    margin: 0 auto;
}

/* iOS Safari touch optimizations */
.play-button, 
#recordButton, 
.btn-confirm, 
.btn-retry, 
.btn-type-custom,
.btn-submit-custom,
.btn-cancel-custom {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* iOS Safari safe area support */
@supports (-webkit-touch-callout: none) {
    .record-button-container {
        bottom: env(safe-area-inset-bottom, 20px);
    }
}
.header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    text-align: center;
}
.subheader {
    background-color: #f8f9fa;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-container {
    position: relative;
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}
.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 100px;
}
.message {
    width: 40%;
    margin-bottom: 15px;

}
.human-message {
    margin-left: auto;
}
.message-content {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 15px;
}
.robot-message .message-content {
    background-color: #6c757d;
    color: white;
}
.human-message .message-content {
    background-color: #007bff;
    color: white;
    flex-direction: row-reverse;
}
.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    margin: 0 10px;
}
.robot-message .profile-icon {
    color: #6c757d;
}
.human-message .profile-icon {
    color: #007bff;
}
.play-button {
    background: none;
    border: none;
    color: white;
    padding: 0;
    margin-right: 10px;
    font-size: 1.5em;
}
.record-button-container {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1000;
    padding-top: 60px;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 1) 20%,
        rgba(255, 255, 255, 1) 100%
    );
}
#recordButton {
    width: 80px;
    height: 80px;
    font-size: 30px;
}
#recordButton.recording {
    background-color: #dc3545;
    border-color: #dc3545;
}

#recordButton.disabled {
    background-color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.65;
    animation: none;
}

.new-conversation-btn {
    position: absolute;
    right: 20px;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.new-conversation-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* For responsive design på mindre skærme */
@media (max-width: 576px) {
    .new-conversation-btn {
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .new-conversation-btn i {
        margin-right: 2px;
    }
}


.message-text {
    width: 100%;
    margin-top: 8px;
    display: none;
}
.message-content {
    flex-wrap: wrap;
}

.chat-info { margin-top: 30px; }

.chat-warn-text, .chat-error-text, .chat-info-text {
    width: 100%;
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
}


.chat-message-clear {
    width: 60%;
    margin: 15px auto;
    text-align: center;
}

.chat-warn, .chat-error {
    display: flex;
    justify-content: center;
}

.chat-warn-text, .chat-error-text {
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
}

.chat-warn-text {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.chat-error-text {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.chat-info-text {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        background-color: #d9534f;
    }
    50% {
        background-color: #c9302c;
    }
    100% {
        background-color: #d9534f;
    }
}

.pulsing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


.ai-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 350px;
    height: 100px;
    margin: 20px auto;
    background-color: #fff;
}

.line {
    width: 10px;
    height: 40px;
    background-color: #00ffcc;
    border-radius: 4px;
    animation: bounce 1s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.7);
}

.line:nth-child(2) {
    animation-delay: 0.1s;
}

.line:nth-child(3) {
    animation-delay: 0.2s;
}

.line:nth-child(4) {
    animation-delay: 0.3s;
}

.line:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: scaleY(1);
        background-color: #00ffcc;
    }
    50% {
        transform: scaleY(2);
        background-color: #009999;
    }
}

/* Enhanced Error Message Styling */
.chat-error {
    margin: 15px 0;
    padding: 15px;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-error-text {
    color: #742a2a;
    line-height: 1.5;
    margin-bottom: 10px;
}

.chat-error-text strong {
    color: #c53030;
}

.error-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #fed7d7;
}

.retry-button {
    background-color: #3182ce;
    border-color: #3182ce;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background-color: #2c5282;
    border-color: #2c5282;
}

/* Platform-specific styling hints */
.chat-error[data-platform="iOS"] {
    border-left: 4px solid #007aff;
}

.chat-error[data-platform="Android"] {
    border-left: 4px solid #34a853;
}

.chat-error[data-platform="Windows"] {
    border-left: 4px solid #0078d4;
}

.chat-error[data-platform="macOS"] {
    border-left: 4px solid #007aff;
}

/* Debug Message Styling */
.chat-debug {
    margin: 5px auto;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    width: 90%;
    border-left: 3px solid;
}

.chat-debug-info {
    background-color: #e8f4f8;
    color: #2c5aa0;
    border-left-color: #2c5aa0;
}

.chat-debug-success {
    background-color: #e8f5e8;
    color: #2d5a2d;
    border-left-color: #28a745;
}

.chat-debug-warn {
    background-color: #fff9e6;
    color: #8a5a00;
    border-left-color: #ffc107;
}

.chat-debug-error {
    background-color: #fdf2f2;
    color: #c53030;
    border-left-color: #dc3545;
}

.chat-debug-text {
    line-height: 1.4;
    word-break: break-all;
}

.chat-debug i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
}

/* Microphone Permission Dialog */
.microphone-permission-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.permission-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.permission-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.permission-content h4 {
    color: #333;
    margin-bottom: 15px;
}

.permission-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.permission-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.permission-actions button {
    min-width: 120px;
}

/* Warning and Info message improvements */
.chat-warn {
    margin: 15px 0;
    padding: 12px;
    background-color: #fffbf0;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
}

.chat-warn-text {
    color: #92400e;
    line-height: 1.4;
}

.chat-info {
    margin: 15px 0;
    padding: 12px;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.chat-info-text {
    color: #0c4a6e;
    line-height: 1.4;
}

/* Confirmation Dialog Styling */
.confirmation-dialog {
    margin: 20px 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.confirmation-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #007bff;
    border-radius: 15px;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0,123,255,0.1);
    animation: slideInUp 0.3s ease-out;
}

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

.confirmation-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
}

.confirmation-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.4;
}

.intelligent-guess {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 15px 0;
    font-style: italic;
    font-size: 1.1rem;
    color: #007bff;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.confidence-indicator {
    text-align: center;
    margin-bottom: 20px;
    color: #6c757d;
}

.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.confirmation-actions .btn {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
}

.btn-confirm {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
    background: linear-gradient(135deg, #218838 0%, #1ac282 100%);
}

.btn-type-custom {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255,193,7,0.3);
}

.btn-type-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,193,7,0.4);
    background: linear-gradient(135deg, #e0a800 0%, #e8590c 100%);
    color: #212529;
}

.btn-retry {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108,117,125,0.3);
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,117,125,0.4);
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
    color: white;
}

.custom-text-input {
    margin-top: 15px;
}

.custom-text-input textarea {
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 60px;
}

.custom-text-input textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    outline: none;
}

.custom-text-input .btn {
    margin: 0 5px;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
}

.processing-message {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    border-left: 4px solid #2196f3;
}

.processing-message .fa-spinner {
    color: #2196f3;
    margin-right: 8px;
}

/* Error Explanation Styling - REMOVED
   The yellow "Hvorfor kan jeg ikke svare?" box has been removed
   Error messages now show directly in the red error box with more specific context
*/

/* Responsive improvements for mobile */
@media (max-width: 600px) {
    .chat-error, .chat-warn, .chat-info {
        margin: 10px 0;
        padding: 10px;
        font-size: 14px;
    }
    
    .retry-button {
        width: 100%;
        margin-top: 8px;
    }
    
    .confirmation-content {
        margin: 10px;
        padding: 15px;
    }
    
    .confirmation-actions .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .intelligent-guess {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    .confirmation-message {
        font-size: 1rem;
    }
}
