/* =========================================
   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;
}

/* =========================================
   Accessibility
   ========================================= */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    color: #0d6efd;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transform: translateY(-250%);
    transition: transform 0.2s ease;
    z-index: 2000;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

.a11y-focusable:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.9);
    outline-offset: 3px;
    border-radius: 0.375rem;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* =========================================
   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;
}

.alert .btn-close:focus,
.toast .btn-close:focus,
.btn-close:focus {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.toast:focus {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

/* =========================================
   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: #343a40;
    font-weight: 500;
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #4a6cf7, #3b5de7);
    border-color: #4a6cf7;
    box-shadow: 0 4px 10px rgba(74, 108, 247, 0.3);
    color: #ffffff;
}

.pagination .page-link:hover {
    background-color: #f1f3f5;
    border-color: #ced4da;
    color: #212529;
    transform: translateY(-2px);
}

/* =========================================
   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;
}

.stretched-link::after {
    z-index: 1;
}

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

.gap-4 {
    gap: 1.5rem !important;
}

/* =========================================
   Animations
   ========================================= */
.page-transition {
    animation: fadeIn 0.3s ease-in-out;
}

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

.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;
}

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

/* =========================================
   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;
    }
}

@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;
    }
}

/* =========================================
   Dark Mode
   ========================================= */
@media (prefers-color-scheme: dark) {
}

/* =========================================
   Print Styles
   ========================================= */
@media print {
    .navbar,
    .footer,
    .btn,
    .dropdown {
        display: none !important;
    }

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