/* General Styles */
/* Light Mode (Default) */
:root {
    --primary-color: #4a4af4;
    --primary-rgb: 74, 74, 244;
    --secondary-color: #e4a525;
    --secondary-rgb: 228, 165, 37;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --header-bg: #ffffff;
    --success-color: #28a745;
    --success-rgb: 40, 167, 69;
    --warning-color: #ffc107;
    --warning-rgb: 255, 193, 7;
    --danger-color: #dc3545;
    --danger-rgb: 220, 53, 69;
    --info-color: #17a2b8;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --win-color: #28a745;
    --loss-color: #dc3545;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #6060ff;
    --primary-rgb: 96, 96, 255;
    --secondary-color: #ffc107;
    --secondary-rgb: 255, 193, 7;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #f0f0f0;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --header-bg: #1a1a1a;
    --success-color: #2eb85c;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --win-color: #2eb85c;
    --loss-color: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
}

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

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 10px;
}

/* Dark Mode Toggle Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.theme-switch-label {
    margin: 0 10px;
    font-size: 1.2rem;
    color: var(--text-color);
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.controls button {
    margin-left: 10px;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3434d6;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn-active {
    background-color: #28a745;
    color: white;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

/* Adjust settings card to span full width */
.settings-card {
    grid-column: 1 / -1; /* Make settings card span full width */
    margin-top: 0;
    width: 100%;
    max-width: 100%;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-color);
    padding: 15px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    transition: border-color 0.3s ease;
}

.card h3 {
    margin-bottom: 0;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

/* Stats Section */
.stats-section {
    display: flex;
    flex-direction: column;
}

.balance-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.balance-item {
    flex: 1;
    padding: 5px;
}

.balance-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

#sTokenBalance {
    color: var(--secondary-color);
}

.stat-subtitle {
    font-size: 0.9rem;
    color: #666;
}

.streak-stats, .performance-stats, .settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.streak-label, .performance-label, .settings-label {
    font-weight: 500;
    margin-right: 5px;
}

.stat-value {
    font-weight: bold;
}

/* Wallet Section */
.wallet-section {
    grid-column: 1 / -1; /* Make it span the full width */
    margin-bottom: 20px;
}

.wallet-card {
    width: 100%;
}

.wallet-content {
    padding: 10px 0;
}

.private-key-input {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.private-key-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.wallet-warning {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.wallet-warning i {
    color: var(--warning-color);
}

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

.wallet-address code {
    background: var(--background-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Game Activity */
.game-activity {
    display: flex;
    flex-direction: column;
}

.game-list {
    max-height: 300px;
    overflow-y: auto;
}

.game-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.game-item:hover {
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

.game-item:last-child {
    border-bottom: none;
}

/* Special styling for 69 pattern games */
.pattern-69 {
    background-color: rgba(255, 215, 0, 0.1);
    border-left: 3px solid gold;
    transition: background-color 0.3s ease;
}

.pattern-69:hover {
    background-color: rgba(255, 215, 0, 0.2);
    transition: background-color 0.3s ease;
}

.game-left {
    display: flex;
    align-items: center;
}

.game-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 10px;
    min-width: 60px;
}

.game-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 10px;
    transition: color 0.3s ease;
}

.dice-result {
    display: flex;
    gap: 5px;
}

.dice {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background-color: var(--border-color);
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 2px 3px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dice colors for different values */
.dice-1 {
    background-color: #dc3545;
}

.dice-2 {
    background-color: #fd7e14;
}

.dice-3 {
    background-color: #ffc107;
}

.dice-4 {
    background-color: #28a745;
}

.dice-5 {
    background-color: #17a2b8;
}

.dice-6 {
    background-color: #6610f2;
}

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

.game-amount {
    font-weight: 500;
    min-width: 80px;
}

/* Balance change styling */
.balance-change {
    font-weight: 600;
    min-width: 70px;
}

.balance-change.positive {
    color: var(--success-color);
}

.balance-change.negative {
    color: var(--danger-color);
}

/* Session profit styling */
.profit-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.profit-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.game-result {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.win {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.loss {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

/* Special 69 pattern styling */
.pattern-result {
    position: relative;
    overflow: hidden;
}

.pattern-result.win {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(255, 215, 0, 0.4) 100%);
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Log Styles */
.log-container {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.log-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
    gap: 5px;
}

.log-messages {
    flex: 1;
    overflow-y: auto;
    background-color: #111;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    /* Keep log area dark in both themes but adjust border color */
    transition: border-color 0.3s ease;
}

.log-entry {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-time {
    color: #888;
    margin-right: 8px;
}

.log-level {
    display: inline-block;
    width: 60px;
    font-weight: bold;
    margin-right: 8px;
}

.log-level.info {
    color: #5bc0de;
}

.log-level.warning {
    color: #f0ad4e;
}

.log-level.error {
    color: #d9534f;
}

.log-text {
    color: #ddd;
}

/* Footer */
footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

/* Special Pattern Styles */
.pattern-69 {
    background-color: gold !important;
    color: black !important;
    font-weight: bold;
}

/* Game Status Styles */
.game-status-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.status-indicator.offline {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.status-indicator.online {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.status-indicator.betting {
    background-color: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    animation: pulse 1.5s infinite;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.status-indicator.win {
    background-color: #c3e6cb;
    color: #155724;
    animation: pulse-win 1s infinite;
}

.status-indicator.loss {
    background-color: #f5c6cb;
    color: #721c24;
    animation: pulse-loss 1s infinite;
}

@keyframes pulse-win {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes pulse-loss {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.win-result {
    font-weight: bold;
    color: var(--win-color);
    background-color: rgba(40, 167, 69, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.loss-result {
    font-weight: bold;
    color: var(--loss-color);
    background-color: rgba(220, 53, 69, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.current-bet-container {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.bet-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.dice-animation {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.dice-animation i {
    font-size: 1.5rem;
    color: var(--primary-color);
    animation: spin 1.5s infinite ease-in-out;
}

.dice-animation i:nth-child(2) {
    animation-delay: 0.2s;
}

.dice-animation i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes spin {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

#bet-status {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.bet-details {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    transition: border-color 0.3s ease;
}

/* Bet result styles */
.win-result {
    color: var(--success-color);
    font-weight: bold;
}

.loss-result {
    color: var(--danger-color);
    font-weight: bold;
}

.pattern-result {
    color: #000; /* Keep dark text for readability on gold background */
    background-color: gold;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.bet-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.bet-value {
    font-weight: bold;
    font-size: 0.9rem;
}

.win-result {
    color: var(--success-color);
}

.loss-result {
    color: var(--danger-color);
}

/* Settings Form Styles */
.settings-card .card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    transition: border-color 0.3s ease;
}

/* This rule has been consolidated with the one in the main content layout section */

.settings-form {
    padding: 0;
    width: 100%;
    max-width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
}

.settings-card {
    grid-column: 1 / -1; /* Make settings card span full width */
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    box-sizing: border-box;
}

/* Full-width settings layout */
.settings-columns {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    padding: 20px;
}

.settings-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px;
    box-sizing: border-box;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    width: 100%;
    padding: 20px;
    margin: 0 auto;
}

.settings-column {
    display: flex;
    flex-direction: column;
    background-color: rgba(var(--primary-rgb), 0.05);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(var(--primary-rgb), 0.15);
}

.settings-section-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.settings-value-display {
    font-weight: bold;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

/* View mode horizontal layout */
.settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.settings-section {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding-top: 5px;
}

.settings-section .settings-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Slider styles */
.form-group input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: calc(100% - 80px);
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    margin: 24px 0;
    transition: background 0.3s ease;
    flex: 1;
    min-width: 300px;
    position: relative;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid white;
    margin-top: -5px; /* Essential for proper vertical centering */
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 1px solid white;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-group input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    border-radius: 4px;
}

.form-group input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    border-radius: 4px;
}

/* Slider value display */
.slider-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 50px;
    text-align: center;
    background-color: rgba(var(--primary-rgb), 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.slider-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 10px 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
}

[data-theme="dark"] .slider-container {
    background-color: rgba(40, 40, 40, 0.6);
}

.settings-help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
}

.slider-container label {
    margin-bottom: 5px;
    display: block;
    font-weight: 500;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 30px;
}

.input-icon {
    position: absolute;
    right: 12px;
    color: #777;
}

.settings-help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    transition: color 0.3s ease;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 20px 0 15px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.settings-section {
    margin-top: 15px;
    padding-top: 5px;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }
    
    .controls button {
        margin: 0;
    }
}

@media (max-width: 600px) {
    .streak-stats, .performance-stats, .settings {
        grid-template-columns: 1fr;
    }
}
