:root {
    --card-width: 80px;
    --card-height: 120px;
    --background-color: #f0f2f5;
    --text-color: #333;
    --white: #fff;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --red-card: #d9534f;
    --black-card: #333;
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0; /* Remove padding from body to let nav fill width */
    display: flex;
    flex-direction: column; /* Stack nav and main content */
    align-items: center; /* Center content horizontally */
    min-height: 100vh;
}

.main-content-wrapper {
    display: flex;
    gap: 20px; /* Space between main game and history log */
    max-width: 1200px; /* Adjust as needed */
    width: 100%;
    padding: 20px; /* Add padding here instead of body */
    justify-content: center; /* Center the two main columns */
}

/* Navigation Bar Styles */
.main-nav {
    width: 100%;
    background-color: #333;
    padding: 15px 0;
    margin-bottom: 20px; /* Space below nav */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav a:hover {
    background-color: #555;
}


.container {
    background-color: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    max-width: 600px;
    width: 100%;
    flex-shrink: 0; /* Prevent the main container from shrinking */
}

/* Styles specific to the classifier page */
.classifier-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

.classifier-container h1 {
    margin-bottom: 10px;
}

.classifier-container p {
    margin-bottom: 20px;
}

#imageUpload {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 80%;
}

#uploadedImage {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#predictionResult {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.model-disclaimer {
    font-size: 0.8em;
    color: #888;
    margin-top: 30px;
}


/* Existing styles */
.history-log-container {
    background-color: var(--white);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 300px; /* Fixed width for history log */
    flex-shrink: 0;
    max-height: calc(100vh - 40px); /* Adjust height to fit viewport, considering padding */
    overflow-y: auto; /* Enable vertical scrolling */
    text-align: left;
}

.history-log-container h2 {
    color: #4a90e2;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e0e0e0;
}

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

.history-item-cards {
    display: flex;
    gap: 3px; /* Smaller gap for history cards */
    margin-top: 5px;
    flex-wrap: wrap;
}

.history-card {
    width: 30px; /* Even smaller cards for history */
    height: 45px;
    font-size: 0.6em;
    border-radius: 3px;
    border: 1px solid #eee;
    box-shadow: none;
}

.history-hand-info {
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: bold;
}

h1 {
    color: #4a90e2;
    margin-bottom: 20px;
}

.hand-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    background-color: var(--white);
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card.red {
    color: var(--red-card);
}

.hand-rank-display {
    margin: 20px 0;
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    min-height: 25px;
}

.score-container h2 {
    font-size: 1.5em;
    color: #555;
}

#score {
    color: #4a90e2;
    font-weight: bold;
}

.draw-button {
    background: linear-gradient(45deg, #5cb85c, #5bc0de);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.draw-button:hover, .draw-button:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    outline: none;
}

.draw-button:active {
    transform: translateY(-1px);
}

.hand-rankings-guide {
    margin-top: 40px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.hand-rankings-guide h2 {
    color: #4a90e2;
    margin-bottom: 15px;
    font-size: 1.8em;
}

#rankings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

#rankings-list li {
    padding: 5px 0;
    border-bottom: 1px dotted #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#rankings-list li:last-child {
    border-bottom: none;
}

.ranking-example-cards {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.small-card {
    width: 40px;
    height: 60px;
    font-size: 0.8em;
    border-radius: 4px;
    box-shadow: none;
    border: 1px solid #ddd;
}

.contact-form-section {
    margin-top: 40px;
    text-align: left;
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.contact-form-section h2 {
    color: #4a90e2;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-align: center;
}

.contact-form-section form {
    display: flex;
    flex-direction: column;
}

.contact-form-section label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.contact-form-section input[type="text"],
.contact-form-section input[type="email"],
.contact-form-section textarea {
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.contact-form-section textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form-section button[type="submit"] {
    background: linear-gradient(45deg, #ff6b6b, #ffa07a); /* A new gradient for the contact button */
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    align-self: center; /* Center the button */
    max-width: 200px;
}

.contact-form-section button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
