/* =============================================
   VARIABLES
   ============================================= */
   :root {
    /* Color Palette */
    --primary-black: #121212;
    --secondary-black: #1e1e1e;
    --primary-gray: #2d2d2d;
    --secondary-gray: #3d3d3d;
    --light-gray: #aaaaaa;
    --primary-purple: #9370DB; /* Medium Purple */
    --secondary-purple: #7B68EE; /* Medium Slate Blue */
    --dark-purple: #6A5ACD; /* Slate Blue */
    --text-color: #e0e0e0;
    --success-color: #4CAF50;
    --border-color: #444;
}

/* =============================================
   BASE ELEMENTS
   ============================================= */
body {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    min-height: 100vh;
}

/* =============================================
   NAVIGATION
   ============================================= */
.navbar {
    background: linear-gradient(90deg, var(--primary-black) 0%, var(--dark-purple) 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.navbar-brand {
    color: var(--text-color) !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(147, 112, 219, 0.5);
}

.nav-link {
    color: var(--text-color) !important;
}

.nav-link:hover {
    color: var(--primary-purple) !important;
}

/* =============================================
   CARD ELEMENTS
   ============================================= */
.card {
    margin-bottom: 20px;
    background-color: var(--primary-gray);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    height: 100%;
}

.card-title {
    color: var(--primary-purple);
}

.card-subtitle {
    color: var(--light-gray) !important;
}

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

.bot-card {
    transition: all 0.3s ease-in-out;
    border-left: 3px solid var(--primary-purple);
}

.bot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--secondary-purple);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
    background-color: var(--primary-purple) !important;
    border-color: var(--primary-purple) !important;
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: var(--secondary-purple) !important;
    border-color: var(--secondary-purple) !important;
}

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

.btn-secondary {
    background-color: var(--secondary-gray) !important;
    border-color: var(--secondary-gray) !important;
}

/* =============================================
   FORMS
   ============================================= */
.form-control, 
.form-select {
    background-color: var(--primary-black);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.form-control:focus, 
.form-select:focus {
    background-color: var(--primary-black);
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.25rem rgba(147, 112, 219, 0.25);
    color: var(--text-color);
}

.form-text {
    color: var(--light-gray);
}

.form-check-input:checked {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
}

/* Manual post content area */
#manualPostContent {
    resize: vertical;
    min-height: 120px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-content {
    background-color: var(--secondary-gray);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

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

/* =============================================
   UTILITIES
   ============================================= */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pubkey {
    font-family: monospace;
    font-size: 0.85em;
    color: var(--light-gray);
    background-color: var(--secondary-black);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* =============================================
   CUSTOM SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-purple);
}

/* =============================================
   CONTENT MANAGEMENT PAGE
   ============================================= */
/* Bot selection container */
.bot-selection-container {
    background-color: var(--primary-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Image preview container - FIXED VERSION */
.upload-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 4px;
    object-fit: contain;
    border: 1px solid var(--secondary-gray);
    background-color: var(--primary-black);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#uploadPreviewContainer, 
#mediaPreviewContainer {
    max-width: 100%;
    max-height: 250px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: var(--primary-black);
    text-align: center;
    padding: 5px;
}

/* Improve the media link containers */
.media-link {
    word-break: break-all;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 4px;
    background-color: var(--secondary-black);
    margin-top: 5px;
}

/* Media upload container */
.media-upload-container {
    background-color: var(--primary-gray);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

/* Server URL input improvements */
#primaryServerURL, 
#fallbackServerURL {
    margin-top: 5px;
    font-size: 0.9rem;
    background-color: var(--primary-black);
    border-color: var(--secondary-gray);
}

/* Better looking file list */
.list-group-item {
    background-color: var(--secondary-gray);
    border-color: var(--primary-black);
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: var(--primary-gray);
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */
@media (max-width: 768px) {
    .card {
        margin-bottom: 20px;
    }
    
    .bot-selection-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .upload-preview {
        max-height: 150px;
    }
}