/* Dark Terminal Theme - Professional Modern Styling */

/* Global Dark Theme Variables */
:root {
    --dark-bg-primary: #0d1117;
    --dark-bg-secondary: #161b22;
    --dark-bg-tertiary: #21262d;
    --dark-border: #30363d;
    --dark-border-hover: #444c56;
    --dark-text-primary: #e6edf3;
    --dark-text-secondary: #7d8590;
    --dark-text-muted: #656d76;
    --dark-accent: #e6edf3;
    --dark-accent-hover: #f0f6fc;
    --dark-success: #e6edf3;
    --dark-warning: #d29922;
    --dark-danger: #f85149;
    --dark-shadow: rgba(0, 0, 0, 0.3);
    --dark-shadow-lg: rgba(0, 0, 0, 0.5);
    --terminal-green: #00ff00;
    --terminal-amber: #ffbf00;
}

/* Base Body and HTML */
html, body {
    background-color: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace !important;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Force white text color in form inputs */
input, textarea, select {
    color: var(--dark-text-primary) !important;
}

input:focus, textarea:focus, select:focus {
    color: var(--dark-text-primary) !important;
}

/* Force black text in user messages */
.message.user .message-content,
.message.user .message-content *,
.message.user .message-content p,
.message.user .message-content span,
.message.user .message-content div {
    color: #000000 !important;
}

/* Container Overrides */
.container, .container-fluid {
    background-color: transparent !important;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-text-primary) !important;
    font-weight: 600 !important;
}

p, span, div, li, td, th {
    color: var(--dark-text-primary) !important;
}

/* Form Controls - Dark Terminal Style */
.form-control, .form-select, textarea {
    background-color: var(--dark-bg-tertiary) !important;
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    font-family: 'SF Mono', monospace !important;
}

.form-control:focus, .form-select:focus, textarea:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(230, 237, 243, 0.25) !important;
    color: var(--dark-text-primary) !important;
}

.form-control::placeholder {
    color: var(--dark-text-muted) !important;
}

/* Labels */
.form-label, label {
    color: var(--dark-text-secondary) !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
}

/* Buttons - Sharp Terminal Style */
.btn {
    border-radius: 0 !important;
    font-weight: 500 !important;
    font-family: 'SF Mono', monospace !important;
    transition: all 0.2s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.btn-primary {
    background-color: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-bg-primary) !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--dark-accent-hover) !important;
    border-color: var(--dark-accent-hover) !important;
    color: var(--dark-bg-primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px var(--dark-shadow) !important;
}

.btn-outline-primary {
    background-color: transparent !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-accent) !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-bg-primary) !important;
    transform: translateY(-1px) !important;
}

.btn-secondary {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-hover) !important;
    color: var(--dark-text-primary) !important;
    transform: translateY(-1px) !important;
}

.btn-success {
    background-color: var(--dark-success) !important;
    border-color: var(--dark-success) !important;
    color: var(--dark-bg-primary) !important;
}

.btn-warning {
    background-color: var(--dark-warning) !important;
    border-color: var(--dark-warning) !important;
    color: var(--dark-bg-primary) !important;
}

.btn-danger {
    background-color: var(--dark-danger) !important;
    border-color: var(--dark-danger) !important;
    color: var(--dark-bg-primary) !important;
}

/* Cards - Terminal Windows */
.card {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px var(--dark-shadow) !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px var(--dark-shadow-lg) !important;
    border-color: var(--dark-border-hover) !important;
}

.card-header {
    background-color: var(--dark-bg-tertiary) !important;
    border-bottom: 1px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    font-weight: 600 !important;
    padding: 1rem !important;
}

.card-body {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text-primary) !important;
    padding: 1.5rem !important;
}

.card-footer {
    background-color: var(--dark-bg-tertiary) !important;
    border-top: 1px solid var(--dark-border) !important;
    color: var(--dark-text-secondary) !important;
}

/* Tables */
.table {
    color: var(--dark-text-primary) !important;
    background-color: var(--dark-bg-secondary) !important;
}

.table th {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    font-weight: 600 !important;
}

.table td {
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--dark-bg-tertiary) !important;
}

.table-hover tbody tr:hover {
    background-color: var(--dark-bg-tertiary) !important;
}

/* Alerts - Terminal Style */
.alert {
    border-radius: 0 !important;
    border-left: 4px solid !important;
    font-family: 'SF Mono', monospace !important;
    font-weight: 500 !important;
}

.alert-primary {
    background-color: rgba(88, 166, 255, 0.1) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-accent) !important;
}

.alert-success {
    background-color: rgba(63, 185, 80, 0.1) !important;
    border-color: var(--dark-success) !important;
    color: var(--dark-success) !important;
}

.alert-warning {
    background-color: rgba(210, 153, 34, 0.1) !important;
    border-color: var(--dark-warning) !important;
    color: var(--dark-warning) !important;
}

.alert-danger {
    background-color: rgba(248, 81, 73, 0.1) !important;
    border-color: var(--dark-danger) !important;
    color: var(--dark-danger) !important;
}

.alert-info {
    background-color: rgba(88, 166, 255, 0.1) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-accent) !important;
}

/* Legacy Alert Styles */
.alert-debug {
    background-color: rgba(125, 133, 144, 0.1) !important;
    border-color: var(--dark-text-secondary) !important;
    color: var(--dark-text-secondary) !important;
}

.alert-error {
    background-color: rgba(248, 81, 73, 0.1) !important;
    border-color: var(--dark-danger) !important;
    color: var(--dark-danger) !important;
}

/* Modal */
.modal-content {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 0 !important;
    color: var(--dark-text-primary) !important;
}

.modal-header {
    border-bottom: 1px solid var(--dark-border) !important;
    background-color: var(--dark-bg-tertiary) !important;
}

.modal-footer {
    border-top: 1px solid var(--dark-border) !important;
    background-color: var(--dark-bg-tertiary) !important;
}

.modal-title {
    color: var(--dark-text-primary) !important;
}

.btn-close {
    filter: invert(1) !important;
}

/* Links */
a {
    color: var(--dark-accent) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

a:hover, a:focus {
    color: var(--dark-accent-hover) !important;
    text-shadow: 0 0 8px rgba(230, 237, 243, 0.6) !important;
}

/* Navigation Overrides */
.nav-link {
    color: var(--dark-text-secondary) !important;
    transition: all 0.3s ease !important;
}

.nav-link:hover, .nav-link:focus {
    color: var(--dark-text-primary) !important;
}

.nav-link.active {
    color: var(--dark-accent) !important;
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--dark-bg-secondary) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 20px var(--dark-shadow-lg) !important;
}

.dropdown-item {
    color: var(--dark-text-primary) !important;
    transition: all 0.2s ease !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-accent) !important;
}

/* Pagination */
.page-link {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    border-radius: 0 !important;
}

.page-link:hover, .page-link:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border-hover) !important;
    color: var(--dark-accent) !important;
}

.page-item.active .page-link {
    background-color: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-bg-primary) !important;
}

/* Badge */
.badge {
    border-radius: 0 !important;
    font-family: 'SF Mono', monospace !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.badge.bg-primary {
    background-color: var(--dark-accent) !important;
    color: var(--dark-bg-primary) !important;
}

.badge.bg-success {
    background-color: var(--dark-success) !important;
    color: var(--dark-bg-primary) !important;
}

.badge.bg-warning {
    background-color: var(--dark-warning) !important;
    color: var(--dark-bg-primary) !important;
}

.badge.bg-danger {
    background-color: var(--dark-danger) !important;
    color: var(--dark-bg-primary) !important;
}

/* Terminal-style animations */
@keyframes terminal-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-cursor::after {
    content: '▋';
    animation: terminal-cursor 1s infinite;
    color: var(--terminal-green);
}

/* Smooth animations for all interactive elements */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Loading states */
.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--dark-border);
    border-top: 2px solid var(--dark-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-border-hover);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem !important;
    }
    
    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .btn:last-child {
        margin-bottom: 0 !important;
    }
}
