/* =================================================================== */
/*             APP-STYLE THEME & LAYOUT STYLESHEET (v2)                */
/* =================================================================== */

/* --- Basic Reset & Body Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #FFFFFF; /* White background for the content area */
    color: #333;
    line-height: 1.5;
    font-size: 16px;
    overflow-x: hidden;
}

/* =================================================================== */
/*                      CORE APP LAYOUT (NEW DESIGN)                   */
/* =================================================================== */

/* --- App Header (Top Blue Bar) --- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2979FF; /* The blue from the image */
    color: #fff;
    padding: 15px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 90px;
}
.header-user-info {
    display: flex;
    flex-direction: column;
}
.header-user-info .user-fullname {
    font-size: 1.2em;
    font-weight: bold;
}
.header-user-info .user-username,
.header-user-info .user-phone {
    font-size: 0.9em;
    opacity: 0.9;
}
.header-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-wallet .wallet-icon {
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23FFD700" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/><path fill="%23FFC107" d="M256 64a192 192 0 1 0 0 384 192 192 0 1 0 0-384zM184.4 232.3c-11.3-9.5-26.1-15.1-42-16.5c-2.3-.2-4.5-.4-6.8-.5c-9.4-.6-18.6 .5-27.6 3.4c-12.2 4-23.2 11-31.5 20.2c-5.8 6.4-10.4 14-13.4 22.3c-2 5.5-3.1 11.3-3.1 17.2c0 14.5 4.8 28.5 13.7 40.2c8.4 11 20.3 20.1 34.3 25.8c4.2 1.7 8.5 3.1 12.9 4.3c2.3 .6 4.6 1.2 6.9 1.8c9.4 2.4 19.1 3.5 28.8 3.5c15.1 0 29.8-2.9 43.2-8.5c20.3-8.6 37.1-22.3 47.5-40.1c4.9-8.4 8.2-17.9 9.6-27.9c1-7.2 1.1-14.6 .2-21.9c-1.7-13.4-6.9-26.1-14.8-36.9c-10.7-14.7-25.8-25.5-43.3-31.1c-4.9-1.6-9.9-2.9-15-4c-2.5-.5-5-1-7.6-1.5c-9.4-1.9-18.9-2.7-28.4-2.2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}
.header-wallet .wallet-balance {
    font-size: 1.4em;
    font-weight: bold;
}

/* --- Announcement Bar --- */
.announcement-bar {
    padding: 10px 15px;
    background-color: #2979FF;
    color: white;
    text-align: center;
    font-size: 0.95em;
    font-weight: 500;
    position: fixed;
    top: 90px; /* Positioned below the header */
    width: 100%;
    z-index: 99;
    min-height: 45px;
}

/* --- Main Content Area --- */
.app-content {
    padding: 150px 15px 85px 15px; /* Adjusted padding-top for new header + announcement bar */
    max-width: 1200px;
    margin: 0 auto;
}

/* --- App Footer (New Design) --- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background-color: #263238; /* Dark color from image */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 100;
}
.footer-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    color: #90A4AE; /* Greyish color for inactive icons */
    transition: all 0.2s;
}
.footer-link .footer-icon {
    font-size: 1.5em;
    margin-bottom: 4px;
    height: 24px;
}
.footer-link .footer-text {
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
}
.footer-link.active {
    color: #fff;
    background-color: #2979FF;
}


/* =================================================================== */
/*                      NEW HOME PAGE STYLES                           */
/* =================================================================== */
.home-page-container {
    padding: 0 !important;
}
/* Big Featured Box */
.featured-result-box {
    width: calc(100% - 20px);
    margin: 0 auto 20px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.featured-result-box .result-time {
    font-size: 1.4em;
    font-weight: 500;
    color: #333;
}
.featured-result-box .market-name {
    font-size: 2em;
    font-weight: 700;
    color: #2979FF;
    margin: 4px 0;
    line-height: 1.2;
}
.featured-result-box .winning-number {
    font-size: 6em;
    font-weight: 800;
    color: #2979FF;
    line-height: 1.1;
}

/* Helpline Text */
.helpline-text {
    text-align: center;
    color: #D32F2F; /* Red color */
    font-weight: bold;
    margin: 0 15px 20px 15px;
    font-size: 1.1em;
}

/* Horizontal Scroller for smaller boxes */
.results-scroller-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 15px;
}
.results-scroller-wrapper::-webkit-scrollbar {
    display: none;
}
.results-scroller {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

/* Small Result Boxes */
.small-result-box {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
    color: #000;
}
.small-result-box.color-1 { background-color: #E6B0AA; } /* Mauve */
.small-result-box.color-2 { background-color: #A3E4D7; } /* Light Blue/Green */
.small-result-box.color-3 { background-color: #D5DBDB; } /* Light Grey */
.small-result-box.color-4 { background-color: #D7BDE2; } /* Light Purple */

.small-result-box .winning-number {
    font-size: 2.2em;
    font-weight: bold;
    line-height: 1;
}
.small-result-box .market-name {
    font-size: 0.8em;
    font-weight: 600;
    margin: 4px 0;
    text-transform: uppercase;
}
.small-result-box .result-time {
    font-size: 0.8em;
}

/* Refresh Button */
.refresh-button-container {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
}
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 25px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}


/* =================================================================== */
/*                       OTHER REUSABLE COMPONENTS                     */
/* =================================================================== */
.page-title { font-size: 1.6em; font-weight: 700; color: #333; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 15px; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 0.95em; }
th { background-color: #f8f9fa; font-weight: 600; }
.status-won { background-color: #d4edda !important; }
.status-lost { background-color: #f8d7da !important; }
.type-credit { color: #28a745; font-weight: bold; }
.type-debit { color: #dc3545; font-weight: bold; }
.form-wrapper { max-width: 450px; margin: 20px auto; padding: 25px; background: #fff; border-radius: 8px; border: 1px solid #dce1e7; }
.form-wrapper h2 { text-align: center; margin-bottom: 25px; font-size: 1.5em; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 500; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; }
.btn { display: block; width: 100%; padding: 12px; background: #1a73e8; color: #fff; border: none; border-radius: 5px; font-size: 1.05em; font-weight: bold; cursor: pointer; transition: background-color 0.3s; }
.btn:hover { background-color: #155ab6; }
.alert { padding: 12px; margin-bottom: 20px; border-radius: 5px; font-size: 0.95em; }
.alert.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* --- PLAY PAGE (_play.php) --- */
.market-list .card h3 { font-size: 1.25em; margin-bottom: 8px; }
.market-list .market-time { color: #555; font-size: 0.95em; margin-bottom: 12px; }
.market-list .market-status { font-weight: bold; }
.status-open { color: #388e3c; }
.status-closed { color: #d32f2f; }
.play-now-btn { display: inline-block; background-color: #1a73e8; color: #fff; text-decoration: none; padding: 9px 22px; border-radius: 5px; font-weight: bold; transition: background-color 0.3s; margin-top: 10px; }
.play-now-btn.disabled { background-color: #ccc; cursor: not-allowed; }

/* --- ACCOUNT PAGE (_account.php) --- */
.balance-display { text-align: center; background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #d1e7fd; }
.balance-display h3 { color: #555; font-size: 1.1em; margin-bottom: 5px; font-weight: 500; }
.balance-display p { font-size: 2.5em; font-weight: 700; color: #1a73e8; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.wallet-actions .btn { font-size: 1em; padding: 12px; }
.status-badge { padding: 4px 8px; border-radius: 12px; color: white; font-size: 0.75em; font-weight: bold; text-transform: uppercase; display: inline-block; }
.status-completed { background-color: #28a745; }
.status-pending { background-color: #ffc107; color: #212529; }
.status-failed { background-color: #dc3545; }

/* --- MORE PAGE (_more.php) --- */
.more-links-list { list-style: none; padding: 0; background: #fff; border-radius: 8px; border: 1px solid #ddd; overflow: hidden; }
.more-links-list li a { display: flex; align-items: center; padding: 15px; text-decoration: none; color: #333; border-bottom: 1px solid #eee; font-weight: 500; transition: background-color 0.2s; }
.more-links-list li:last-child a { border-bottom: none; }
.more-links-list li a:hover { background-color: #f8f9fa; }
.more-links-list .link-icon { margin-right: 15px; font-size: 1.3em; color: #555; width: 20px; text-align: center; }
.more-links-list .logout-link a { color: #d32f2f; }

/* --- BETTING PAGE --- */
.betting-container { padding: 0 !important; }
.market-info-header { background-color: #fff; border-bottom: 2px solid #1a73e8; color: #0d47a1; padding: 12px; margin-bottom: 20px; border-radius: 8px; text-align: center; }
.market-info-header h2 { margin: 0; font-size: 1.5em; font-weight: 600; }
.betting-tabs { list-style: none; padding: 0; margin-bottom: 0; display: flex; background: #fff; border-radius: 8px 8px 0 0; border: 1px solid #ddd; border-bottom: none; }
.betting-tabs li { padding: 12px 20px; cursor: pointer; font-weight: 600; font-size: 1.05em; color: #555; position: relative; border-bottom: 3px solid transparent; flex-grow: 1; text-align: center; }
.betting-tabs li.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.tab-content { display: none; padding: 20px; background: #fff; border-radius: 0 0 8px 8px; border: 1px solid #ddd; border-top: none; }
.tab-content.active { display: block; }
.betting-form-section { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; margin-bottom: 20px; padding: 15px; background-color: #f8f9fa; border-radius: 8px; border: 1px solid #e9ecef; }
.betting-form-section .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.betting-form-section .btn { flex-shrink: 0; width: auto; padding: 10px 25px; }
.jantri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 10px; }
.jantri-item .number { font-weight: bold; margin-bottom: 4px; font-size: 1.05em; }
.jantri-item input { width: 100%; text-align: center; padding: 7px 4px; border: 1px solid #ccc; border-radius: 4px; }
.total-bet-container { margin-top: 20px; padding: 15px; background-color: #fff; border: 1px solid #dee2e6; border-radius: 8px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.total-bet-container span { font-size: 1.3em; font-weight: 700; color: #0d47a1; }
.total-bet-container .btn { width: auto; font-size: 1.05em; padding: 11px 28px; background-color: #28a745; }

/* Modal Styles */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); padding-top: 60px; }
.modal-content { background-color: #fefefe; margin: 5% auto; padding: 0; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 8px; animation: slideIn 0.3s; }
.modal-header { padding: 10px 20px; background-color: #1a73e8; color: white; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.2em; }
.close-button { color: #fff; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-form { padding: 20px; }
.modal-info { font-size: 0.85em; color: #666; margin-top: 15px; text-align: center; }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }