/* Bento Grid CSS - Full Implementation */
:root {
    --bg-color: #0a0a0a;
    --card-bg: #111;
    --text-color: #fff;
    --accent-color: #b97add;
    --border-color: #222;
    --card-radius: 20px;
    --gap: 20px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Layout Wrappers */
.main-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--gap);
}

/* Card Base */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: #333;
}

/* Specific Cards & Spans */

/* 1. Brand Card */
.card-brand {
    grid-column: span 1;
    grid-row: span 2;
    background: linear-gradient(135deg, #2d1b69, #1a0a3e, #0d0d0d);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-brand .brand-icon img {
    animation: brandFloat 4s ease-in-out infinite;
}

@keyframes brandFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

.brand-icon img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.copy-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ccc;
    transition: 0.2s;
}

.copy-pill:hover {
    background: rgba(185, 122, 221, 0.2);
    border-color: var(--accent-color);
    color: white;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* 2. Store Card */
.card-store {
    grid-column: span 2;
    grid-row: span 1;
    background: url('../images/store_bg.png') center/cover no-repeat;
    position: relative;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    /* Safari fix for radius */
}

/* Overlay for store to make text readable */
.card-store::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    transition: 0.3s;
}

.card-store:hover::before {
    background: rgba(0, 0, 0, 0.4);
}

.store-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.store-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: white;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.store-tooltip {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.3s;
}

.card-store:hover .store-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* 3. Stats Card */
.card-stats {
    grid-column: span 1;
    grid-row: span 1;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    position: relative;
    overflow: hidden;
}

.card-stats::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(185, 122, 221, 0.08) 0%, transparent 70%);
    animation: statsGlow 6s ease-in-out infinite;
}

@keyframes statsGlow {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(10%, 10%);
    }
}

/* 3b. Join Card */
.card-join {
    background: linear-gradient(160deg, #111 0%, #0d1f0d 100%);
    border: 1px solid rgba(46, 204, 113, 0.15);
}

.stats-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 4. Discord Card */
.card-discord {
    grid-column: span 1;
    background: #5865F2;
    color: white;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-color: #5865F2;
}

.card-discord:hover {
    background: #4752c4;
    border-color: #4752c4;
}

/* 5. Profile Card */
.card-profile {
    grid-column: span 1;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #1a1a1a;
}

/* 6. News Card */
.card-news {
    grid-column: span 3;
    grid-row: span 1;
    /* Adjust height as needed */
    display: flex;
    flex-direction: column;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.news-item {
    background: #161616;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    text-decoration: none;
    transition: 0.3s;
}

.news-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

/* Scrollbars */
.no-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.no-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.no-scrollbar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.no-scrollbar:hover::-webkit-scrollbar-thumb {
    background: #555;
}

/* Responsive */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-brand {
        grid-column: span 2;
        grid-row: auto;
    }

    .card-news {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .grid-container {
        display: flex;
        flex-direction: column;
    }
}

/* ═══ Stats Card Background ═══ */
.card-stats {
    background:
        url('/assets/img/stats_card_bg.png') center/cover no-repeat,
        radial-gradient(ellipse at 30% 20%, rgba(52, 73, 160, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(26, 14, 46, 0.8) 0%, transparent 50%),
        linear-gradient(135deg, #0d1b2a, #1a0e2e) !important;
    border-color: rgba(52, 73, 160, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.card-stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(52, 152, 219, 0.04) 40px),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(52, 152, 219, 0.04) 40px);
    pointer-events: none;
    z-index: 0;
}

.card-stats::after {
    content: '📊';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 3rem;
    opacity: 0.08;
    pointer-events: none;
}

.card-stats .stats-content,
.card-stats .stats-overlay {
    position: relative;
    z-index: 1;
}

.card-stats:hover {
    border-color: rgba(52, 152, 219, 0.4) !important;
    box-shadow: 0 15px 50px rgba(52, 73, 160, 0.2) !important;
}

/* ═══ Join Card Background ═══ */
.card-join {
    background:
        url('/assets/img/join_card_bg.png') center/cover no-repeat,
        radial-gradient(ellipse at 20% 30%, rgba(46, 204, 113, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(39, 174, 96, 0.08) 0%, transparent 50%),
        linear-gradient(160deg, #0a1a0e, #0d1f14, #0a1612) !important;
    border-color: rgba(46, 204, 113, 0.15) !important;
    position: relative;
    overflow: hidden;
}

.card-join::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.08), transparent);
    border-radius: 50%;
    pointer-events: none;
    animation: joinGlow 6s ease-in-out infinite alternate;
}

@keyframes joinGlow {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-30px, 30px) scale(1.3);
        opacity: 1;
    }
}

.card-join::after {
    content: '⛏️';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 2.5rem;
    opacity: 0.06;
    pointer-events: none;
}

.card-join:hover {
    border-color: rgba(46, 204, 113, 0.35) !important;
    box-shadow: 0 15px 50px rgba(46, 204, 113, 0.12) !important;
}