@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #0a0a0a;
    min-height: 100vh;
    transition: all 0.3s ease;
}

body.light-mode {
    background: #f8f9fa;
    color: #212529;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode header {
    background: rgba(0, 0, 0, 0.05);
    color: #212529;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle label {
    color: #fff;
    font-size: 0.9em;
    font-weight: 500;
}

body.light-mode .theme-toggle label {
    color: #212529;
}

.theme-switch {
    display: none;
}

.switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.theme-switch:checked + .switch {
    background: rgba(255, 255, 255, 0.4);
}

.theme-switch:checked + .switch::before {
    transform: translateX(26px);
}

h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: -0.02em;
}

body.light-mode h1 {
    color: #212529;
}

h2 {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ccc;
}

body.light-mode h2 {
    color: #6c757d;
}

h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ccc;
}

body.light-mode h3 {
    color: #6c757d;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

body.light-mode .card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
}

body.light-mode .card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}

.number {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #ccc;
    color: #000;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.number:hover {
    transform: scale(1.1);
}

.alt-numbers .number {
    background: #ccc;
}

.probabilities-list {
    margin-top: 20px;
}

.prob-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.prob-num {
    font-weight: bold;
    color: #fff;
}

body.light-mode .prob-num {
    color: #212529;
}

.prob-value {
    color: #ccc;
    font-weight: bold;
}

body.light-mode .prob-value {
    color: #6c757d;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid #fff;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-mode .btn {
    border-color: #212529;
    color: #212529;
}

.btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

body.light-mode .btn:hover {
    background: #212529;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    border-color: #fff;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

body.light-mode .btn-primary {
    border-color: #007bff;
    color: #007bff;
}

body.light-mode .btn-primary:hover {
    background: #007bff;
    color: #fff;
}

.btn-secondary {
    border-color: #ccc;
    color: #ccc;
}

.btn-secondary:hover {
    background: #ccc;
    color: #000;
}

body.light-mode .btn-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

body.light-mode .btn-secondary:hover {
    background: #6c757d;
    color: #fff;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-danger {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-danger:hover {
    background: #ff6b6b;
    color: #fff;
}

body.light-mode .btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

body.light-mode .btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.disclaimer {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.2);
}

body.light-mode .disclaimer {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
}

.disclaimer h3 {
    color: #ff6b6b;
}

body.light-mode .disclaimer h3 {
    color: #dc3545;
}

.disclaimer p {
    color: #e0e0e0;
    margin-bottom: 10px;
}

body.light-mode .disclaimer p {
    color: #212529;
}

.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.2);
}

body.light-mode .error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #212529;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode table {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode th, body.light-mode td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    color: #fff;
}

body.light-mode th {
    background: rgba(0, 0, 0, 0.05);
    color: #212529;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.light-mode tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #fff;
}

body.light-mode .form-group label {
    color: #212529;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    transition: border-color 0.3s ease;
}

body.light-mode .form-group input {
    background: rgba(255, 255, 255, 0.9);
    color: #212529;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.form-group input:focus {
    outline: none;
    border-color: #fff;
}

body.light-mode .form-group input:focus {
    border-color: #007bff;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 20px;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.2);
}

nav {
    margin-top: 15px;
}

nav .btn {
    margin-right: 10px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scroll Buttons */
.scroll-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.scroll-buttons .btn {
    padding: 10px 15px;
    font-size: 0.9em;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 10px;
    padding: 15px;
    color: #28a745;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
    margin-bottom: 10px;
}

body.light-mode .flash-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #155724;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
}

/* Help Button */
.help-btn {
    position: absolute;
    top: 20px;
    right: 10px;
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #0a0a0a;
    backdrop-filter: blur(10px);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

body.light-mode .modal-content {
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

.help-content {
    margin-top: 20px;
}

.help-content h2 {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.help-content h3 {
    color: #ccc;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.help-content p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 15px;
}

.help-content ul,
.help-content ol {
    color: #b0b0b0;
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-content strong {
    color: #e0e0e0;
}

body.light-mode .help-content h2 {
    color: #212529;
}

body.light-mode .help-content h3 {
    color: #495057;
}

body.light-mode .help-content p {
    color: #6c757d;
}

body.light-mode .help-content ul,
body.light-mode .help-content ol {
    color: #6c757d;
}

body.light-mode .help-content strong {
    color: #212529;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .numbers {
        justify-content: center;
    }

    .number {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 1.1em;
    }

    .scroll-buttons {
        bottom: 10px;
        right: 10px;
    }

    .scroll-buttons .btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    .help-btn {
        top: 10px;
        left: 10px;
        right: auto;
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 20px;
        max-height: 85vh;
    }

    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}
