/* General Body & Font Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f5f7;
    margin: 0;
    color: #172b4d;
}

.hidden {
    display: none !important;
}

/* --- Home Screen Styles --- */
.home-header {
    padding: 20px 40px;
    background-color: #ffffff;
    border-bottom: 1px solid #dfe1e6;
}

.home-header h1 {
    margin: 0 0 20px 0;
}

#create-board-form input {
    padding: 10px;
    border: 2px solid #dfe1e6;
    border-radius: 3px;
    margin-right: 10px;
    width: 250px;
}

#create-board-form button {
    padding: 10px 15px;
    background-color: #0c66e4;
    color: white;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
}

#boards-list-container {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.board-link {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    font-weight: bold;
    box-shadow: 0 1px 1px rgba(9,30,66,.25);
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.board-link span {
    cursor: pointer;
    flex-grow: 1;
}

.board-link:hover {
    background-color: #f4f5f7;
}

.board-settings-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    line-height: 1;
}

.board-settings-button:hover {
    background-color: rgba(9,30,66,.08);
}

.board-settings-dropdown {
    position: absolute;
    top: 40px;
    right: 10px;
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(9,30,66,.25);
    z-index: 10;
}

.board-settings-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
}

.board-settings-dropdown button:hover {
    background-color: #f4f5f7;
}

.board-settings-dropdown .delete-button {
    color: #c9372c;
}


/* --- Board View Styles --- */
.board-header {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: rgba(0,0,0,0.1);
}

#back-to-home-button {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 3px;
}

#back-to-home-button:hover {
    background-color: rgba(255,255,255,0.3);
}

#board-title {
    margin: 0;
    font-size: 24px;
    color: #172b4d;
}

.board-title-input {
    font-size: 24px;
    font-weight: bold;
    font-family: inherit;
    border: none;
    background-color: white;
    padding: 4px 8px;
    border-radius: 3px;
    outline: 2px solid #0c66e4;
}

#board-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    overflow-x: auto;
    height: calc(100vh - 70px);
}

#empty-board-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 70px);
    text-align: center;
}

#empty-board-state h2 {
    color: #5e6c84;
}

#empty-board-add-list-button {
    padding: 10px 15px;
    background-color: #0c66e4;
    color: white;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}


.list {
    background-color: #ebecf0;
    padding: 10px;
    border-radius: 5px;
    min-width: 270px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.list.mirrored {
    border-left: 4px solid #57d9a3;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.list-header .mirror-icon {
    margin-left: 8px;
    font-size: 14px;
    color: #57d9a3;
    cursor: default;
}

.list h2 {
    margin: 0;
    padding: 4px 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    flex-grow: 1;
}

.list-settings-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    line-height: 1;
}

.list-settings-button:hover {
    background-color: rgba(9,30,66,.13);
}

.list-settings-dropdown {
    position: absolute;
    top: 40px;
    right: 10px;
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(9,30,66,.25);
    z-index: 10;
    width: 150px;
}

.list-settings-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
}

.list-settings-dropdown button:hover {
    background-color: #f4f5f7;
}

.list-title-input {
    font-size: 1.2em;
    font-weight: bold;
    font-family: inherit;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #0c66e4;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.cards-container {
    min-height: 20px;
    flex-grow: 1;
}

.card {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 3px;
    margin-top: 10px;
    box-shadow: 0 1px 0 rgba(9,30,66,.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card.completed {
    background-color: #f4f5f7;
}

.card-complete-toggle {
    width: 18px;
    height: 18px;
    border: 2px solid #8c9bab;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
}

.card-complete-toggle:hover {
    background-color: #dfe1e6;
}

.card-complete-toggle.completed {
    background-color: #4bce97;
    border-color: #4bce97;
}

.card-title {
    flex-grow: 1;
    cursor: pointer;
}

.card.completed .card-title {
    text-decoration: line-through;
    color: #5e6c84;
}

.add-card-button {
    background: none;
    border: none;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    border-radius: 3px;
    margin-top: 8px;
}

.add-card-button:hover {
    background-color: rgba(9,30,66,.08);
}

/* --- Add List Widget Styles --- */
#add-list-widget-container {
    background-color: rgba(0,0,0,0.1);
    border-radius: 5px;
    min-width: 270px;
    height: fit-content;
}

#add-list-widget-container .add-list-button {
    background: none;
    border: none;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    width: 100%;
    color: #172b4d;
    font-weight: bold;
}

#add-list-widget-container .add-list-button:hover {
    background-color: rgba(0,0,0,0.15);
}

#add-list-widget-container .add-list-form-active {
    background-color: #ebecf0;
    padding: 8px;
    border-radius: 5px;
}

#add-list-widget-container input {
    width: 100%;
    padding: 8px;
    border: 2px solid #0c66e4;
    border-radius: 3px;
    box-sizing: border-box;
    margin-bottom: 8px;
}

#add-list-widget-container .add-list-controls {
    display: flex;
    align-items: center;
}

#add-list-widget-container .add-list-controls button {
     padding: 8px 12px;
    background-color: #0c66e4;
    color: white;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
}

#add-list-widget-container .add-list-controls .close-form-button {
    background: none;
    color: #44546f;
    font-size: 24px;
    margin-left: 8px;
    padding: 0 8px;
}


/* --- Modal Styles --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 500px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.modal-content select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#modal-card-title {
    font-size: 20px;
    font-weight: bold;
}

#modal-card-description {
    font-family: inherit;
    font-size: 14px;
    min-height: 100px;
    resize: vertical;
}

.close-button {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    align-self: flex-end;
}

#modal-save-button, #move-list-save-button, #mirror-list-save-button {
    background-color: #0c66e4;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 10px 15px;
    cursor: pointer;
    align-self: flex-start;
    font-weight: bold;
}

#mirror-list-save-button {
    background-color: #57d9a3; /* Green for mirror */
}
