/* Font Face */
@font-face {
    font-family: 'Orbitron';
    src: url('../fonts/orbitron.black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

/* Base Styles */
body {
    background-color: #0d2622;
    color: #d7d9a9;
}

/* Navbar */
.navbar-custom {
    background-color: #89a681 !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.navbar-brand {
    font-family: 'Orbitron', Arial, sans-serif;
    font-weight: 900;
    color: #000000 !important;
    font-size: 2rem;
    margin-top: -2px;
    margin-bottom: -8px;
    margin-left: 0px;
    margin-right: 0px;
    padding: 0px 4px !important;
    border-radius: 2px !important;
    transition: all 0.2s ease !important;
}

.navbar-brand:hover, .navbar-brand:focus {
    color: #d7d9a9 !important;
    text-decoration: none !important;
}

.navbar-brand:active {
    color: #d7d9a9 !important;
    text-decoration: none !important;
}

.nav-link {
    color: #0d2622 !important;
}

#navbarDropdown {
    color: #0d2622 !important;
}

#navbarDropdown:hover, #navbarDropdown:focus {
    color: #d7d9a9 !important;
}

#navbarDropdown:active {
    color: #d7d9a9 !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: #0d2622;
    border: 1px solid #89a681;
}

.dropdown-item {
    color: #d7d9a9;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #89a681;
    color: #0d2622;
}

/* Cards */
.card {
    background-color: #365949;
    border: 1px solid #365949;
    box-shadow: 0 4px 6px rgba(13, 38, 34, 0.3);
}

.card-header {
    background-color: #365949;
    border-bottom: 1px solid #365949;
    color: #0d2622;
}

.card-header h3 a, .card-header h4, .card-header h5 {
    font-weight: bold;
    color: #000000 !important;
    font-size: 1.5rem;
}

.card-header h4, .card-header h5 {
    color: #0d2622 !important;
}

.card-header small {
    color: #0d2622 !important;
}

.card-header a {
    color: #0d2622 !important;
}

.card-header a:hover, .card-header a:focus, .card-header a:active {
    color: #d7d9a9 !important;
}

.card-header .reply-link {
    background-color: #0d2622;
    color: #d7d9a9 !important;
}

.card-header .reply-link:hover {
    background-color: #89a681;
    color: #0d2622 !important;
}

.card-header .reply-link:active {
    background-color: #89a681;
    color: #d7d9a9 !important;
}

.card-header .text-muted {
    color: #0d2622 !important;
}

.card-body {
    background-color: #0d2622;
    color: #d7d9a9;
}

.card-footer {
    background-color: #0d2622;
    border-top: 1px solid #365949;
}

/* Forms */
.form-control, .form-select {
    background-color: #0d2622;
    border: 1px solid #89a681;
    color: #d7d9a9;
    accent-color: #89a681;
}

.form-control:focus, .form-select:focus {
    background-color: #0d2622;
    border-color: #89a681;
    color: #d7d9a9;
    box-shadow: 0 0 0 0.2rem rgba(137, 166, 129, 0.25);
}

.form-select option {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

.form-select option:hover, .form-select option:focus, .form-select option:active {
    background-color: #89a681 !important;
    color: #0d2622 !important;
    background: #89a681 !important;
}

.form-select option:checked, .form-select option[selected] {
    background-color: #89a681 !important;
    color: #0d2622 !important;
    background: #89a681 !important;
}

/* Webkit specific styling for select dropdowns */
.form-select::-webkit-scrollbar {
    width: 12px;
}

.form-select::-webkit-scrollbar-track {
    background: #0d2622;
}

.form-select::-webkit-scrollbar-thumb {
    background: #89a681;
    border-radius: 6px;
}

.form-select::-webkit-scrollbar-thumb:hover {
    background: #365949;
}

/* Firefox specific styling */
@-moz-document url-prefix() {
    .form-select option:hover {
        background-color: #89a681 !important;
        color: #0d2622 !important;
    }
}

.form-check-input {
    background-color: #0d2622;
    border-color: #365949;
    box-shadow: 0 0 0 0.125rem rgba(54, 89, 73, 0.25);
}

.form-check-input:checked {
    background-color: #365949;
    border-color: #365949;
    box-shadow: 0 0 0 0.125rem rgba(54, 89, 73, 0.25);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(54, 89, 73, 0.25);
}

/* Buttons */
.btn-primary {
    background-color: #365949;
    border-color: #365949;
    color: #0d2622;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #F2A03D;
    border-color: #F2A03D;
    color: #0d2622;
}

.btn-outline-success, .btn-outline-warning, .btn-outline-danger {
    background-color: #0d2622 !important;
}

.btn-outline-success:hover, .btn-outline-warning:hover, .btn-outline-danger:hover {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

.btn-outline-success:focus, .btn-outline-warning:focus, .btn-outline-danger:focus {
    background-color: #0d2622 !important;
}

.btn-outline-success:active, .btn-outline-warning:active, .btn-outline-danger:active {
    background-color: #0d2622 !important;
}

/* Messages Page Styles */
.conversation-item {
    border: none !important;
    border-bottom: 1px solid rgba(215, 217, 169, 0.1) !important;
    background-color: #0d2622 !important;
    padding: 0.5rem !important;
}

p.conversation-muted,
small.conversation-muted {
    color: #d7d9a9 !important;
}

.conversation-item:hover {
    background-color: #89a681 !important;
    color: #0d2622 !important;
}

.conversation-item:hover h6,
.conversation-item:hover a {
    color: #0d2622 !important;
}

.conversation-item:hover .conversation-muted {
    color: #0d2622 !important;
}

.conversation-item:hover .rounded-circle.bg-primary {
    background-color: #0d2622 !important;
    color: #89a681 !important;
}

.conversation-unread {
    border-left: 4px solid #F2A03D !important;
}

.message-bubble.sent .message-content {
    background-color: #365949;
    color: #d7d9a9;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 15px;
    max-width: 70%;
}

.message-bubble.received .message-content {
    background-color: #365949;
    color: #d7d9a9;
    border-radius: 18px 18px 18px 4px;
    padding: 10px 15px;
    max-width: 70%;
}

.message-time {
    font-size: 0.75rem;
    display: block;
    margin-top: 5px;
}

.conversation-messages {
    background-color: #0d2622 !important;
    border: 2px solid #365949 !important;
    border-radius: 8px;
}

.card-header.conversations-header {
    background-color: #365949 !important;
    color: #d7d9a9 !important;
}

.card-header.conversations-header h5 {
    color: #d7d9a9 !important;
}

textarea.form-control {
    background-color: #0d2622 !important;
    border: 2px solid #365949 !important;
    color: #d7d9a9 !important;
}

textarea.form-control:focus {
    background-color: #0d2622 !important;
    border-color: #d7d9a9 !important;
    color: #d7d9a9 !important;
    box-shadow: 0 0 0 0.2rem rgba(215, 217, 169, 0.25) !important;
}

textarea.form-control::placeholder {
    color: #d7d9a9 !important;
}

.btn-outline-warning {
    border-color: #F2A03D !important;
    color: #F2A03D !important;
}

.btn-outline-success {
    border-color: #89a681 !important;
    color: #89a681 !important;
}

.btn-outline-danger {
    border-color: #F26363 !important;
    color: #F26363 !important;
}

/* Links */
a {
    color: #365949;
}

a:hover, a:focus {
    color: #F2A03D;
}

/* List Groups */
.list-group-item {
    background-color: #89a681;
    border-color: #89a681;
    color: #d7d9a9;
}

.list-group-item:hover {
    background-color: #89a681;
}

/* Alerts */
.alert-success {
    background-color: #0d2622;
    border-color: #365949;
    color: #d7d9a9;
}

/* Background Utilities */
.bg-secondary {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

.bg-warning {
    background-color: #F2A03D !important;
}

/* Admin Banners */
.admin-banner {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(13, 38, 34, 0.2);
}

.admin-banner.info {
    background-color: #89a681;
    color: #0d2622;
    border-left: 4px solid #89a681;
}

.admin-banner.warning {
    background-color: #F26363;
    color: #0d2622;
    border-left: 4px solid #F26363;
}

.admin-banner.danger {
    background-color: #F26363;
    color: #d7d9a9;
    border-left: 4px solid #F26363;
}

.admin-banner.success {
    background-color: #89a681;
    color: #d7d9a9;
    border-left: 4px solid #89a681;
}

/* Page-specific Containers */
.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.register-container {
    max-width: 400px;
    margin: 50px auto;
}

.admin-container {
    max-width: 800px;
    margin: 50px auto;
}

.profile-container {
    max-width: 600px;
    margin: 50px auto;
}

.main-content {
    margin-top: 20px;
}

/* Dashboard specific styles */
.welcome-card {
    background: linear-gradient(135deg, #89a681 0%, #89a681 100%);
    color: #d7d9a9;
    border: 1px solid #89a681;
}

.post-card {
    margin-bottom: 20px;
    background-color: #89a681;
    border: 1px solid #89a681;
    box-shadow: 0 2px 4px rgba(13, 38, 34, 0.3);
}

/* Reply and Edit Forms */
.reply-form, .edit-form, .edit-reply-form {
    display: none;
    margin-top: 10px;
}

.edit-form, .edit-reply-form {
    border: 2px solid #89a681;
    border-radius: 8px;
    padding: 10px;
}

.reply-textarea, .edit-textarea {
    background-color: #0d2622;
    border: 1px solid #89a681;
    color: #d7d9a9;
    resize: none;
    min-height: 60px;
    max-height: 300px;
    border-radius: 4px;
    overflow-y: auto;
}

.reply-textarea {
    border: 1px solid #89a681;
}

.edit-textarea {
    border: 1px solid #89a681;
    min-height: 80px;
}

.reply-textarea:focus, .edit-textarea:focus {
    background-color: #0d2622;
    border-color: #89a681;
    color: #d7d9a9;
    box-shadow: 0 0 0 0.2rem rgba(137, 166, 129, 0.25);
    outline: none;
}

.reply-textarea:focus {
    border-color: #89a681;
    box-shadow: 0 0 0 0.2rem rgba(137, 166, 129, 0.25);
}

.edit-textarea:focus {
    border-color: #89a681;
    box-shadow: 0 0 0 0.2rem rgba(137, 166, 129, 0.25);
}

.reply-item {
    margin-bottom: 0px;
    margin-top: 0px;
    padding: 2px 6px;
    background-color: #0d2622;
    border-radius: 8px;
}

.thread-content-container {
    background-color: #0d2622;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

/* Reply indentation - each level adds 20px relative to its parent */
.reply-indent-1, .reply-indent-2, .reply-indent-3, 
.reply-indent-4, .reply-indent-5 {
    margin-left: 20px;
    border-left: 2px solid #365949;
    padding-left: 8px;
}

/* No additional indentation for replies deeper than 5 levels */
.reply-indent-max {
    margin-left: -6px;
}

.reply-to-reply-form {
    display: none;
    margin-top: 8px;
    margin-left: 26px;
}

.reply-link {
    background-color: #0d2622;
    color: #d7d9a9 !important;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reply-link:hover {
    background-color: #365949;
    color: #0d2622 !important;
    text-decoration: none;
}

.reply-link:active {
    background-color: #89a681;
    color: #d7d9a9 !important;
    text-decoration: none;
}

a.auth-link {
    color: black !important;
    background-color: #89a681 !important;
    text-decoration: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

a.auth-link:hover, a.auth-link:focus {
    background-color: #0d2622 !important;
    color: #89a681 !important;
    text-decoration: none !important;
}

a.auth-link:active {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
    text-decoration: none !important;
}

/* Profile specific styles */
.profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.profile-stats {
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.profile-update-btn {
    background-color: #365949 !important;
    border-color: #365949 !important;
    color: #0d2622 !important;
}

.profile-update-btn:hover, .profile-update-btn:focus {
    background-color: #F2A03D !important;
    border-color: #F2A03D !important;
    color: #0d2622 !important;
}

/* Admin specific buttons */
.admin-save-btn {
    background-color: #0d2622 !important;
    border-color: #365949 !important;
    color: #365949 !important;
}

.admin-save-btn:hover, .admin-save-btn:focus, .admin-save-btn:active {
    background-color: #365949 !important;
    border-color: #365949 !important;
    color: #d7d9a9 !important;
}

/* Banner preview */
.banner-preview {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
    background-color: #F26363;
    color: black;
}

.banner-preview.show {
    display: block;
}

/* Member Management */
.member-item {
    padding: 12px 15px;
}

.member-item:not(:last-child) {
    border-bottom: 1px solid #89a681;
}

.status-badge {
    font-size: 0.75rem;
    color: #0d2622 !important;
}

.action-btn {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.member-section {
    display: none;
}

.member-section.active {
    display: block;
}

.member-nav-btn.active,
.member-nav-btn.active:hover,
.member-nav-btn.active:focus,
.member-nav-btn.active:active {
    background-color: #89a681 !important;
    border-color: #89a681 !important;
    color: #0d2622 !important;
}

.member-nav-btn.active.btn-outline-warning,
.member-nav-btn.active.btn-outline-warning:hover,
.member-nav-btn.active.btn-outline-warning:focus,
.member-nav-btn.active.btn-outline-warning:active {
    background-color: #F2A03D !important;
    border-color: #F2A03D !important;
    color: #0d2622 !important;
}

.member-nav-btn.active.btn-outline-danger,
.member-nav-btn.active.btn-outline-danger:hover,
.member-nav-btn.active.btn-outline-danger:focus,
.member-nav-btn.active.btn-outline-danger:active {
    background-color: #F26363 !important;
    border-color: #F26363 !important;
    color: #0d2622 !important;
}

.member-nav-btn.active .badge {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

#active-members .bg-primary {
    background-color: #89a681 !important;
}

#active-members {
    background-color: #89a681 !important;
    border-color: #89a681 !important;
}

#active-members .card-header {
    background-color: #89a681 !important;
}

#active-members .card-header .badge {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

#active-members .member-item:not(:last-child) {
    border-bottom: 1px solid #89a681 !important;
}

#banned-members {
    background-color: #F26363 !important;
    border-color: #F26363 !important;
}

#banned-members .card-header {
    background-color: #F26363 !important;
}

#banned-members .card-header .badge {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

#banned-members .member-item:not(:last-child) {
    border-bottom: 1px solid #F26363 !important;
}

#banned-members .bg-danger {
    background-color: #F26363 !important;
}

#pending-members {
    background-color: #F2A03D !important;
    border-color: #F2A03D !important;
}

#pending-members .card-header {
    background-color: #F2A03D !important;
}

#pending-members .card-header .badge {
    background-color: #0d2622 !important;
    color: #d7d9a9 !important;
}

#pending-members .member-item:not(:last-child) {
    border-bottom: 1px solid #F2A03D !important;
}

#pending-members .bg-warning {
    background-color: #F2A03D !important;
}

/* About page specific styles */
.about-container {
    max-width: 800px;
    margin: 50px auto;
}

.markdown-example {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 4px solid #89a681;
    padding: 15px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
}

.markdown-result {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid #365949;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.syntax-highlight {
    color: #F2A03D;
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Text Muted Global Style */
.text-muted {
    color: #0d2622 !important;
}

/* Text Muted Low Style */
.text_muted_low {
    color: #d7d9a9 !important;
}

/* Badge Style */
.badge {
    background-color: #d7d9a9 !important;
    color: #0d2622 !important;
}

/* Post Type Tab Styles - Active/Checked State */
.btn-check:checked + .btn-outline-success {
    background-color: #89a681 !important;
    border-color: #89a681 !important;
    color: #0d2622 !important;
}

.btn-check:checked + .btn-outline-warning {
    background-color: #F2A03D !important;
    border-color: #F2A03D !important;
    color: #0d2622 !important;
}

.btn-check:checked + .btn-outline-danger {
    background-color: #F26363 !important;
    border-color: #F26363 !important;
    color: #0d2622 !important;
}

/* Form Text Style */
.form-text {
    color: #d7d9a9 !important;
}

/* More specific form-text targeting */
div.form-text,
.form-text.text-muted,
.mb-3 .form-text,
.card .form-text,
.container .form-text,
body .form-text {
    color: #d7d9a9 !important;
}

/* Avatar styling for default (no image) avatars */
/* Main post avatars (40px) use header_banner background */
.bg-primary[style*="width: 40px"] {
    background-color: #89a681 !important;
    color: #0d2622 !important;
}

/* Reply avatars (24px) use container_main background */
.bg-primary[style*="width: 24px"] {
    background-color: #365949 !important;
    color: #0d2622 !important;
}

/* Profile avatars (60px and 80px) keep header_banner */
.bg-primary[style*="width: 60px"], .bg-primary[style*="width: 80px"] {
    background-color: #89a681 !important;
    color: #0d2622 !important;
}

/* Profile avatar class specific styling */
.profile-avatar.bg-primary {
    background-color: #89a681 !important;
    color: #0d2622 !important;
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-dropdown-toggle {
    background-color: #0d2622;
    border: 1px solid #89a681;
    color: #d7d9a9;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    position: relative;
}

.custom-dropdown-toggle:after {
    content: "▼";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #d7d9a9;
}

.custom-dropdown-toggle:focus {
    border-color: #89a681;
    box-shadow: 0 0 0 0.2rem rgba(137, 166, 129, 0.25);
    outline: none;
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #0d2622;
    border: 1px solid #89a681;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(13, 38, 34, 0.15);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-item {
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    color: #d7d9a9;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.custom-dropdown-item:hover, .custom-dropdown-item:focus {
    background-color: #89a681;
    color: #0d2622;
}

/* Color box preview styling - override card-body background */
.color-box-0 { background-color: #0d2622 !important; }
.color-box-1 { background-color: #89a681 !important; }
.color-box-2 { background-color: #d7d9a9 !important; }
.color-box-3 { background-color: #365949 !important; }
.color-box-4 { background-color: #89a681 !important; }
.color-box-5 { background-color: #F2A03D !important; }
.color-box-6 { background-color: #F26363 !important; }
.color-box-7 { background-color: #000000 !important; }
.color-box-8 { background-color: #0d2622 !important; }
.color-box-9 { background-color: #d7d9a9 !important; }

/* File input styling - only the button, not the text area */

.form-control[type="file"]::file-selector-button {
    background-color: #365949 !important;
    border-color: #365949 !important;
    color: #0d2622 !important;
    border: 1px solid #365949;
    border-radius: 0.375rem 0 0 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
}

.form-control[type="file"]:hover::file-selector-button {
    background-color: #F2A03D !important;
    border-color: #F2A03D !important;
    color: #0d2622 !important;
}

/* Reply author link styling */
.reply-item strong a:hover,
.reply-item strong a:focus,
.reply-item strong a:active {
    color: #0d2622 !important;
    background-color: #365949 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

/* User name link styling */
.user-name-link {
    text-decoration: none !important;
    color: #d7d9a9 !important;
    transition: color 0.2s ease !important;
}

.user-name-link:hover,
.user-name-link:focus {
    color: #0d2622 !important;
}

/* Post date styling */
.post-date {
    color: #d7d9a9 !important;
    transition: color 0.2s ease !important;
}

.post-date:hover {
    color: #0d2622 !important;
}

/* Hide/Show post content */
.card-body.post-content.hidden,
.post-content.hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

/* Messages page user name styling - override card-header defaults */
.card-header h5 .user-name-link {
    color: #d7d9a9 !important;
    transition: color 0.2s ease !important;
}

.card-header h5 .user-name-link:hover,
.card-header h5 .user-name-link:focus,
.card-header h5 .user-name-link:active {
    color: #0d2622 !important;
}

/* Post author names in dashboard and thread pages - override card-header defaults */
.card-header h6 .user-name-link,
.card-header .user-name-link,
.post-card .card-header .user-name-link,
.post-card .card-header h6 a[href*="profile.php"],
.card-header h6 a[href*="profile.php"] {
    color: #d7d9a9 !important;
    transition: color 0.2s ease !important;
    text-decoration: none !important;
}

.card-header h6 .user-name-link:hover,
.card-header h6 .user-name-link:focus,
.card-header h6 .user-name-link:active,
.card-header .user-name-link:hover,
.card-header .user-name-link:focus,
.card-header .user-name-link:active,
.post-card .card-header .user-name-link:hover,
.post-card .card-header .user-name-link:focus,
.post-card .card-header .user-name-link:active,
.post-card .card-header h6 a[href*="profile.php"]:hover,
.post-card .card-header h6 a[href*="profile.php"]:focus,
.post-card .card-header h6 a[href*="profile.php"]:active,
.card-header h6 a[href*="profile.php"]:hover,
.card-header h6 a[href*="profile.php"]:focus,
.card-header h6 a[href*="profile.php"]:active {
    color: #0d2622 !important;
}

/* Post dates in dashboard and thread pages - override card-header defaults */
.card-header .post-date,
.post-card .card-header .post-date,
.card-header small[class*="post-date"],
.post-card .card-header small {
    color: #d7d9a9 !important;
}
