/* ========================================================
   DATOCHAI - CUSTOM RESULT CARD (CRC) UI - COMPACT
   ======================================================== */

/* 1. Master Wrapper */
.crc-ui-wrapper {
    max-width: 380px; 
    margin: 0 auto 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

/* 2. Pagination Nav (Separated from Card) */
.crc-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px; /* Fully rounded edges now */
    margin-bottom: 12px; /* SEPARATION SPACE ADDED HERE */
    font-size: 12px;
    font-weight: bold;
}
.crc-ajax-btn { background: none; border: none; color: #ffcc00; cursor: pointer; font-weight: bold; padding: 0; }
.crc-ajax-btn:hover { color: #fff; }
.crc-no-draw { color: #666; font-style: italic; }

/* 3. The Actual Card (The part that gets downloaded) */
.crc-mobile-card {
    background: #ffffff;
    border: 1px solid #ddd; /* Full border added back */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 8px; /* Fully rounded edges */
    overflow: hidden;
    position: relative; 
}

/* 4. Card Header (Tighter spacing, smaller logo & title) */
.crc-card-header {
    background: #cc0000;
    background: linear-gradient(135deg, #e60000 0%, #b30000 100%);
    color: #ffffff;
    text-align: center;
    padding: 12px 10px 8px; /* Drastically reduced vertical padding */
}
.crc-logo-container {
    width: 45px; /* Smaller Logo */
    height: 45px;
    margin: 0 auto 6px auto; /* Tighter margin */
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.crc-logo-img { max-width: 100%; max-height: 100%; border-radius: 50%; }
.crc-card-title {
    margin: 0;
    font-size: 16px; /* Smaller Title */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 5. Date & Draw Row (Tighter height) */
.crc-meta-row {
    background: #222;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 6px 15px; /* Thinner row */
    font-size: 12px;
    font-weight: 600;
}

/* 6. Top Prizes (Equal size, tight rows) */
.crc-prizes-list {
    padding: 10px 15px; /* Reduced gap */
    background: #fafafa;
}
.crc-prize-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0; /* Reduced row height */
    border-bottom: 1px dashed #ccc;
}
.crc-prize-row:last-child { border-bottom: none; }
.crc-prize-label {
    font-size: 13px; /* Slightly smaller label */
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
}
.crc-prize-value {
    font-size: 18px; /* All 3 prizes are now the exact same size */
    font-weight: 900;
    color: #cc0000;
    letter-spacing: 1px;
}

/* 7. Grid Sections (Special & Consolation - Tighter cells) */
.crc-grid-wrapper {
    padding: 0 10px 10px; /* Tighter outer spacing */
}
.crc-grid-title {
    background: #eee;
    color: #333;
    text-align: center;
    margin: 0 0 6px 0; /* Reduced margin */
    padding: 4px; /* Thinner title bar */
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    border-radius: 4px;
}
.crc-number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px; /* Tighter gap between cells */
}
.crc-grid-cell {
    background: #fff;
    border: 1px solid #ddd;
    text-align: center;
    padding: 4px 2px; /* Much thinner padding to shrink cell height */
    font-size: 13px; /* Smaller numbers */
    font-weight: 700;
    color: #111;
    border-radius: 4px;
}

/* 8. Footer / Disclaimer (Forced onto one line) */
.crc-card-footer {
    background: #f4f4f4;
    border-top: 1px solid #ddd;
    text-align: center;
    padding: 8px 10px; /* Thinner footer */
    font-size: 9px; /* Very small text */
    color: #888;
}
.crc-card-footer p { 
    display: inline; /* Forces paragraphs onto the same line */
    margin: 0; 
}
.crc-card-footer p:first-child::after {
    content: " | "; /* Automatically adds a divider between the two sentences */
    margin: 0 4px;
}

/* 9. The Download Button */
.crc-download-action {
    text-align: center;
    margin-top: 15px;
}
.crc-btn-primary {
    background: #cc0000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(204,0,0,0.3);
    transition: 0.2s ease;
    text-transform: uppercase;
}
.crc-btn-primary:hover { background: #aa0000; transform: translateY(-2px); }

/* ========================================================
   DATOCHAI - MASTER HUB GRID STYLING
   ======================================================== */

.crc-hub-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #eee;
}

.crc-hub-title {
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    color: #111;
    margin-bottom: 10px;
}

.crc-hub-desc {
    font-size: 16px;
    color: #555;
    margin: 0;
}

.crc-hub-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* 3 Cards Wide on Desktop */
    gap: 30px;
    align-items: start;
}

/* Ensure the wrapper fully fills its grid column but never exceeds mobile width */
.crc-hub-grid .crc-ui-wrapper {
    margin: 0 auto; 
    width: 100%;
}

@media (max-width: 1200px) {
    .crc-hub-grid { grid-template-columns: repeat(1, 1fr); /* 2 Cards on Tablet */ }
}

@media (max-width: 768px) {
    .crc-hub-grid { grid-template-columns: 1fr; /* 1 Card on Mobile */ }
}

/* ========================================================
   STRICT PAGINATION & DARK MODE FIX
   ======================================================== */

.crc-pagination-bar {
    background: #111 !important; /* Force dark gray background in both modes */
    color: #fff !important;      /* Force white text in both modes */
}

/* Force Next/Prev Buttons to be transparent with Gold text */
button.crc-ajax-btn, 
button.pred-ajax-btn {
    background: transparent !important;
    color: #ffcc00 !important; 
    border: none !important;
    box-shadow: none !important;
}

button.crc-ajax-btn:hover, 
button.pred-ajax-btn:hover {
    color: #ffffff !important;
}

/* Override any potential global Dark Mode button injections */
[data-theme="dark"] button.crc-ajax-btn,
[data-theme="dark"] button.pred-ajax-btn {
    background: transparent !important;
    color: #ffcc00 !important;
}

/* ========================================================
   HOME PAGE WIDE GRID (3 Columns)
   ======================================================== */
.crc-home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start;
    width: 100%;
}

@media (max-width: 1024px) {
    .crc-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .crc-home-grid {
        grid-template-columns: 1fr;
    }
}