body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
}

/* Header Controls */
.header-controls {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

/* Mode Toggle Switch Styling */
.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.mode-label.active {
    color: #4CAF50;
    font-weight: bold;
}

.mode-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: #4CAF50;
}

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

.slider:hover {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.game-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    margin-bottom: 20px;
    position: relative;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    flex-grow: 1;
}

#film-guess {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#submit-guess {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

.autocomplete-active {
    background-color: #4CAF50 !important;
    color: #ffffff;
}

.guess-history {
    margin-top: 20px;
}

.guess-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.guess-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
}

.movie-poster {
    max-height: 80px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-right: 15px;
}

.movie-title-text {
    font-weight: bold;
    font-size: 18px;
}

.attributes {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    width: 100%;
}

.attributes-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-around;
}

.attribute {
    margin: 5px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-width: 110px;
    text-align: center;
    flex: 1;
}

/* Special handling for director attribute to prevent overflow */
.attribute.director-attribute {
    max-width: 180px; /* Limit maximum width */
}

.attribute-value {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.director-value {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.attribute-label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
}

.attribute-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.arrow-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.match {
    background-color: #4CAF50;
    color: white;
}

.partial {
    background-color: #FFC107;
    color: black;
}

.no-match {
    background-color: #f1f1f1;
    color: #666;
}

.game-message {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.success {
    background-color: #DFF2BF;
    color: #4F8A10;
}

.info {
    background-color: #BDE5F8;
    color: #00529B;
}

.error {
    background-color: #FFD2D2;
    color: #D8000C;
}

.loading {
    text-align: center;
    margin: 10px 0;
}

/* Help popup styles */
.help-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.help-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.help-popup-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.help-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background-color: #f8f8f8;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    font-weight: bold;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background-color: #e9e9e9;
}

.tab-button.active {
    background-color: #4CAF50;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.category-item {
    margin-bottom: 25px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 15px;
}

.category-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.category-explanation {
    margin-bottom: 10px;
}

.color-example {
    display: flex;
    margin-top: 10px;
}

.color-box {
    padding: 5px 12px;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 14px;
    max-width: 180px; /* Prevent boxes from getting too wide */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Additional styles for the example in the help section */
.example-guess-row {
    display: flex;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.example-title {
    font-weight: bold;
    flex-basis: 20%;
    padding-right: 15px;
}

/* Game over popup styles */
.game-over-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
    opacity: 0; /* Start hidden */
    transition: opacity 0.8s ease-in-out; /* Smooth transition */
}

.game-over-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
}

.game-over-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.correct-film {
    margin-bottom: 20px;
}

.correct-film-poster {
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin: 0 auto 15px auto;
    display: block;
}

.correct-film-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.film-details {
    display: block;
    margin-bottom: 20px;
}

.film-detail {
    margin: 5px 10px;
    padding: 5px;
}

.detail-label {
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.detail-value {
    font-size: 14px;
}

.game-over-buttons {
    margin-top: 20px;
}

.close-game-over {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.game-stats {
    margin-top: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.film-titles-hint {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

#sample-titles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

#debug-info {
    margin-top: 20px;
    padding: 10px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    display: none;
}

/* Share result button styles */
.share-button {
    padding: 10px 20px;
    background-color: #3b5998; /* Facebook blue */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
}

.share-button:hover {
    background-color: #344e86;
}

.share-message {
    margin-top: 15px;
    color: #4CAF50;
    font-weight: bold;
    transition: opacity 0.5s ease-in-out;
}

.hidden {
    opacity: 0;
}

.visible {
    opacity: 1;
}

/* Add styles for film attributes in the game over popup */
#film-details .attributes {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    width: 100%;
}

#film-details .attributes-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-around;
    margin-bottom: 10px;
}

#film-details .attribute {
    margin: 5px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-width: 110px;
    text-align: center;
    flex: 1;
}

/* Add styles for the guess counter */
.guess-counter {
    padding: 10px;
    margin-left: 10px;
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
    font-weight: bold;
}

/* Add styles for practice mode indicator */
.mode-indicator {
    background-color: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.play-again-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

.play-again-button:hover {
    background-color: #45a049;
}

/* Practice mode controls */
.practice-controls {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.give-up-button {
    padding: 8px 16px;
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.give-up-button:hover {
    background-color: #c9302c;
}
