/* Root Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    border: none !important;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 0.125rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow-hover);
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
}

.dropdown-item {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}


.server-card {
    transition: var(--transition);
}

.server-card:hover {
    transform: translateY(-4px);
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-img-top {
    transition: var(--transition);
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 600;
    padding: 0.375em 0.75em;
    border-radius: var(--border-radius);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    border: none;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #0d6efd, #0056b3);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

/* Form Elements */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius-lg);
    border: none;
    font-weight: 500;
}

/* Tables */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-weight: 500;
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, #0d6efd, #0056b3);
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25);
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

/* Server Status */
.server-status-online {
    color: #198754;
}

.server-status-offline {
    color: #dc3545;
}

/* Progress Bars */
.progress {
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 1rem;
}

/* Votifier Section */
.votifier-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer .text-muted {
    color: #adb5bd !important;
}

footer a:hover {
    color: #fff !important;
    transform: translateX(2px);
}

/* Utilities */

.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

.rounded-3 {
    border-radius: var(--border-radius-lg) !important;
}

/* List Items */
.stretched-link::after {
    z-index: 1;
}

.min-w-0 {
    min-width: 0;
}

/* Loading States */
.placeholder-glow .placeholder {
    animation: placeholder-glow 2s ease-in-out infinite alternate;
}

@keyframes placeholder-glow {
    50% {
        opacity: 0.2;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Enhanced focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Highlight for premium servers */
.border-warning.border-2 {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
    border-color: #ffc107 !important;
}

/* Server list hover effects */
.server-list-item {
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.server-list-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Server Banner Styling - Optimized for 468x60px banners */
.banner-container {
    height: 120px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.server-banner {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: var(--transition);
    border-radius: 4px;
}

/* Ensure 468x60 banners are properly displayed */
.server-card .server-banner {
    /* Allow banners to show at their natural size within container */
    min-height: 60px;
    padding: 10px;
    box-sizing: border-box;
}

.server-card:hover .server-banner {
    transform: scale(1.05);
}

/* Banner container styling */
.banner-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.05) 50%, transparent 51%);
    pointer-events: none;
    z-index: 1;
}

/* Status badge positioning */
.banner-container .badge {
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem !important;
    }

    .hero-section .display-4 {
        font-size: 2.5rem;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }

    .banner-container {
        height: 100px;
    }

    .server-card .server-banner {
        padding: 8px;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .d-flex.flex-column.flex-sm-row {
        gap: 0.75rem;
    }

    .banner-container {
        height: 90px;
    }

    .server-card .server-banner {
        padding: 6px;
    }
}

/* Dark mode support (if needed later) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Print styles */
@media print {

    .navbar,
    .footer,
    .btn,
    .dropdown {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Animation for smooth page transitions */
.page-transition {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom spacing utilities */
.gap-4 {
    gap: 1.5rem !important;
}

/* Filter Modal Responsive */
@media (max-width: 576px) {
    #filterModal .modal-dialog {
        margin: 0.5rem;
    }

    #filterModal .modal-lg {
        max-width: none;
    }

    #filterModal .row {
        --bs-gutter-x: 1rem;
    }
}

/* Enhanced Filter Modal Styles */
#filterModal .modal-content {
    border-radius: 1rem;
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#filterModal .modal-header {
    padding: 1.5rem 2rem;
    border-bottom: none;
}

#filterModal .modal-title {
    font-size: 1.25rem;
}

#filterModal .modal-body {
    padding: 2rem;
}

#filterModal .card {
    border-radius: 0.75rem;
}

#filterModal .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#filterModal .category-parent-group {
    border-bottom: 1px solid #f1f3f4;
}

#filterModal .category-parent-group:last-child {
    border-bottom: none;
}

#filterModal .category-item {
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border-left: 3px solid transparent;
}

#filterModal .category-item.parent-category {
    padding: 14px 16px;
}

#filterModal .category-item:hover {
    background: rgba(102, 126, 234, 0.04);
}

#filterModal .category-item.selected {
    background: rgba(102, 126, 234, 0.08);
    border-left-color: #667eea;
}

#filterModal .subcategory-group {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #e9ecef;
    margin-left: 16px;
}

#filterModal .category-item.subcategory {
    padding: 10px 16px;
}

#filterModal .category-item.subcategory .form-check-label {
    font-size: 0.9rem;
}

#filterModal .form-select {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

#filterModal .form-select:hover {
    border-color: #adb5bd;
}

#filterModal .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

#filterModal .form-check-input {
    transition: all 0.2s ease;
}

#filterModal .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

#filterModal .form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

#filterModal .badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    animation: badgePulse 0.3s ease-out;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

#filterModal .modal-footer {
    padding: 1.5rem 2rem;
}

#filterModal .btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: var(--transition);
}

#filterModal .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-1px);
}

#filterModal .premium-filter-box {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 2px solid #ffc107;
    transition: var(--transition);
}

#filterModal .premium-filter-box:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
    transform: translateY(-2px);
}

#filterModal .premium-toggle {
    width: 3rem;
    height: 1.5rem;
}

#filterModal .premium-toggle:checked {
    background-color: #ffc107;
    border-color: #ffc107;
}

#filterModal .hover-opacity-100:hover {
    opacity: 1 !important;
}

#filterModal .category-grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) #f1f3f4;
}

#filterModal .category-grid::-webkit-scrollbar {
    width: 6px;
}

#filterModal .category-grid::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

#filterModal .category-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

#filterModal .category-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Active Filter Badges */
.badge .btn-close {
    padding: 0.1em 0.2em;
    font-size: inherit;
}

.badge .btn-close:hover {
    opacity: 1;
}


/* Server Row Layout Styles */

/* Server Row Item */
.server-row-item {
    transition: var(--transition, all 0.3s ease);
    border: 1px solid #e9ecef;
    background-color: #fff;
}

.server-row-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #dee2e6;
}

/* Server Banner in Row Layout */
.server-banner-container {
    height: 60px;
    overflow: hidden;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-banner-row {
    max-width: 468px;
    /* Set to your banner width */
    max-height: 60px;
    /* Set to your banner height */
    width: auto;
    height: auto;
    object-fit: none;
    /* Don't scale - show at original size */
    n;
    transition: all 0.3s ease;
}

.server-banner-placeholder {
    height: 80px;
    min-height: 80px;
    width: 100%;
    border: 2px dashed #dee2e6;
}

/* Server Row Info */
.server-name a:hover {
    color: #0d6efd !important;
}

.server-description {
    line-height: 1.4;
}

/* Server Row Stats */
.server-stats .fw-semibold {
    font-size: 1.1em;
}

/* Server Row Actions */
.server-actions .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Premium Server Highlight */
.server-row-item.premium {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.server-row-item.premium:hover {
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
}

/* Status Badge in Row */
.server-banner-container .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Responsive Design for Server Rows */
@media (max-width: 768px) {
    .server-row-item {
        padding: 1rem !important;
    }

    .server-banner-container {
        height: 60px;
        margin-bottom: 1rem;
    }

    .server-banner-placeholder {
        height: 60px;
        min-height: 60px;
    }

    .server-stats {
        margin-bottom: 1rem !important;
    }

    .server-actions .d-flex {
        flex-direction: row !important;
        justify-content: center;
        gap: 0.5rem;
    }

    .server-actions .btn-sm {
        flex: 1;
        max-width: 120px;
    }

    .server-name {
        flex: 1;
        margin-right: 1rem;
    }
}

@media (max-width: 576px) {
    .server-banner-container {
        height: 50px;
    }

    .server-banner-placeholder {
        height: 50px;
        min-height: 50px;
    }

    .server-name {
        font-size: 1.1rem;
    }

    .server-description {
        font-size: 0.85rem;
    }

    .server-stats .fw-semibold {
        font-size: 1rem;
    }
}

/* Animation for server rows */
.server-row-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading skeleton for server rows */
.server-row-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.category-item {
    transition: border-color 0.2s ease;
}

.category-item:has(.category-checkbox:checked) {
    border-color: #007bff;
    /*     background-color: rgba(0, 123, 255, 0.03);
 */
}

.form-check-sm .form-check-input {
    width: 14px;
    height: 14px;
}

.form-check-sm .form-check-label {
    font-size: 0.875rem;
}

/* Add to custom.css */

/* --- Mobile Floating Filter Button (FAB) --- */
.btn-fab-filter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.btn-fab-filter:active {
    transform: scale(0.95);
}

/* --- Improved Server Row Layout --- */
.server-row-item {
    padding: 1rem !important;
}

/* Status Indicator (Dot on Icon) */
.server-icon-wrapper {
    position: relative;
    display: inline-block;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    /* Creates a cut-out effect */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* CSS Line Clamping (Replaces PHP substr) */
.text-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Server description text limit */
p.text-clamp-2 {
    max-height: 2.8em;
    word-wrap: break-word;
    word-break: break-word;
}

/* Jodit Content Display Styling */
.jodit-content {
    font-size: 1rem;
    line-height: 1.6;
}

.jodit-content p {
    margin-bottom: 1rem;
}

.jodit-content h1,
.jodit-content h2,
.jodit-content h3,
.jodit-content h4,
.jodit-content h5,
.jodit-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #212529;
}

.jodit-content ul,
.jodit-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.jodit-content li {
    margin-bottom: 0.5rem;
}

.jodit-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.jodit-content a {
    color: #0d6efd;
    text-decoration: none;
}

.jodit-content a:hover {
    text-decoration: underline;
}

.jodit-content blockquote {
    border-left: 4px solid #dee2e6;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .server-icon-responsive {
        width: 60px !important;
        height: 60px !important;
    }

    /* Hide description on very small screens to save space */
    .server-description-mobile-hide {
        display: none;
    }
}


.preview-box {
    text-align: center;
}

/* Banner image preview */
.preview-image-banner {
    max-width: 100%;
    max-height: 300px;
    border: 2px solid #e0e0e0;
}

/* Icon image preview */
.preview-image-icon {
    width: 64px;
    height: 64px;
    border: 2px solid #e0e0e0;
    object-fit: cover;
}

/* Close button for banner preview */
.preview-close-btn-banner {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* Close button for icon preview */
.preview-close-btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    top: -8px;
    right: -8px;
    font-size: 10px;
}

/* Input field spacing after icon */
.input-group .form-control.border-start-0.ps-0 {
    padding-left: 0.3rem !important;
}
