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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 32px;
    color: #ffd700;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
}

nav ul li a:hover, nav ul li a.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 600;
}

.search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    outline: none;
}

.search-box button {
    padding: 15px 30px;
    background: #ffd700;
    border: none;
    border-radius: 30px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.search-box button:hover {
    background: #ffed4a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Latest Result */
.latest-result {
    margin: 30px 0;
}

.latest-result h3, .result-list h3, .features h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.result-card .balls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-card .info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.result-card .info span {
    background: #f0f0f0;
    padding: 5px 15px;
    border-radius: 15px;
}

/* Features */
.features {
    margin: 40px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: block;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.feature-card i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 15px;
}

.feature-card h4 {
    font-size: 18px;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: #666;
}

/* Result List */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input, .filter-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s ease;
}

.filter-bar input:focus {
    border-color: #667eea;
}

.btn-sm {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.result-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.result-item .header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #667eea;
}

.result-item .number {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.result-item .number .ball {
    width: 45px;
    height: 45px;
    font-size: 20px;
}

.result-item .meta {
    display: flex;
    justify-content: space-around;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

footer a {
    color: #ffd700;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Admin */
.admin-login, .admin-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s ease;
}

.form-group input:focus {
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
}

.error-msg, .success-msg {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.error-msg {
    background: #fee;
    color: #c00;
}

.success-msg {
    background: #efe;
    color: #0a0;
}

.admin-header {
    background: #333;
    color: white;
    padding: 15px 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    background: #e53e3e;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #c53030;
}

.admin-main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.add-form {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.data-table h3 {
    margin-bottom: 20px;
    color: #333;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f7f7f7;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f9f9f9;
}

.number-cell {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.number-cell .ball {
    width: 35px;
    height: 35px;
    font-size: 16px;
}

.btn-delete {
    color: #e53e3e;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #fee;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

/* History Page */
.history-table {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.history-table table {
    width: 100%;
}

/* Trend Page */
.trend-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.trend-chart {
    margin: 20px 0;
}

.trend-bar {
    display: flex;
    align-items: center;
    margin: 5px 0;
    gap: 10px;
}

.trend-bar .label {
    width: 80px;
    font-weight: 600;
}

.trend-bar .bar {
    flex: 1;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.trend-bar .bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 15px;
    transition: width 1s ease;
}

.trend-bar .bar .count {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.hot-cold {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.hot-cold-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 15px;
}

.hot-cold-box h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.number-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.number-tag {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.number-tag.hot {
    background: #ff6b6b;
    color: white;
}

.number-tag.cold {
    background: #4ecdc4;
    color: white;
}

/* Compare Page */
.compare-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.compare-container input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
}

.compare-result {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 15px;
}

.compare-result .win {
    color: #38a169;
    font-weight: 600;
}

.compare-result .lose {
    color: #e53e3e;
}

/* Push Page */
.push-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.push-item {
    padding: 20px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.push-item:hover {
    transform: translateX(5px);
}

.push-item .time {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.push-item .content {
    font-size: 16px;
    font-weight: 500;
}

/* Statistics Page */
.statistics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #333;
}

/* Export Page */
.export-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.export-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.export-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.export-btn.csv {
    background: #48bb78;
    color: white;
}

.export-btn.pdf {
    background: #e53e3e;
    color: white;
}

.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 20px;
        border-radius: 0 0 20px 20px;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hero h2 {
        font-size: 22px;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        border-radius: 15px;
    }

    .search-box button {
        border-radius: 15px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hot-cold {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        flex-direction: column;
    }

    .statistics-container {
        grid-template-columns: 1fr;
    }
}