/* Custom styles for CRBasic Code Editor */

/* Pitch black background */
body {
    background-color: #000000 !important;
}

.navbar, .bg-dark {
    background-color: #000000 !important;
}

.header-logos {
    background-color: #000000 !important;
}

.footer {
    background-color: #000000 !important;
}

/* Navigation styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 500;
}

.nav-link {
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--bs-primary);
}

/* CodeMirror styles */
.CodeMirror {
    height: auto;
    min-height: 300px;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
}

#result-area {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

/* Button styles */
.d-grid.gap-2 {
    margin-bottom: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease-in-out;
}

.btn i.rotate {
    animation: rotate 1s linear infinite;
}

/* Button progress bar */
.button-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-info) 50%, var(--bs-primary) 100%);
    background-size: 200% 100%;
    animation: progress-animation 2s linear infinite;
    transition: width 0.3s ease-in-out;
}

@keyframes progress-animation {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Loading overlay styles */
.loading-overlay {
    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: 9999;
}

.loading-spinner {
    background-color: var(--bs-dark);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
    width: 300px;
}

.loading-message {
    margin-top: 1rem;
    color: var(--bs-primary);
    font-weight: 500;
}

/* Progress bar styles */
.progress {
    height: 0.5rem;
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-primary);
    margin-top: 1rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-info) 50%, var(--bs-primary) 100%);
    background-size: 200% 100%;
    animation: progress-animation 2s linear infinite;
    transition: width 0.3s ease-in-out;
}

/* Assistance styles */
.assistance-container {
    padding: 1.5rem;
    background-color: rgba(var(--bs-dark-rgb), 0.95);
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.assistance-section {
    background-color: rgba(var(--bs-dark-rgb), 0.8);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.assistance-section:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0.75rem rgba(var(--bs-primary-rgb), 0.2);
    transform: translateY(-2px);
}

.assistance-section.suggestion-applied {
    border-color: var(--bs-success);
    box-shadow: 0 0 1rem rgba(var(--bs-success-rgb), 0.3);
    animation: pulse 1s ease-in-out;
}

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

.assistance-section h5 {
    color: var(--bs-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.assistance-content {
    margin-left: 2.5rem;
    margin-top: 1rem;
    color: var(--bs-light);
    font-size: 1rem;
    line-height: 1.6;
}

.assistance-content p {
    margin-bottom: 1rem;
    color: var(--bs-gray-300);
}

.assistance-content pre {
    background-color: rgba(var(--bs-dark-rgb), 0.95);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    position: relative;
}

.assistance-content pre:hover {
    border-color: var(--bs-primary);
}

.assistance-content code {
    color: var(--bs-info);
    font-family: 'Roboto Mono', monospace;
}

.assistance-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.suggestion-badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background-color: var(--bs-primary);
    color: var(--bs-light);
    margin-right: 1rem;
    font-weight: 500;
}

/* Code Preview Modal */
.modal-content {
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
}

.code-block {
    position: relative;
    margin: 1rem 0;
}

.code-block::before {
    content: 'CRBasic';
    position: absolute;
    top: -0.75rem;
    right: 1rem;
    background-color: var(--bs-primary);
    color: var(--bs-light);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Header logo styles */
.header-logos {
    border-color: var(--bs-border-color) !important;
}

.header-logo {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.header-logo:hover {
    opacity: 1;
}

/* Invert dark logos for visibility on dark theme */
.header-logo[alt="Dam Safety Software"] {
    filter: invert(1) brightness(0.9);
}

/* Footer styles */
.footer {
    background-color: rgba(var(--bs-dark-rgb), 0.95);
    border-color: var(--bs-border-color) !important;
}

/* Chat file drop zone */
.chat-drop-zone {
    border: 1px dashed var(--bs-border-color);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255,255,255,0.02);
}

.chat-drop-zone:hover {
    border-color: #FFD700;
    background-color: rgba(255,215,0,0.05);
}

.chat-drop-zone.drag-over {
    border-color: #FFD700;
    background-color: rgba(255,215,0,0.1);
}

.chat-drop-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary);
    font-size: 0.85rem;
}

.chat-drop-content i {
    font-size: 1rem;
}

.chat-drop-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #FFD700;
    font-size: 0.85rem;
}

.chat-drop-preview .chat-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-drop-preview .btn-close {
    font-size: 0.5rem;
}

/* Processing overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-content {
    text-align: center;
    color: white;
}

.processing-content .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: var(--bs-dark);
        padding: 1rem;
        border-radius: 0.25rem;
        margin-top: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0;
    }

    .assistance-content {
        margin-left: 1rem;
    }

    .assistance-actions {
        flex-direction: column;
    }
}