/* Custom styles to complement Bootstrap */
.text-area {
    min-height: 600px;
    height: 80vh;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    padding: 1rem;
    width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border: 1px solid var(--bs-secondary);
    border-radius: 0.375rem;
}

.text-area.dragover {
    border-color: var(--bs-primary);
    border-style: dashed;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.text-area:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.chat-area {
    min-height: 2400px;
    max-height: 4000px;
    overflow-y: auto;
    font-size: 0.75rem;  
    line-height: 1.4;
    padding: 0.75rem;
}

.spinner-wrapper {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    background: var(--bs-dark);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0,0,0,0.5);
}

.spinner-text {
    color: var(--bs-primary);
    font-size: 0.9rem;
}

.error-message, .cache-message {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 1rem;
    border-radius: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.error-message.show, .cache-message.show {
    opacity: 1;
}

.error-message {
    background-color: var(--bs-danger);
    color: white;
}

/* Navigation Controls */
.navigation-controls {
    margin: 1rem auto 2rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--bs-dark);
    width: fit-content;
}

.navigation-controls .btn {
    margin: 0 0.5rem;
}

/* Controls Section */
.controls-section {
    position: fixed;
    right: 2rem;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background-color: var(--bs-dark);
    border-radius: 0.25rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 0 1rem rgba(0,0,0,0.2);
    width: 210px;
}

.controls-section .btn {
    width: 100%;
    margin: 0;
    padding: 0.5rem;
    font-size: 0.85rem;
}

.sophistication-control, .length-control {
    background-color: rgba(var(--bs-dark-rgb), 0.8);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.sophistication-input-group {
    margin-top: 0.5rem;
}

.form-range {
    width: 100%;
}

/* Drag and Drop styles */
.drop-zone {
    border: 2px dashed var(--bs-primary);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: var(--bs-dark);
    min-height: 100px;  
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.dragover {
    border-color: var(--bs-info);
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

.drop-zone-text {
    color: var(--bs-secondary);
    font-size: 0.85rem; 
}

.drop-zone-text i {
    font-size: 1.5rem;  
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

.drop-zone-text p {
    margin: 0;
}

.upload-form {
    display: none;
}

/* Container adjustments */
.container {
    max-width: 95%;  
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-right: 280px; 
}

/* Chat container */
.chat-container {
    height: calc(75vh - 300px); 
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.chat-container .chat-area {
    flex-grow: 1;
    width: 100%;
    margin-bottom: 1rem;
    height: calc(75vh - 350px); 
    min-height: 400px; 
}

/* Utility classes */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.btn {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
}