/* Global dark theme - must be at the top to override Bootstrap */
html, body {
    background-color: #1a1a1a !important;
    color: #e6edf3 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

body {
    background-color: #1a1a1a !important;
    color: #e6edf3 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* Override Bootstrap's default background */
.container, .container-fluid {
    background-color: transparent !important;
}

/* Ensure all main elements have dark background */
main, .main-content {
    background-color: #1a1a1a !important;
}

/* Override any remaining white backgrounds */
.bg-white, .bg-light {
    background-color: #1a1a1a !important;
}

/* Ensure text is readable on dark background */
p, span, div {
    color: #e6edf3 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #f5d57c;
    font-weight: 600;
}

.main-title {
    color: #F0C04C;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: bold;
}

.subtitle {
    color: #ffd700;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

/* Form Elements */
.form-control, .form-select {
    background-color: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 6px;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #262730;
    border-color: #F0C04C;
    color: #fafafa;
    box-shadow: 0 0 0 0.2rem rgba(240, 192, 76, 0.25);
}

.form-label {
    color: #e6edf3;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-check-input {
    background-color: #161b22;
    border: 1px solid #30363d;
}

.form-check-input:checked {
    background-color: #F0C04C;
    border-color: #F0C04C;
}

.form-check-label {
    color: #e6edf3;
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: #238636;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2ea043;
    color: #fff;
}

.btn-success {
    background-color: #238636;
    color: #fff;
}

.btn-success:hover {
    background-color: #2ea043;
    color: #fff;
}

.btn-danger {
    background-color: #eb6416;
    color: #fff;
}

.btn-danger:hover {
    background-color: #f85149;
    color: #fff;
}

.btn-warning {
    background-color: #f0c040;
    color: #000;
}

.btn-warning:hover {
    background-color: #f0c040;
    color: #000;
    opacity: 0.9;
}

.btn-secondary {
    background-color: #30363d;
    color: #e6edf3;
}

.btn-secondary:hover {
    background-color: #484f58;
    color: #e6edf3;
}

.btn-outline-warning {
    border-color: #f0c040;
    color: #f0c040;
}

.btn-outline-warning:hover {
    background-color: #f0c040;
    color: #000;
}

.btn-outline-danger {
    border-color: #da3633;
    color: #da3633;
}

.btn-outline-danger:hover {
    background-color: #da3633;
    color: #fff;
}

.btn-outline-info {
    border-color: #79c0ff;
    color: #79c0ff;
}

.btn-outline-info:hover {
    background-color: #79c0ff;
    color: #000;
}

/* Cards */
.card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.card-header {
    background-color: #21262d;
    border-bottom: 1px solid #30363d;
    color: #e6edf3;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    color: #e6edf3;
}

.table-dark {
    background-color: #161b22;
}

.table-dark th {
    background-color: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

.table-dark td {
    border-color: #30363d;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #21262d;
}

/* Alerts */
.alert {
    border-radius: 6px;
    border: none;
}

.alert-info {
    background-color: rgba(121, 192, 255, 0.1);
    color: #79c0ff;
    border-left: 4px solid #79c0ff;
}

.alert-success {
    background-color: rgba(46, 160, 67, 0.1);
    color: #4ac26b;
    border-left: 4px solid #4ac26b;
}

.alert-warning {
    background-color: rgba(240, 192, 76, 0.1);
    color: #f0c040;
    border-left: 4px solid #f0c040;
}

.alert-danger {
    background-color: rgba(218, 54, 51, 0.1);
    color: #ff6b6b;
    border-left: 4px solid #ff6b6b;
}

/* Navigation */
.nav-tabs {
    border-bottom: 1px solid #30363d;
}

.nav-tabs .nav-link {
    background-color: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 6px 6px 0 0;
}

.nav-tabs .nav-link.active {
    background-color: #21262d;
    border-color: #30363d #30363d #21262d;
    color: #f0c040;
}

.nav-pills .nav-link {
    background-color: #161b22;
    color: #e6edf3;
    border-radius: 6px;
}

.nav-pills .nav-link.active {
    background-color: #F0C04C;
    color: #000;
}

/* Accordion */
.accordion-item {
    background-color: #161b22;
    border: 1px solid #30363d;
}

.accordion-button {
    background-color: #161b22;
    color: #e6edf3;
    border: none;
}

.accordion-button:not(.collapsed) {
    background-color: #21262d;
    color: #f0c040;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(240, 192, 76, 0.25);
}

.accordion-body {
    background-color: #161b22;
    color: #e6edf3;
}

/* List Group */
.list-group-item {
    background-color: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
}

.list-group-item:hover {
    background-color: #21262d;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.bg-primary {
    background-color: #0a2a70 !important;
}

.bg-success {
    background-color: #126823 !important;
}


.bg-danger {
    background-color: #da3633 !important;
}

/* Links */
a {
    color: #79c0ff;
    text-decoration: none;
}

a:hover {
    color: #a5d6ff;
    text-decoration: underline;
}

/* Flashes */
.flashes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flashes li {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.flashes li.success {
    background-color: rgba(46, 160, 67, 0.1);
    color: #4ac26b;
    border-left-color: #4ac26b;
}

.flashes li.danger {
    background-color: rgba(218, 54, 51, 0.1);
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

.flashes li.warning {
    background-color: rgba(240, 192, 76, 0.1);
    color: #f0c040;
    border-left-color: #f0c040;
}

.flashes li.info {
    background-color: rgba(121, 192, 255, 0.1);
    color: #79c0ff;
    border-left-color: #79c0ff;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    right: 0;
    background-color: #1E1E1E;
    text-align: right;
    opacity: 0.9;
    font-size: 12px;
    z-index: 100;
    padding: 4px 10px;
    border-top-left-radius: 8px;
    color: #FFA500;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Loading Spinner */
.spinner-border {
    color: #F0C04C;
}

/* Text Colors */
.text-warning {
    color: #f0c040 !important;
}

.text-success {
    color: #4ac26b !important;
}

.text-danger {
    color: #ff6b6b !important;
}

.text-info {
    color: #79c0ff !important;
}

.text-primary {
    color: #79c0ff !important;
}

.text-light {
    color: #e6edf3 !important;
}

.text-muted {
    color: #8b949e !important;
}

/* Border Colors */
.border-warning {
    border-color: #f0c040 !important;
}

.border-success {
    border-color: #4ac26b !important;
}

.border-danger {
    border-color: #ff6b6b !important;
}

.border-info {
    border-color: #79c0ff !important;
}

.border-primary {
    border-color: #79c0ff !important;
}

.border-secondary {
    border-color: #30363d !important;
}

/* Analysis History Styles */
.analysis-history {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.analysis-item {
    background-color: #21262d;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #30363d;
    position: relative;
}

.analysis-item:hover {
    background-color: #30363d;
    border-color: #f0c040 !important;
    transform: translateX(2px);
}

.analysis-item:active {
    background-color: #40464d;
    transform: translateX(1px);
}

.analysis-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.analysis-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #f0c040;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analysis-item .text-info {
    font-weight: 600;
}

.analysis-item small {
    font-size: 0.75rem;
}

.analysis-item .text-light {
    font-size: 0.7rem;
    line-height: 1.2;
    word-wrap: break-word;
}

/* Sidebar height adjustment */
.h-100 {
    height: 100vh !important;
    min-height: 600px;
}

/* Ensure sidebar content is properly spaced */
.d-flex.flex-column {
    height: 100%;
}

.mt-auto {
    margin-top: auto !important;
}

/* Fix sidebar card overflow */
.card.h-100 {
    overflow: hidden;
}

.card-body.d-flex.flex-column {
    overflow: hidden;
}