:root {
    --primary-green: #4CAF50;
    --primary-red: #FF0000;
    --primary-blue: #0000FF;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
}

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

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
}

/* Header */
.app-header {
    text-align: center;
    padding: 10px 0;
    background-color: #fff;
}

.app-header h1 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

/* Banner */
.banner {
    width: 100%;
    background-color: #2E7D32; /* Fallback color */
    color: #fff;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.banner-placeholder {
    padding: 30px 10px;
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
}

.banner-placeholder h2 {
    font-size: 24px;
    color: yellow;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
}

.carousel-item img {
    width: 100%;
    display: block;
    height: auto;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background-color: #fff;
}


/* Marquee */
.marquee-container {
    background-color: #fff;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Tabs */
.tabs {
    display: flex;
    background-color: #eee;
    margin-top: 10px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.tab.active {
    background-color: var(--primary-green);
    color: #fff;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

/* Result Card */
.result-card {
    background-color: #fff;
    padding: 10px 2px;
    border-bottom: 1px solid #eee;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.history-link {
    color: var(--primary-green);
    text-decoration: underline;
}

.lottery-balls-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
    margin-bottom: 15px;
}

.ball-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
}

.ball {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 22px;
    background-color: transparent;
    margin-bottom: 5px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.ball.green { background-image: url('../images/s1-green.png'); color: #000; }
.ball.blue { background-image: url('../images/s1-blue.png'); color: #000; }
.ball.red { background-image: url('../images/s1-red.png'); color: #000; }

.zodiac {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.plus-sign {
    font-size: 24px;
    color: #999;
    margin: 0 2px;
    line-height: 45px;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.green-text {
    color: var(--primary-green);
}

/* Section Title */
.section-title {
    color: var(--primary-red);
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
    background-color: #fff;
    margin-top: 10px;
}

/* Data Grid */
.data-grid {
    display: flex;
    padding: 0 5px;
    gap: 10px;
}

.data-item {
    flex: 1;
    text-align: center;
}

.data-img-box {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    background-color: #ccc;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 10px;
    font-size: 12px;
}

.gray-bg {
    background: linear-gradient(to bottom, #999, #666);
    color: #fff;
    text-shadow: 1px 1px 1px #000;
}

.white-bg {
    background-color: #fff;
    color: #000;
    position: relative;
}

.border-box {
    border: 1px solid #ccc;
}

.dog-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dog-drawing {
    font-size: 50px;
}

.data-caption {
    font-size: 12px;
    color: #666;
    padding-bottom: 20px;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .container {
        max-width: 600px; /* Limit width on desktop to look like mobile */
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
}

/* Sticky Results Container */
#results-container {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Data List Grid */
#data-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 10px;
    padding: 10px;
}

/* Loading Trigger */
#loading-trigger {
    text-align: center;
    padding: 20px;
    color: #666;
    grid-column: 1 / -1; /* Span full width */
}

/* Image Modal */
.image-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    padding-top: 50px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content, #caption {  
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}

/* History Page Styles */
.history-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--primary-green);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.history-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* Removed specific .history-balls .ball style to inherit from main .ball */

.history-balls .plus {
    font-size: 20px;
    color: #999;
    margin: 0 2px;
}

.ball-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
}

.ball-descr {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-top: 2px;
    text-align: center;
    white-space: nowrap;
}

/* Quick Menu */
.quick-menu {
    display: flex;
    flex-wrap: wrap;
    padding: 15px 10px;
    background-color: #fff;
    justify-content: space-between;
}

.menu-item {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
}

.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.menu-item span {
    font-size: 12px;
    color: #666;
}

.red-bg { background-color: #e57373; }
.blue-bg { background-color: #64b5f6; }
.blue-light-bg { background-color: #4fc3f7; }
.orange-bg { background-color: #ffb74d; }
.green-bg { background-color: #4db6ac; }
.green-light-bg { background-color: #81c784; }
.blue-sky-bg { background-color: #4dd0e1; }
.cyan-bg { background-color: #00bcd4; }

/* Forum Grid */
.forum-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 10px 10px;
    background-color: #fff;
}

.forum-btn {
    background-color: #f5f5f5;
    border: 1px solid #eee;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

/* Disclaimer */
.site-declaration {
    text-align: center;
    padding: 10px;
    background-color: #fff;
}

.site-declaration p {
    color: red;
    font-size: 14px;
    margin: 2px 0;
    font-weight: bold;
}

/* Category Tags */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.tag-btn {
    padding: 5px 10px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}

.tag-btn.green {
    background-color: #00c853;
}

.tag-btn.orange {
    background-color: #ff9800;
}

.tag-btn.active {
    background-color: #007a33;
    font-weight: bold;
    border: 2px solid #ffeb3b; /* Yellow border to make it pop */
}
