/* Base styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #2ecc71;
    --background-color: rgba(236, 240, 241, 0.95);
    --border-radius: 8px;
    --spacing-small: 5px;
    --spacing-medium: 10px;
    --spacing-large: 20px;
}

body {
    background: linear-gradient(135deg, #1a2a3a 0%, var(--primary-color) 100%);
    min-height: 100vh;
    margin: 0;
    padding: var(--spacing-large);
}

.container {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    max-width: 1800px;
    margin: 0 auto;
}

h1 {
    color: var(--primary-color);
    margin: 0 0 30px 0;
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 300px minmax(600px, 1fr);
    grid-template-areas: 
        "form payouts"
        "results results";
    gap: 30px;
    align-items: start;
}

/* Form Styles */
.simulator-form {
    grid-area: form;
}

#simulatorForm {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
}

.form-group {
    margin: 0;
    position: relative;
}

.form-group label {
    color: var(--primary-color);
    display: block;
    margin-bottom: var(--spacing-small);
}

select, input[type="number"] {
    width: 100%;
    padding: var(--spacing-small);
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--secondary-color);
    box-sizing: border-box;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent-color);
}

input[type="number"] {
    max-width: calc(100% - 2px);
}

button {
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: var(--accent-color);
}

button[type="submit"] {
    align-self: flex-start;
    margin-top: var(--spacing-small);
}

/* Payouts Section */
.payouts {
    grid-area: payouts;
    max-width: 300px;
}

.payouts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-medium);
}

.payouts-header h3 {
    margin: 0;
    color: var(--success-color);
}

.active-payout {
    margin: var(--spacing-medium) 0;
    padding: 8px 12px;
    background-color: var(--secondary-color);
    border-radius: 4px;
    color: white;
}

.active-payout span {
    color: var(--success-color);
    font-weight: bold;
}

#currentPayoutsTable {
    width: 150%;
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: fixed;
}

/* Add specific widths for columns */
#currentPayoutsTable th:first-child,
#currentPayoutsTable td:first-child {
    width: 150px;  /* Make first column (Hand) wider */
}

#currentPayoutsTable th:not(:first-child),
#currentPayoutsTable td:not(:first-child) {
    width: 50px;  /* Keep other columns the same width */
}

#currentPayoutsTable th,
#currentPayoutsTable td {
    padding: 3px 6px;
    text-align: center;
    border: 1px solid var(--secondary-color);
}

#currentPayoutsTable th {
    background-color: var(--secondary-color);
    color: white;
}

#currentPayoutsTable tr:nth-child(even) {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Results Section */
.simulation-results {
    grid-area: results;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

#statistics {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
}

#statistics table {
    width: 100%;
    max-width: 400px;
    border-collapse: collapse;
}

#statistics th, 
#statistics td {
    padding: 8px;
    border: 1px solid #bdc3c7;
    color: var(--primary-color);
}

#statistics th {
    background-color: var(--secondary-color);
    color: white;
}

#histogram {
    width: 100%;
    margin-top: var(--spacing-medium);
    min-height: 500px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--primary-color);
    margin: 5% auto;
    padding: var(--spacing-large);
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    color: white;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: white;
}

/* Preset Controls */
.preset-controls {
    display: flex;
    gap: var(--spacing-small);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-medium);
}

.preset-controls button.active {
    background-color: var(--accent-color);
}

/* Highlight Column */
.highlight-column {
    background-color: rgba(241, 196, 15, 0.2) !important;
    font-weight: bold;
}

#currentPayoutsTable tr:nth-child(even) td.highlight-column {
    background-color: rgba(241, 196, 15, 0.25) !important;
}

/* Edit payout table */
#paytable {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: white;
}

#paytable th, #paytable td {
    padding: 4px 6px;
    border: 1px solid #34495e;
    text-align: center;
}

#paytable input {
    width: 50px;
    padding: 2px 4px;
    text-align: center;
    background-color: #34495e;
    color: white;
    border: 1px solid #465c70;
    border-radius: 4px;
}

.modal-footer-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

#currentPayoutsTable td:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add responsive table styles */
@media screen and (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "form"
            "payouts"
            "results";
    }

    /* Make tables scrollable horizontally */
    .table-wrapper {
        overflow-x: auto;
        margin: 0 -15px;  /* Negative margin to allow full-width scroll */
        padding: 0 15px;
    }

    /* Adjust container padding */
    .container {
        padding: 15px;
    }

    /* Adjust form layout */
    .simulator-form {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 15px;
        width: 100%;
    }

    .form-group label {
        width: 100%;
    }

    .form-group select,
    .form-group input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure container doesn't overflow */
    .container {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Make the histogram responsive */
    #histogram {
        width: 100%;
        min-height: 300px;  /* Reduced height for mobile */
    }

    #calculationStatus {
        display: block;
        margin-top: 5px;
        margin-left: 0;
    }

    /* Add these styles for mobile table display */
    #currentPayoutsTable th:not(:first-child):not(.highlight-column),
    #currentPayoutsTable td:not(:first-child):not(.highlight-column) {
        display: none;
    }

    #currentPayoutsTable {
        width: 100%;  /* Adjust table width for mobile */
    }

    #currentPayoutsTable th:first-child,
    #currentPayoutsTable td:first-child {
        width: 70%;  /* Give more space to hand names */
    }

    #currentPayoutsTable th.highlight-column,
    #currentPayoutsTable td.highlight-column {
        width: 30%;  /* Give rest of space to the active column */
    }
}

/* Additional adjustments for very small screens */
@media screen and (max-width: 480px) {
    .simulator-form {
        padding: 0 10px;
    }

    .container {
        padding: 10px;
    }

    .form-group {
        grid-template-columns: 1fr;  /* Stack form labels and inputs */
    }

    table {
        font-size: 0.9em;  /* Slightly smaller font for tables */
    }
}

/* Add these styles */
#calculationStatus {
    color: var(--accent-color);
    font-style: italic;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Add tooltip styles */
.tooltip {
    display: none;
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9em;
    width: 200px;
    left: 100%;
    top: 0;
    margin-left: 10px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-group:hover .tooltip {
    display: block;
}

.tooltip::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid #2c3e50;
}

/* Add mobile styles for tooltips */
@media screen and (max-width: 768px) {
    .tooltip {
        left: auto;          /* Remove left positioning */
        right: 0;           /* Align to right side of form group */
        top: 100%;         /* Position below the input */
        margin-left: 0;    /* Remove left margin */
        margin-top: 5px;   /* Add small top margin */
        width: 100%;       /* Full width on mobile */
        max-width: 300px;  /* But not too wide */
    }

    .tooltip::before {
        left: 20px;        /* Arrow position from left */
        top: -10px;       /* Arrow at top */
        transform: rotate(-90deg);  /* Rotate arrow to point up */
    }
} 