/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* ADDED: Import Arabic font */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

/* --- Custom Properties (Variables) --- */
:root {
    --primary-color: #6a5acd; /* SlateBlue */
    --secondary-color: #2c2f33; /* Near-black */
    --accent-color: #7289da; /* Discord Blurple */
    --success-color: #43b581; /* Discord Green */
    --danger-color: #f04747; /* Discord Red */
    --warning-color: #faa61a; /* Discord Yellow */
    --premium-color: #ff8a00; /* Premium Orange */
    --premium-gradient: linear-gradient(135deg, #ff8a00, #e52e71);
    --text-color: #dcddde;
    --text-muted: #96989d;
    --border-radius: 12px;
    --card-bg: rgba(44, 47, 51, 0.7);
    --input-bg: rgba(32, 34, 37, 0.8);
    --input-border: rgba(60, 63, 68, 0.8);
    --hover-glow: 0 0 20px rgba(114, 137, 218, 0.5);
    --backdrop-blur: blur(10px);
}

/* --- Base Styles --- */
html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1c20;
    background-image: linear-gradient(to bottom right, #1a1c20, #2c2f33);
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Particle Animation Background --- */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

#particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.4;
    animation: float 6s ease-in-out infinite;
}

/* --- Layout & Containers --- */
.container {
    max-width: 1200px;
    padding: 1rem 2rem;
}

.main-content {
    flex-grow: 1;
}

/* --- Enhanced Navbar (NEW DESIGN) --- */
.navbar {
    background-color: rgba(32, 34, 37, 0.6);
    border-bottom: 1px solid var(--input-border);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--accent-color);
    transition: text-shadow 0.3s ease;
    margin-right: 1.5rem !important;
    display: flex;
    align-items: center;
}
.navbar-brand:hover {
    text-shadow: 0 0 10px var(--accent-color);
}
.navbar-brand i {
    margin-right: 0.5rem;
}
.navbar-nav .nav-item {
    margin: 0 0.25rem;
}
.navbar-nav .nav-link {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}
.navbar-nav .nav-link i {
    margin-right: 0.5rem;
}
.navbar-nav .nav-item .dropdown-toggle.d-flex {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    display: flex;
    align-items: center;
}
.navbar-nav .nav-item .dropdown-toggle.d-flex:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.navbar-toggler {
    border-color: rgba(255,255,255,0.1);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28220, 221, 222, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--input-border);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}
.dropdown-item {
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.dropdown-item:hover {
    background-color: var(--accent-color);
    color: #fff;
}
.dropdown-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}
.navbar .btn {
    font-size: 1rem;
}
.navbar .btn-success {
    background: linear-gradient(45deg, #43b581, #3da274);
    box-shadow: 0 4px 15px -5px rgba(67, 181, 129, 0.7);
}
.navbar .btn-success:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px -5px rgba(67, 181, 129, 0.9);
}

/* --- Cards --- */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}
.card-title {
    font-weight: 600;
    color: #fff;
}

/* --- Buttons --- */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    transition: all 0.2s ease-in-out;
    border: none;
}
.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 15px -5px rgba(114, 137, 218, 0.7);
}
.btn-primary:hover {
    background-color: #677bc4;
    box-shadow: var(--hover-glow);
    transform: translateY(-2px);
}

/* --- Forms --- */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus, .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(114, 137, 218, 0.6);
}

/* --- Discord Embed Preview (NEW DESIGN) --- */
.discord-embed-preview {
    background-color: var(--secondary-color);
    border-radius: 8px;
    display: flex;
    position: relative;
    border: 1px solid var(--input-border);
    max-width: 520px;
}
.embed-color-bar {
    width: 4px;
    background-color: var(--accent-color);
    border-radius: 4px 0 0 4px;
    flex-shrink: 0;
}
.embed-content {
    padding: 1rem;
    width: 100%;
    min-width: 0; /* Prevents flexbox overflow */
}
.embed-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}
.embed-author-name {
    font-weight: 600;
    color: #fff;
}
.embed-body {
    display: flex;
    gap: 16px;
}
.embed-main-content {
    flex-grow: 1;
    min-width: 0; /* Prevents flexbox overflow */
}
.embed-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    word-break: break-word;
}
.embed-description {
    color: var(--text-color);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.embed-description code {
    background: var(--input-bg);
    padding: .2em .4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.embed-thumbnail {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.embed-image {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 16px;
}
.embed-footer {
    display: flex;
    align-items: center;
    margin-top: 8px;
}
.embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
}
.embed-footer-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- Homepage Sections --- */
.section-spacer {
    padding: 5rem 0;
}
.section-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}
.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.feature-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: inline-block;
}
.how-it-works-step {
    position: relative;
    padding-left: 3rem;
}
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--input-bg);
    border: 2px solid var(--accent-color);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-left: 5px solid var(--accent-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    height: 100%;
}
.testimonial-author {
    font-weight: 600;
    color: var(--text-color);
}
.cta-section {
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
}
.stats-counter {
    font-weight: 700;
}

/* --- Statistics Page Styles --- */
.stat-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(114, 137, 218, 0.15);
    color: var(--accent-color);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
    background: rgba(114, 137, 218, 0.25);
}

.guild-header-card {
    background: linear-gradient(135deg, #2c2f33, #23272a);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out forwards;
}

.guild-header-card img {
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.guild-header-card img:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(114, 137, 218, 0.5);
}

.chart-container, .category-chart-container, .hourly-chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    background: rgba(32, 34, 37, 0.5);
    border-radius: 10px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease-out forwards;
}

.filter-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--input-border);
    animation: fadeInUp 0.6s ease-out forwards;
}

.export-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.export-buttons .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.export-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.staff-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.staff-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-color);
}

.ticket-status-open {
    background-color: var(--warning-color);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    animation: pulse 2s infinite;
}

.ticket-status-closed {
    background-color: var(--success-color);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.progress {
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    height: 10px;
    overflow: visible;
}

.progress-bar {
    border-radius: 10px;
    position: relative;
    overflow: visible;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.table th {
    color: #fff;
    background-color: rgba(44, 47, 51, 0.7);
    border-top: none;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(114, 137, 218, 0.1);
    transform: translateX(5px);
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--input-border);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-controls .form-select,
.filter-controls .form-control {
    flex: 1;
    min-width: 150px;
    transition: all 0.3s ease;
}

.filter-controls .form-select:focus,
.filter-controls .form-control:focus {
    box-shadow: 0 0 10px rgba(114, 137, 218, 0.5);
    border-color: var(--accent-color);
}

.filter-controls .btn {
    align-self: flex-end;
    transition: all 0.3s ease;
}

.filter-controls .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ticket-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.pagination-info {
    color: var(--text-muted);
}

/* Enhanced chart styling */
.chart-container canvas,
.category-chart-container canvas,
.hourly-chart-container canvas {
    border-radius: 8px;
}

/* Add gradient backgrounds to stat cards */
.stat-card.bg-primary {
    background: linear-gradient(135deg, #6a5acd, #4a3faf) !important;
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #43b581, #369669) !important;
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #7289da, #5b6eae) !important;
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #faa61a, #d88a0a) !important;
}

/* Enhanced list group items */
.list-group-item {
    background-color: rgba(44, 47, 51, 0.5) !important;
    border-radius: 10px !important;
    margin-bottom: 0.5rem !important;
    border: 1px solid var(--input-border) !important;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(114, 137, 218, 0.1) !important;
    transform: translateX(5px);
}

/* Badge enhancements */
.badge.bg-primary {
    background: linear-gradient(135deg, #6a5acd, #4a3faf) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #43b581, #369669) !important;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.stat-card.animated {
    animation: float 0.6s ease-out forwards;
}

/* Responsive adjustments for statistics page */
@media (max-width: 768px) {
    .chart-container, .category-chart-container, .hourly-chart-container {
        height: 250px;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-controls .form-select,
    .filter-controls .form-control,
    .filter-controls .btn {
        min-width: 100%;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .guild-header-card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .guild-header-card .ms-auto {
        margin-left: 0 !important;
        margin-top: 1rem;
    }
    
    .stat-card {
        animation: none;
    }
    
    .stat-card.animated {
        animation: fadeIn 0.6s ease-out forwards;
    }
}

@media (max-width: 576px) {
    .chart-container, .category-chart-container, .hourly-chart-container {
        height: 200px;
    }
    
    .stat-card .card-body {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    .export-buttons {
        gap: 0.5rem;
    }
}

/* --- End Statistics Page Styles --- */

/* --- Footer --- */
.site-footer {
    background-color: rgba(26, 28, 32, 0.8);
    padding: 3rem 0;
    margin-top: auto; /* Pushes footer to bottom */
    border-top: 1px solid var(--input-border);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}
.site-footer h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}
.site-footer p {
    color: var(--text-muted);
}
.site-footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
    display: block;
    margin-bottom: 0.5rem;
}
.site-footer .footer-links a:hover {
    color: #fff;
}
.site-footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--input-bg);
    color: var(--text-muted);
    font-size: 1.2rem;
    text-decoration: none;
    margin-right: 0.5rem;
    transition: all 0.2s ease-in-out;
}
.site-footer .social-links a:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
}
.site-footer .footer-copyright {
    border-top: 1px solid var(--input-border);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* --- Manage Page --- */
.guild-header-card {
    background: linear-gradient(45deg, var(--secondary-color), #36393f);
    border-color: var(--input-border) !important;
}

.card-tab-content {
    border-top-left-radius: 0 !important;
}

.border-dashed {
    border: 2px dashed var(--input-border) !important;
}

.role-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    background: #23272a;
    border-radius: 8px;
    border: 1px solid #444;
    padding: 12px;
}
.role-card {
    position: relative;
    background: #2b2d31;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: border 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    min-height: 48px;
}
.role-card:hover, .role-card:focus-within {
    border: 2px solid #5865F2;
    box-shadow: 0 2px 8px #5865f233;
}
.role-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    accent-color: #5865F2;
    width: 18px;
    height: 18px;
}
.role-card-label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    margin-bottom: 0;
}
.role-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    border: 2px solid #fff2;
    box-shadow: 0 1px 4px #0002;
}
.role-name {
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px #0008;
}
.selected-role-chip {
    display: inline-flex;
    align-items: center;
    background: #5865F2;
    color: #fff;
    border-radius: 16px;
    padding: 2px 10px 2px 6px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-size: 0.95em;
}
.selected-role-chip .remove-chip {
    margin-left: 6px;
    cursor: pointer;
    font-size: 1.1em;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* --- Additions for manage.ejs redesign --- */

.nav-tabs {
    border-bottom: 1px solid var(--input-border);
}
.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    background-color: transparent;
    margin-right: 5px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
    color: #fff;
    background-color: var(--card-bg);
    border-bottom-color: var(--accent-color);
}
.tab-content .card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

.table thead {
    position: sticky;
    top: 0;
}
.table td, .table th {
    white-space: nowrap;
}
.table td .badge {
    font-weight: 600;
    font-size: 0.8rem;
}
.accordion-item {
    background-color: transparent !important;
    border: 1px solid var(--input-border) !important;
    border-radius: var(--border-radius) !important;
}
.accordion-header {
    background-color: var(--input-bg);
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease;
}
.accordion-item:has(.accordion-button:not(.collapsed)) .accordion-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: rgba(44, 47, 51, 0.9);
}
.accordion-button {
    background-color: transparent !important;
    color: var(--text-color) !important;
}
.accordion-button:not(.collapsed) {
    box-shadow: none;
    color: #fff !important;
}
.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}
.accordion-body {
    background-color: var(--card-bg);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

/* --- Server Grid on Dashboard Page (NEW DESIGN) --- */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.server-card {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--input-border);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}
.server-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(114, 137, 218, 0.4);
    border-color: var(--accent-color);
}
.server-card-banner {
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: #36393f; /* Fallback color */
    background-image: linear-gradient(45deg, var(--accent-color), var(--primary-color)); /* Fallback gradient */
}
.server-card-body {
    padding: 1.5rem;
    padding-top: 50px; /* Space for the overlapping icon */
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.server-card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    position: absolute;
    top: 60px; /* (Banner height) - (Icon height / 2) = 100 - 40 */
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
}
.server-card:hover .server-card-icon {
    transform: translateX(-50%) scale(1.1);
}
.server-card-title {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.server-card-text {
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* --- Premium Page Styles --- */
.premium-hero {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.premium-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    animation: shine 8s infinite linear;
}

@keyframes shine {
    0% { transform: rotate(30deg) translateX(-100%); }
    100% { transform: rotate(30deg) translateX(100%); }
}

.premium-badge {
    background: var(--premium-gradient);
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(255, 138, 0, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.plan-card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: none;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.plan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.plan-card.premium {
    border: 2px solid transparent;
    background: linear-gradient(135deg, #1a1a2e, #16213e) padding-box, 
                var(--premium-gradient) border-box;
}

.plan-header {
    padding: 1.5rem;
    text-align: center;
}

.plan-basic .plan-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
}

.plan-premium .plan-header {
    background: var(--premium-gradient);
    color: white;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.plan-features {
    padding: 1.5rem;
    min-height: 300px;
}

.feature-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.feature-check.available {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.feature-check.unavailable {
    background: linear-gradient(135deg, #8e8e8e, #5a5a5a);
}

.plan-footer {
    padding: 1.5rem;
    text-align: center;
}

.btn-plan {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
}

.btn-plan:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-basic {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
}

.btn-premium {
    background: var(--premium-gradient);
    color: white;
}

.comparison-table {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-header {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.comparison-feature {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-feature:last-child {
    border-bottom: none;
}

.feature-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.feature-icon.available {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.feature-icon.unavailable {
    background: linear-gradient(135deg, #8e8e8e, #5a5a5a);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .premium-hero {
        padding: 2rem 1rem;
    }
    
    .plan-card {
        margin-bottom: 2rem;
    }
    
    .plan-features {
        min-height: auto;
    }
}

/* --- Documentation Page --- */
.docs-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 6rem; /* Adjust based on navbar height */
    height: calc(100vh - 7rem);
    overflow-y: auto;
    padding-right: 1rem;
}
.docs-sidebar .nav-link {
    color: var(--text-muted);
    padding: .5rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}
.docs-sidebar .nav-link:hover {
    color: var(--text-color);
    background-color: var(--input-bg);
}
.docs-sidebar .nav-link.active {
    color: var(--accent-color);
    font-weight: 600;
    background-color: transparent;
    border-left-color: var(--accent-color);
}
.docs-mobile-nav-trigger {
    background-color: var(--input-bg);
    border-color: var(--input-border);
}
.docs-mobile-nav-trigger:hover {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
}


/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .hero-section-content {
        text-align: center;
    }
    .hero-section-content .d-md-flex {
        justify-content: center !important;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 1rem 1.5rem;
    }
    .navbar {
        padding: 1rem;
    }
    .section-spacer {
        padding: 3rem 0;
    }
    .display-4, .display-5 {
        font-size: 2.25rem;
    }
    .lead.fs-4 {
        font-size: 1.1rem !important;
    }
    .site-footer {
        text-align: center;
    }
    .site-footer .col-lg-5 {
        margin-bottom: 2rem;
    }
    .guild-header-card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    .guild-header-card .ms-auto {
        margin-left: 0 !important;
        margin-top: 1rem;
    }
    .accordion-body {
        padding: 1rem !important;
    }
}


/* --- RTL Overrides --- */
html[dir="rtl"] { direction: rtl; }
html[dir="rtl"] body { text-align: right; font-family: 'Tajawal', 'Inter', sans-serif; }
html[dir="rtl"] .navbar-brand { margin-right: 0; margin-left: 1.5rem !important; }
html[dir="rtl"] .navbar-nav { padding-right: 0; }
html[dir="rtl"] .navbar-collapse .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .me-1 { margin-left: .25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-2 { margin-left: .5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-1 { margin-right: .25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-2 { margin-right: .5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .rounded-circle.me-2 { margin-left: .5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .dropdown-menu { text-align: right; }
html[dir="rtl"] .dropdown-menu-end { --bs-position: start; }
html[dir="rtl"] .dropdown-toggle::after { margin-left: 0; margin-right: 0.255em; }
html[dir="rtl"] .bi-arrow-right-short::before { content: "\f128"; }
html[dir="rtl"] .bi-arrow-left::before { content: "\f12d"; }
html[dir="rtl"] .bi-box-arrow-right::before { content: "\f18d"; }
html[dir="rtl"] .flex-lg-row-reverse { flex-direction: row !important; }
html[dir="rtl"] .how-it-works-step { padding-left: 0; padding-right: 3rem; }
html[dir="rtl"] .step-number { left: auto; right: 0; }
html[dir="rtl"] .testimonial-card { border-left: none; border-right: 5px solid var(--accent-color); }
html[dir="rtl"] .social-links a { margin-right: 0; margin-left: 0.5rem; }
html[dir="rtl"] .form-check { padding-right: 1.5em; padding-left: 0; }
html[dir="rtl"] .form-check .form-check-input { float: right; margin-right: -1.5em; margin-left: 0; }
html[dir="rtl"] .input-group { direction: ltr; }
html[dir="rtl"] .input-group > :not(:first-child) { border-top-left-radius: var(--bs-border-radius); border-bottom-left-radius: var(--bs-border-radius); border-top-right-radius: 0; border-bottom-right-radius: 0; }
html[dir="rtl"] .input-group > :not(:last-child) { border-top-right-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); border-top-left-radius: 0; border-bottom-left-radius: 0; }
html[dir="rtl"] .input-group > .form-control, html[dir="rtl"] .input-group > .form-select { direction: rtl; }
html[dir="rtl"] .role-checkbox { left: 10px; right: auto; }
html[dir="rtl"] .table { text-align: right; }
html[dir="rtl"] .accordion-button::after { margin-left: auto; margin-right: 0; }
html[dir="rtl"] .modal-header .btn-close { margin-left: auto; margin-right: -.5rem; }
html[dir="rtl"] .modal-footer { justify-content: flex-start; }
html[dir="rtl"] .embed-content { padding-right: 12px; padding-left: 0; }
html[dir="rtl"] .embed-author-icon { margin-left: 8px; margin-right: 0; }
html[dir="rtl"] .embed-thumbnail { margin-right: 16px; margin-left: 0; }
html[dir="rtl"] .embed-footer-icon { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .embed-color-bar { border-radius: 0 4px 4px 0; }
html[dir="rtl"] .text-end { text-align: left !important; }
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .justify-content-md-start { justify-content: flex-end !important; }
html[dir="rtl"] .nav-tabs .nav-link { margin-left: 5px; margin-right: 0; }
html[dir="rtl"] .card-tab-content { border-top-right-radius: 0 !important; border-top-left-radius: var(--bs-border-radius) !important; }
html[dir="rtl"] .docs-sidebar .nav-link { border-left: none; border-right: 3px solid transparent; }
html[dir="rtl"] .docs-sidebar .nav-link.active { border-right-color: var(--accent-color); }
html[dir="rtl"] .embed-color-bar { border-radius: 0 4px 4px 0; }
html[dir="rtl"] .embed-content { padding-left: 0; padding-right: 1rem; }
html[dir="rtl"] .embed-author-icon { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .embed-thumbnail { margin-right: 0; margin-left: 16px; }
html[dir="rtl"] .embed-footer-icon { margin-right: 0; margin-left: 8px; }

@media (max-width: 991px) {
    html[dir="rtl"] .hero-section-content {
        text-align: center;
    }
    html[dir="rtl"] .hero-section-content .d-md-flex {
        justify-content: center !important;
    }
}