body {
    direction: ltr;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chess-editor {
    flex: 1;
    overflow: auto; /* This allows scrolling within the editor if needed */
}

.chess-board {
    display: grid;
    border: 2px solid #333;
    position: relative;
    overflow: visible;
    z-index: 901;
    width: 500px !important;  /* Changed from 600px */
    height: 500px !important; /* Changed from 600px */
    grid-column: 2;
}

.square {
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Remove fixed width/height as they're set dynamically */
}

.square.light {
    background-color: #f0d9b5;
}

.square.dark {
    background-color: #b58863;
}

.piece {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: auto;
}

.piece:active {
    cursor: grabbing;
}

.square.drag-over {
    background-color: rgba(0, 255, 0, 0.2);
}

.controls {
    padding: 20px;
    background: #f5f5f5;
    border-left: 1px solid #ddd;
}

.editor-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    height: 100vh;
}

.left-panel {
    flex: 0 0 200px;
    overflow-y: auto;
    padding: 15px;
    border-right: 1px solid #ddd;
}

.center-panel {
    flex: 0 0 auto;
    padding: 0 20px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.right-panel {
    flex: 0 0 360px;  /* Increased to fit the wider piece selector */
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 15px;
}

.gallery-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    padding-right: 15px;
}

#board-container {
    margin-bottom: 20px;
}

.piece-selectors-container {
    display: flex;
    flex-direction: column;
    gap: 12px;  /* Reduced gap between containers */
}

.piece-selector, .special-piece-selector {
    display: grid;
    grid-template-columns: repeat(6, 45px);
    grid-template-rows: repeat(2, 45px);
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: fit-content;  /* Let content determine width */
    margin: 0 auto;  /* Center the grid */
}

/* Add specific styling for special pieces container */
.special-piece-selector {
    grid-template-rows: none; /* Allow for unlimited rows */
    max-height: 300px; /* Set a maximum height */
    overflow-y: auto; /* Enable vertical scrolling */
    align-content: start; /* Ensure grid items start from the top */
}

.selector-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;  /* Reduced margin */
    padding-left: 5px;
}

.piece-selector-item {
    width: 45px;
    height: 45px;
    cursor: pointer;
    padding: 0;  /* Remove padding */
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    background-color: white;
    display: flex;  /* Center the image */
    align-items: center;
    justify-content: center;
}

.piece-selector-item img {
    width: 90%;  /* Slightly smaller than container */
    height: 90%;
    object-fit: contain;
}

.piece-selector-item:hover {
    background-color: #f0f0f0;
    border-color: #ddd;
    transform: scale(1.1);
}

.piece-selector-item.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.level-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px;
}

.level-name {
    font-weight: bold;
    color: #333;
}

.level-moves {
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

.level-info label {
    display: block;
    margin-bottom: 5px;
    margin-top: 10px;
    font-weight: bold;
}

/* Add this new rule to remove top margin from first label */
.level-info label:first-child {
    margin-top: 0;
}

/* Info icon tooltip styling */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4285f4;
    color: white;
    font-size: 12px;
    font-weight: bold;
    font-style: normal;
    cursor: help;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
    margin-bottom: 15px;
}

.info-icon:hover {
    background: #3367d6;
    transform: scale(1.1);
}

.level-info input[type="number"],
.level-info select,
.mode-select,
.board-size-select {
    width: 120px;
    box-sizing: border-box;
}

.level-info input[type="text"],
.fen-input,
.moves-input {
    width: 100%;
    box-sizing: border-box;
}

.level-info input[type="number"] {
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* Add this to create two rows with specific buttons in each */
.actions-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.actions-row button {
    flex: 1;
}

/* For the play mode buttons specifically */
.play-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.play-buttons button {
    flex: 1;
}

.actions button {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    white-space: nowrap;
}

#clear,
#start-position {
    background: #2196F3;  /* Same blue color for both buttons */
}

#clear:hover,
#start-position:hover {
    background: #1976D2;
}

.actions button:hover {
    background: #45a049;
}

.actions button.stop-solution {
    background: #f44336;  /* Red background for stop button */
}

.actions button.stop-solution:hover {
    background: #d32f2f;
}

.actions button.stop-solution.highlighted-control {
    background: #f44336 !important;  /* Keep the red background */
    color: white !important;
    border: 2px solid white !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.actions button.exit-play-mode {
    background: #f44336;  /* Same red as stop-solution */
}

.actions button.exit-play-mode:hover {
    background: #d32f2f;
}

.actions button.exit-play-mode.highlighted-control {
    background: #f44336 !important;
    color: white !important;
    border: 2px solid white !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.fen-container {
    margin-bottom: 15px;
}

.fen-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fen-input {
    flex: 1;
    padding: 8px;
    font-family: monospace;
    direction: ltr;
    text-align: left;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.copy-button {
    padding: 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.copy-button:hover {
    background: #e0e0e0;
}

.copy-button:active {
    background: #d0d0d0;
}

.copy-button svg {
    color: #666;
}

.square:hover {
    box-shadow: inset 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.board-size-select {
    width: 120px;
}

/* Update media query to maintain board size */
@media (max-width: 1200px) {
    .chess-board {
        width: 500px !important;
        height: 500px !important;
    }
}

/* הוספת סגנונות חדשים */
.mode-select {
    width: 120px;
}

.moves-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    font-family: monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.drop-zone.drag-over {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.drop-zone-text {
    color: #666;
}

.file-input-label {
    color: #2196F3;
    cursor: pointer;
}

.file-input-label:hover {
    text-decoration: underline;
}

.levels-gallery {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.level-thumbnail {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    user-select: none;  /* Prevent text selection while dragging */
}

.level-thumbnail:hover {
    transform: none;  /* Remove vertical movement */
    background: #f8f8f8;
    border-color: #4CAF50;
}

.level-thumbnail.selected {
    background: #e8f5e9;
    border-color: #4CAF50;
    border-width: 2px;
}

.level-thumbnail.dragging {
    opacity: 0.5;
    border: 2px dashed #4CAF50;
}

/* Add a visual indicator for drop target */
.level-thumbnail.drop-target {
    border-top: 2px solid #4CAF50;
}

.thumbnail-board {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: grid;
    gap: 1px;
    background: #333;
    border: 1px solid #333;
    padding: 1px;
}

.thumbnail-square {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f0d9b5;
}

.thumbnail-square:nth-child(odd) {
    background: #b58863;
}

.thumbnail-piece {
    width: 90%;
    height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.thumbnail-info {
    font-size: 13px;
    color: #333;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.levels-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drive-container {
    flex: 65;  /* Take up 65% of the available space */
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 0;  /* Allow container to shrink */
}

.drive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.drive-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.files-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;  /* Allow lists to shrink */
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.drive-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.drive-file:hover {
    background: #f5f5f5;
}

.drive-file:last-child {
    border-bottom: none;
}

.drive-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.drive-actions .button-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.top-row,
.bottom-row.three-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(30px, 1fr));  /* Changed from 120px to 30px */
    gap: 8px;
    width: 100%;
}

/* Update button styles to ensure consistent width */
.drive-button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 100%;
    min-width: 0;  /* Allow buttons to shrink */
}

/* Default (Add) button */
.drive-button {
    background: #4CAF50;  /* Green */
    color: white;
}

.drive-button:hover {
    background: #45a049;
}

/* Remove button */
.drive-button.remove-button {
    background: #dc3545;  /* Red */
    color: white;
}

.drive-button.remove-button:hover {
    background: #c82333;
}

/* Operation buttons (Copy, Move, Rename) */
.drive-button.copy-button,
.drive-button.move-button,
.drive-button.rename-button {
    background: #4285f4;  /* Google blue */
    color: white;
}

.drive-button.copy-button:hover,
.drive-button.move-button:hover,
.drive-button.rename-button:hover {
    background: #3367d6;  /* Darker Google blue */
}

.drive-file.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

optgroup {
    font-weight: bold;
    font-style: italic;
    padding-left: 5px;
}

option {
    font-weight: normal;
    font-style: normal;
    padding-left: 15px;
}

.drive-folder {
    margin-bottom: 5px;
}

.drive-folder-header {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    background: #f8f8f8;
    border-radius: 4px;
}

.drive-folder-header:hover {
    background: #f0f0f0;
}

.folder-arrow {
    margin-right: 8px;
    font-size: 12px;
    color: #666;
}

.folder-name {
    font-weight: bold;
    color: #333;
}

.folder-files {
    margin-left: 20px;
    border-left: 2px solid #eee;
    padding-left: 10px;
}

.drive-file {
    padding: 6px 8px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 4px;
}

.drive-file:hover {
    background: #f5f5f5;
}

.file-name {
    color: #666;
    font-size: 14px;
}

.drive-file.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.solution-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
}

/* Add a white glow effect around the board during playback */
.chess-board.playing {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.board-wrapper {
    position: relative;
}

.chess-board {
    display: grid;
    border: 2px solid #333;
    position: relative;
    overflow: visible;
    z-index: 901;
    width: 500px !important;
    height: 500px !important;
}

.coord {
    position: absolute;
    font-size: 12px;
    color: #666;
    pointer-events: none;
    font-weight: bold;
}

.coord.rank {
    left: 4px;
    top: 4px;
}

.coord.file {
    right: 4px;
    bottom: 4px;
}

/* Invert coordinate colors on dark squares */
.square.dark .coord {
    color: #ccc;
}

.highlighted-control {
    position: relative;
    z-index: 901;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    background: white;
}

.play-mode-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Ensure moves input stays visible */
#moves.highlighted-control {
    background: white;
    color: black;
    border: 1px solid #4CAF50;
}

/* Make the exit button more prominent */
button.highlighted-control {
    background: #4CAF50 !important;
    color: white !important;
    border: 2px solid white !important;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 10px 10px;
}

.gallery-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.gallery-controls {
    display: flex;
    gap: 6px;
}

.gallery-button {
    padding: 6px 12px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.gallery-button:hover {
    background: #3367d6;
}

#addLevel {
    background: #4CAF50;  /* Green color for add button */
}

#addLevel:hover {
    background: #45a049;
}

#removeLevel {
    background: #dc3545;  /* Red color for remove button */
}

#removeLevel:hover {
    background: #c82333;
}

.readonly-input {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.readonly-input:focus {
    outline: none;
}

.moves-container {
    display: flex;
    gap: 10px;
    padding: 0 10px;
}

.moves-label {
    display: inline-block;
    font-weight: bold;
    color: #333;
    line-height: 32px;  /* Match input height */
    min-width: 60px;
}

.moves-container .moves-input {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
}

.promotion-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.promotion-pieces {
    display: flex;
    gap: 10px;
}

.promotion-piece {
    width: 50px;
    height: 50px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.promotion-piece:hover {
    background-color: #f0f0f0;
}

/* Update play buttons container to ensure buttons stretch properly */
.play-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.play-buttons-row {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.play-buttons-row button,
.play-buttons-row select {
    flex: 1;
    height: 36px;  /* Match button heights */
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Style the move style select to match other controls */
.move-style-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    flex: 1;  /* Allow it to stretch */
    height: 36px;  /* Match button height */
}

.move-style-select:hover {
    border-color: #4CAF50;
}

/* Ensure action buttons have consistent styling */
.actions button {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
    height: 36px;
    min-width: 120px;
    white-space: nowrap;
}

/* Common select element styling */
select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    height: 36px;  /* Match button height */
}

select:hover {
    border-color: #4CAF50;
}

/* Update specific select elements to inherit common styles while keeping their widths */
.mode-select,
.board-size-select,
.move-style-select {
    width: 120px;  /* Keep specific width for these controls */
}

/* Remove any conflicting styles */
.level-info select {
    margin-bottom: 15px;  /* Keep spacing consistent with other inputs */
}

/* Keep the flex behavior for selects in button rows */
.play-buttons-row select {
    flex: 1;
}

.board-size-container {
    display: flex;
    gap: 10px;
    padding: 0 10px;
    margin-top: 10px;
}

.board-size-label {
    display: inline-block;
    font-weight: bold;
    color: #333;
    line-height: 32px;  /* Match select height */
    min-width: 60px;
}

.board-size-container .board-size-select {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Common styles for both moves and board size containers */
.moves-container,
.board-size-container {
    display: flex;
    gap: 10px;
    padding: 0 10px;
    margin-top: 10px;
}

/* Common styles for both labels */
.moves-label,
.board-size-label {
    display: inline-block;
    font-weight: bold;
    color: #333;
    line-height: 32px;
    min-width: 60px;
}

/* Common styles for both inputs */
.moves-input,
.board-size-container .board-size-select {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Remove any conflicting styles */
.board-size-select {
    width: auto !important;  /* Override the fixed width */
}

.changes-panel {
    flex: 35;  /* Take up 35% of the available space */
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-height: 0;  /* Allow container to shrink */
}

.changes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.changes-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.changes-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;  /* Allow lists to shrink */
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.changed-level {
    display: flex;
    gap: 10px;
    padding: 8px;
    margin: 2px 0;
    background: #f8f8f8;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
    cursor: pointer;
}

.changed-level-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.changed-level-content > div {
    font-size: 13px;
    color: #666;
}

.changed-level-content > div:first-child {
    color: #333;
    font-weight: bold;
}

.revert-button {
    align-self: center;
    padding: 4px 8px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.2s;
}

.revert-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.revert-button:not(:disabled):hover {
    background: #d32f2f;
}

.changed-level:hover {
    background: #f0f0f0;
}

.changed-level.removed {
    background-color: #ffebee;  /* Light red background */
}

.changed-level.removed .changed-level-content {
    color: #d32f2f;  /* Darker red text */
}

.test-mode-button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-mode-button.test-mode {
    background-color: #ff6b6b;
    color: white;
}

/* Add back the missing style for Live Mode */
.test-mode-button:not(.test-mode) {
    background-color: #51cf66;
    color: white;
}

.drive-file.dragging {
    opacity: 0.5;
    background: #f0f0f0;
    border: 2px dashed #4285f4;
}

.drive-file[draggable="true"] {
    cursor: move;
}

.drive-file[draggable="true"]:hover {
    background: #f5f5f5;
    border-left: 3px solid #4285f4;
}

.reorder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 4px 0;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: move;
}

.reorder-item:hover {
    background: #f0f0f0;
}

.reorder-item.dragging {
    opacity: 0.5;
    background: #e3f2fd;
    border: 2px dashed #2196F3;
}

.drag-handle {
    color: #999;
    cursor: move;
    user-select: none;
}

.level-name {
    flex: 1;
}

.top-row.four-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(30px, 1fr));  /* Changed from 120px to 30px */
    gap: 8px;
}

.fen-label {
    font-weight: bold;
    color: #333;
}

/* Dialog button styling */
.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.dialog-buttons button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f5f5f5;  /* Changed from white to light gray */
    color: #333;  /* Added explicit text color */
    cursor: pointer;
    width: auto;
    min-width: 80px;
}

.dialog-buttons button:hover {
    background: #e0e0e0;  /* Darker gray on hover */
}

.dialog-buttons button.primary {
    background: #4285f4;
    color: white;
    border-color: #3367d6;
}

.dialog-buttons button.primary:hover {
    background: #3367d6;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.auth-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.auth-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.login-btn {
    background: #4285f4;
    color: white;
}

.login-btn:hover {
    background: #3367d6;
}

.logout-btn {
    background: #dc3545;
    color: white;
}

.logout-btn:hover {
    background: #c82333;
}

.user-name {
    font-size: 14px;
    color: #333;
    margin-right: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 15px 20px;
    min-height: 0;
    overflow-y: auto;
    flex: 1;
}

.auth-error {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.auth-info-message {
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    display: block;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.auth-info-message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.auth-info-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Ensure login modal is always on top when shown */
#login-modal {
    z-index: 1001;
}

#login-modal .modal-content {
    animation: fadeIn 0.3s ease-in-out;
    overflow-y: auto; /* Login modal may need scrolling for its content */
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Backup Modal Styles */
.backup-info {
    margin-bottom: 20px;
}

.backup-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.backup-detail:last-child {
    border-bottom: none;
}

.backup-detail strong {
    color: #333;
    min-width: 80px;
}

.backup-description {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.backup-description p {
    margin: 0 0 10px 0;
    color: #555;
}

.backup-description ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.backup-description li {
    margin-bottom: 4px;
}

.backup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.backup-download-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.backup-download-btn:hover {
    background: #f57c00;
}

.backup-cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.backup-cancel-btn:hover {
    background: #5a6268;
}

/* Lock Modal Styles */
.lock-modal-content {
    max-width: 520px;
    min-width: 480px;
    max-height: none;
    overflow: visible;
    animation: slideInScale 0.4s ease-out;
}

@keyframes slideInScale {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.lock-modal-content .modal-header {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-bottom: 1px solid #e17055;
    margin: 0;
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
}

.lock-modal-content .modal-header h2 {
    color: #d63031;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.lock-modal-content .modal-body {
    padding: 24px;
}

.lock-info {
    text-align: center;
}

.lock-message {
    margin-bottom: 24px;
}

.lock-message p {
    margin: 12px 0;
    line-height: 1.6;
}

.lock-message p:first-child {
    font-size: 1.15rem;
    color: #2d3436;
    font-weight: 600;
}

.lock-message p:last-child {
    color: #636e72;
    font-size: 0.95rem;
}

.lock-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #fef9e7 100%);
    border: 1px solid #f39c12;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.lock-warning p {
    margin: 0;
    color: #d68910;
    font-size: 0.9rem;
    font-weight: 500;
}

.lock-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

.lock-button {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
}

.lock-button.readonly-btn {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 52, 54, 0.3);
}

.lock-button.readonly-btn:hover {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.4);
}

.lock-button.refresh-btn {
    background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
}

.lock-button.refresh-btn:hover {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.4);
}

.lock-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lock-button:active {
    transform: translateY(0);
}

/* Lock indicator container */
.lock-indicator-container {
    margin-bottom: 15px;
}

/* Lock indicator styles */
.editor-locked-indicator {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.editor-locked-indicator::before {
    content: "🔒 ";
    margin-right: 4px;
}

/* Release Lock Button Styles */
.release-lock-button {
    background: #28a745;
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Position Metadata Modal Styles */
.metadata-edit-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    transition: background 0.2s;
    width: 100%;
}

.metadata-edit-button:hover {
    background: #0056b3;
}

.metadata-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.field-description {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.4;
}

.metadata-input,
.metadata-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    margin-bottom: 15px;
}

.metadata-input:focus,
.metadata-select:focus {
    outline: none;
    border-color: #007bff;
}

.castling-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 5px;
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.preview-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
}

.metadata-preview {
    font-family: monospace;
    font-size: 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    color: #333;
    min-height: 30px;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.metadata-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.metadata-apply-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.metadata-apply-btn:hover {
    background: #218838;
}

.metadata-cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.metadata-cancel-btn:hover {
    background: #5a6268;
}

/* Extra Information Collapsible Section */
.extra-info-section {
    margin: 10px 0;
}

.extra-info-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extra-info-toggle:hover {
    background: #e9ecef;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
}

.extra-info-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.extra-info-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.release-lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.release-lock-text {
    white-space: nowrap;
    text-align: center;
}

.release-lock-action {
    background: white;
    color: #28a745;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border: none;
    width: 100%;
    transition: all 0.3s ease;
}

.release-lock-action:hover {
    background: #f8f9fa;
}

.release-lock-action:active {
    background: #e9ecef;
}

/* Version mismatch indicator styles */
.version-mismatch-indicator {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

.version-mismatch-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.version-mismatch-text {
    color: #856404;
    font-size: 12px;
    font-weight: 500;
    flex: 1;
}

.version-refresh-button {
    background: #ffc107;
    border: 1px solid #ffb300;
    color: #856404;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.version-refresh-button:hover {
    background: #ffb300;
    color: #212529;
}

.version-refresh-button:active {
    background: #ff8f00;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: #4285f4;
    border-bottom: 2px solid #4285f4;
}

.auth-tab:hover {
    color: #4285f4;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.2s ease;
    min-height: 0;
}

.auth-form:not([style*="display: none"]) {
    opacity: 1;
}

.auth-form[style*="display: none"] {
    opacity: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
}

.auth-submit-btn {
    background: #4285f4;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.auth-submit-btn:hover {
    background: #3367d6;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    color: #666;
    font-size: 14px;
}

.auth-google-btn {
    background: white;
    color: #333;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    width: 100%;
}

.auth-google-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.auth-note {
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.auth-note p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
} 

/* Multi-editor notification styles */
.multi-editor-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 0;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: Arial, sans-serif;
}

.notification-content {
    padding: 16px;
}

.notification-header {
    font-weight: bold;
    font-size: 16px;
    color: #856404;
    margin-bottom: 8px;
}

.notification-body {
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.notification-actions {
    text-align: right;
}

.notification-actions button {
    background: #ffc107;
    border: none;
    color: #212529;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.notification-actions button:hover {
    background: #e0a800;
}

/* Active editors indicator styles */
.active-editors-indicator {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-family: Arial, sans-serif;
}

.indicator-header {
    font-weight: bold;
    color: #155724;
    font-size: 14px;
    margin-bottom: 8px;
}

.indicator-list {
    color: #155724;
    font-size: 13px;
}

.editor-name {
    margin: 2px 0;
    padding-left: 8px;
}

/* Warning message styling for save */
.message.warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
} 