/* === Reset & Root Variables === */
:root {
    --primary: #FF8C00;        /* DarkOrange */
    --primary-light: #FFA500;
    --primary-dark: #E07B00;
    --secondary: #FFD700;      /* Gold */
    --bg-dark: #0f0f0f;
    --bg-card: rgba(20, 20, 20, 0.85);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 165, 0, 0.3);
    --text: #eee;
    --text-dim: #aaa;
    --radius: 16px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--secondary);
}
/* Image picker row (admin forms) */
.image-picker-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.image-picker-row .input-field {
    flex: 1;
    margin: 8px 0;
}

/* Rank Detail Page */
.rank-detail-page {
    margin-top: 2rem;
}
.rank-detail-card {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}
.rank-detail-image {
    flex: 1 1 250px;
    text-align: center;
}
.rank-detail-image img {
    max-width: 100%;
    border-radius: 16px;
    border: 2px solid var(--glass-border);
}
.rank-detail-info {
    flex: 1 1 300px;
}
.rank-detail-info h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.price-big {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
    margin: 0.8rem 0;
}
.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* Permissions grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.perm-section h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}
.perm-section ul {
    list-style: none;
    padding-right: 0;
}
.perm-section li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.perm-section li:last-child {
    border-bottom: none;
}
.perm-section li::before {
    content: "✔️ ";
    color: var(--primary);
}
/* Ticket system */
.ticket-form, .ticket-list {
    margin: 2rem 0;
}
.ticket-item {
    margin-bottom: 1rem;
    padding: 1rem;
}
.ticket-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.ticket-status {
    font-weight: bold;
    text-transform: uppercase;
}
.status-open   { color: #4CAF50; }
.status-closed { color: #f44336; }
.status-deleted { color: #888; }
.ticket-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}
.reply-form {
    margin-top: 0.8rem;
}
.admin-response {
    background: rgba(76, 175, 80, 0.1);
    border-right: 4px solid #4CAF50;
    padding: 0.8rem;
    margin: 1rem 0;
    border-radius: 8px;
}
/* Support link in navbar */
.support-link {
    color: #4CAF50 !important;
    font-weight: bold;
}

/* Admin ticket badge */
.admin-ticket-badge {
    position: relative;
    color: #FFD700 !important;
    font-weight: bold;
}
.admin-ticket-badge .badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Ticket conversation */
.message-thread {
    margin: 1.5rem 0;
}
.message-bubble {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
}
.message-bubble.user {
    border-right: 3px solid var(--primary);
}
.message-bubble.admin {
    border-right: 3px solid #4CAF50;
}
.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.last-message {
    background: rgba(0,0,0,0.2);
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #ccc;
}
/* Admin message styling */
.message-bubble.admin {
    background: rgba(255, 215, 0, 0.1);  /* soft gold */
    border-right: 3px solid var(--secondary);
}
/* Cart code section */
.code-section {
    margin: 1rem 0;
    padding: 1rem;
}
.discount-info {
    color: var(--secondary);
    margin-top: 0.5rem;
}
.streamer-info {
    border-color: var(--primary-light);
}
.streamer-info code {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 1rem;
}
.rp-compare-card {
    margin-bottom: 2rem;
    text-align: center;
}
.rp-slider {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}
.rp-image-wrapper {
    position: relative;
    flex: 1 1 300px;
    max-width: 450px;
}
.rp-img {
    width: 100%;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
}
.rp-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}
.promo-images {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}
.promo-image-box {
    flex: 1 1 250px;
    max-width: 350px;
    text-align: center;
}
.promo-image-box img {
    width: 100%;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
}
.promo-image-box span {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.promo-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.no-image {
    color: #ff5555;
    margin: 1rem 0;
}
.shop-page .shop-section {
    margin-bottom: 3rem;
}
.card-img-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.shop-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.shop-card:hover .shop-card-img {
    transform: scale(1.05);
}
.admin-badge {
    color: var(--secondary);
    font-weight: bold;
    font-size: 0.95rem;
}
/* eNamad Trust Seal in footer */
.footer-enamad {
    margin-right: 1rem;    /* spacing from social icons in RTL */
    display: flex;
    align-items: center;
}

.footer-enamad img {
    display: block;
    max-width: 120px;      /* adjust as needed – keeps it compact */
    height: auto;
    border-radius: 8px;    /* optional: matches your card style */
    transition: transform 0.2s;
}

.footer-enamad img:hover {
    transform: scale(1.05);
}
/* Cooldown alert (optional, already uses flash) */
.ticket-description {
    background: rgba(255,255,255,0.05);
    border-right: 3px solid var(--primary);
    padding: 0.8rem;
    margin: 0.8rem 0;
    border-radius: 8px;
}
.ticket-description p {
    margin: 0.5rem 0 0;
    white-space: pre-wrap;
}
.no-response {
    color: #aaa;
    margin: 1rem 0;
}
.ticket-detail .glass-card {
    max-width: 700px;
    margin: 2rem auto;
}
.admin-tickets .ticket-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
/* === Navbar === */
.navbar {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
}

/* Right side – main links */
.nav-links-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.nav-brand {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-brand:hover {
    color: var(--secondary);
}
.nav-links-right a {
    font-weight: 500;
    color: var(--text);
}
.nav-links-right a:hover {
    color: var(--primary-light);
}
.admin-link {
    color: #ff5555 !important;
}

/* Left side – user area */
.nav-user-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.user-dropdown {
    position: relative;
}
.user-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
}
.user-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.user-btn-text .nav-balance {
    font-size: 0.75rem;
    color: var(--secondary);
}
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.user-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: rgba(20,20,20,0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    min-width: 180px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}
.user-menu a {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    transition: background 0.2s;
}
.user-menu a:hover {
    background: var(--glass);
    color: var(--primary-light);
}
.cart-badge-inline {
    background: var(--primary);
    color: #000;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.7rem;
    margin-right: auto;
}
.hamburger {
    display: none;
    font-size: 1.6rem;
    cursor: pointer;
}

/* === Flash messages === */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}
.flash-message {
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
    background: rgba(30, 30, 30, 0.95);
    border-left: 4px solid var(--primary);
}
.flash-success { border-color: #4CAF50; }
.flash-error   { border-color: #f44336; }
.flash-info    { border-color: #2196F3; }
.flash-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 15px;
}
@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Footer === */
.site-footer {
    background: rgba(0,0,0,0.6);
    border-top: 1px solid var(--glass-border);
    padding: 1.2rem;
    text-align: center;
    margin-top: 3rem;
}
.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: 1.5rem;
    margin: 0 5px;
    color: var(--text-dim);
}
.footer-links a:hover {
    color: var(--primary-light);
}

/* === Glass Cards === */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.15);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    transform: scale(1.03);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #000;
}
.btn-danger {
    background: #e63946;
    color: white;
}
.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

/* === Containers & Typography === */
.container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.page-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}
h1, h2, h3 { margin-bottom: 0.8rem; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text);
    border-radius: 50px;
    cursor: pointer;
}
.filter-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Shop grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.shop-card {
    text-align: center;
}
.shop-card-img, .placeholder-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.price {
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.2rem;
}
.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Rank detail */
.rank-header {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.rank-big-img {
    width: 250px;
    border-radius: var(--radius);
}
.permissions {
    margin-top: 2rem;
}
.permissions ul {
    list-style: none;
    padding-right: 1rem;
}
.permissions li::before {
    content: "✔️ ";
}

/* Comparison */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.compare-images {
    display: flex;
    gap: 1rem;
}
.compare-images img {
    width: 100%;
    border-radius: 8px;
}

/* Auth */
.auth-container {
    display: flex;
    justify-content: center;
    margin-top: 5vh;
}
.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}
.input-field {
    width: 100%;
    padding: 10px 14px;
    margin: 8px 0 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: white;
    font-family: inherit;
}
.input-field:focus {
    outline: none;
    border-color: var(--primary);
}
.w-100 { width: 100%; }
.auth-link {
    margin-top: 1rem;
    text-align: center;
}

/* Minecraft input row (signup) */
.mc-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.mc-input-row .input-field {
    flex: 1;
    margin: 8px 0 16px;
}
.mc-input-row .btn {
    white-space: nowrap;
    margin-top: -8px;
}

/* ========== Panel Compact ========== */
.panel-compact {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}
.panel-card {
    max-width: 550px;
    width: 100%;
    text-align: center;
    padding: 2rem;
}
.panel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    margin-bottom: 1rem;
}
.panel-balance {
    font-size: 1.2rem;
    margin: 0.8rem 0;
}
.balance-value {
    color: var(--secondary);
    font-weight: bold;
}

/* Server info block – centered, card-like */
.player-server-info {
    display: inline-block;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin: 1.5rem auto;
    width: 100%;
    box-sizing: border-box;
}
.player-server-info p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #ddd;
}
.player-server-info i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}
.rank-name {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 1.1rem;
}
.rank-expiry-text {
    font-size: 0.9rem;
    color: #bbb;
    margin: 0.2rem 0 0.5rem;
}
.starcoins {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.1rem;
}
.server-offline {
    color: #ff5555;
    margin-top: 1rem;
}

/* Rank progress bar */
.rank-progress-container {
    width: 100%;
    height: 28px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 20px;
    margin: 0.5rem 0;
    overflow: hidden;
    direction: ltr;                     /* fill from left to right */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
}
.rank-progress-bar {
    height: 100%;
    border-radius: 20px;
    width: 0%;
    transition: width 0.5s ease, background-color 0.5s ease;
    background-color: #4CAF50;
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.rank-progress-bar.green  { background-color: #4CAF50; }
.rank-progress-bar.yellow { background-color: #FFC107; }
.rank-progress-bar.red    { background-color: #f44336; }

/* Toggle history button */
.toggle-history {
    margin: 1.5rem 0 1rem;
}
.purchase-history {
    margin-top: 1.5rem;
    text-align: right;
}

/* Purchase list */
.purchase-item {
    margin-bottom: 1rem;
}
.purchase-header {
    display: flex;
    justify-content: space-between;
}
.status-pending { color: #f0ad4e; }
.status-processing { color: #5bc0de; }
.status-delivered { color: #5cb85c; }

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* Admin dashboard */
.admin-dashboard .admin-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.admin-item p { font-size: 0.9rem; color: var(--text-dim); }

/* Admin media */
.upload-section { margin-bottom: 2rem; }
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.media-item {
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
}
.media-item img, .media-item video {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}
.media-info {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    width: 80%;
    max-height: 80vh;
    overflow-y: auto;
}
.close {
    float: left;
    font-size: 2rem;
    cursor: pointer;
}

/* Promo page centering */
.promo-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.promo-card {
    text-align: center;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}
.promo-img {
    width: 100%;
    max-width: 300px;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* Error pages */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links-right, .nav-user-left {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(0,0,0,0.95);
        padding: 1rem;
        gap: 0.5rem;
    }
    .nav-links-right.active, .nav-user-left.active {
        display: flex;
    }
    .hamburger {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    .rank-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .rank-big-img {
        width: 100%;
        max-width: 250px;
    }
}
