* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    /* Prevent horizontal scrollbar caused by elements wider than viewport */
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
} 

.container {
    transition: all 0.3s ease;
}

.input-field {
    transition: border-color 0.3s ease;
}

.input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    animation: slideDown 0.3s ease;
}

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

.card {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Allow flex children to shrink and avoid forcing horizontal scroll */
.flex, .flex-1 {
    min-width: 0;
}

/* Make code blocks and pre tags wrap and scroll internally instead of expanding the page */
pre, code, .code-block {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

/* Responsive media */
img, iframe, video {
    max-width: 100%;
    height: auto;
    display: block;
}

.CodeMirror {
    height: 100% !important;
}

.CodeMirror-scroll {
    height: 100% !important;
    min-height: 100% !important;
}