/* Board styles */
.board-container {
    display: flex;
    padding: 20px;
    height: calc(100vh - 60px);
}

.lists-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 20px;
    height: calc(100vh - 100px);
    align-items: flex-start;
}

.list {
    background: #ebecf0;
    border-radius: 3px;
    width: 272px;
    padding: 10px;
    height: fit-content;
    max-height: 100%;
    transition: opacity 0.3s ease-out;
    flex-shrink: 0;
}

.card {
    background: white;
    padding: 10px;
    margin: 5px 0;
    border-radius: 3px;
    cursor: move;
    box-shadow: 0 1px 0 rgba(9,30,66,.25);
    transition: opacity 0.3s ease-out;
    cursor: grab;
    transition: transform 0.2s, opacity 0.2s;
}

.card:active {
    cursor: grabbing;
}

.card-placeholder {
    border: 2px dashed #ccc;
    margin: 5px 0;
    min-height: 50px;
    background: #f5f5f5;
    border-radius: 3px;
    background-color: rgba(0,0,0,0.1);
    margin-bottom: 8px;
}

.card-placeholder {
    background: #e2e4ea;
    border: 2px dashed #5e6c84;
    border-radius: 3px;
    margin-bottom: 8px;
}

.card-dragging {
    transform: rotate(2deg);
    opacity: 0.9;
    cursor: grabbing !important;
}

.sortable {
    min-height: 10px;
}

.card-form {
    margin: 5px 0;
    padding: 5px;
}

.card-title-input {
    width: 100%;
    min-height: 60px;
    resize: none;
    border: none;
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 0 rgba(9,30,66,.25);
}

.card-form-buttons {
    display: flex;
    gap: 8px;
}

.card-form-buttons button {
    padding: 6px 12px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

.save-card-btn {
    background-color: #0079bf;
    color: white;
}

.cancel-card-btn {
    background-color: rgba(9,30,66,.04);
}

/* Chat styles */
.chat-container {
    width: 300px;
    margin-left: 20px;
    background: white;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    justify-content: flex-start;
    gap: 10px;
}

.chat-form {
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
}

.chat-form input {
    flex: 1;
    margin-right: 10px;
}

.card.ui-sortable-helper {
    transform: rotate(3deg);
    cursor: grabbing;
}

.card.ui-sortable-helper {
    transform: rotate(2deg);
    cursor: grabbing;
}

.list-cards.ui-sortable-placeholder {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    margin: 5px 0;
}

.list-cards {
    min-height: 50px; /* ضمان وجود مساحة للإفلات */
    padding: 5px;
}

.list-cards {
    min-height: 10px;
}

.delete-card,
.delete-list,
.delete-board {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    float: right;
    font-size: 18px;
    padding: 0 5px;
    opacity: 0.7;
}

.delete-card:hover,
.delete-list:hover,
.delete-board:hover {
    color: #ff0000;
    opacity: 1;
}

.card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.board-card,
.list,
.card {
    transition: opacity 0.3s ease-out;
}

.card.removing,
.list.removing,
.board-card.removing {
    opacity: 0;
}

.sidebar {
    width: 250px;
    height: 100vh;
    background: #f4f5f7;
    position: fixed;
    left: 0;
    top: 0;
    padding: 60px 0 20px;
    border-right: 1px solid #ddd;
}

.sidebar-boards {
    padding: 10px;
}

.sidebar-boards h3 {
    padding: 8px 12px;
    margin: 0;
    color: #5e6c84;
    font-size: 14px;
}

.sidebar-board-item {
    padding: 8px 12px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #172b4d;
    border-radius: 3px;
}

.sidebar-board-item:hover {
    background: #e4e6ea;
}

.sidebar-board-item.active {
    background: #e4e6ea;
}

.add-board-btn {
    padding: 8px 12px;
    margin: 8px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    width: calc(100% - 16px);
    cursor: pointer;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    margin-right: 300px;
    background: #0079bf;
    min-height: 100vh;
    padding-top: 60px;
}

.chat-sidebar {
    width: 300px;
    height: calc(100vh - 60px); /* ارتفاع الشاشة ناقص ارتفاع الناف بار */
    position: fixed;
    right: 0;
    top: 60px;
    background: #f4f5f7;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.chat-header h3 {
    margin: 0;
    color: #172b4d;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    justify-content: flex-start;
    gap: 10px;
}

.message {
    background: white;
    border-radius: 3px;
    padding: 8px 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 80%;
    margin-bottom: 8px;
}

.message .username {
    font-weight: bold;
    color: #172b4d;
    margin-bottom: 4px;
}

.message .time {
    font-size: 11px;
    color: #5e6c84;
}

.chat-input {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.chat-input form {
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.chat-input button {
    padding: 8px 16px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.main-content {
    margin-right: 300px;
    padding: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    justify-content: flex-start;
    gap: 10px;
}

.message .username {
    font-weight: bold;
    color: #172b4d;
    margin-bottom: 4px;
}

.message .time {
    font-size: 11px;
    color: #5e6c84;
}

.chat-input {
    padding: 15px;
    background: #f4f5f7;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
}

.chat-input form {
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.chat-input button {
    padding: 8px 16px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-messages > :last-child {
    margin-top: auto;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.chat-input-wrapper input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.file-upload-btn {
    cursor: pointer;
    padding: 8px;
    color: #666;
}

.file-upload-btn:hover {
    color: #0079bf;
}

.file-attachment {
    margin-top: 8px;
    padding: 8px;
    background: #f1f1f1;
    border-radius: 4px;
    display: inline-block;
}

.file-attachment a {
    color: #0079bf;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-attachment i {
    font-size: 16px;
}

.file-attachment {
    background: #f1f1f1;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.file-attachment a {
    color: #0079bf;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #666;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.attach-file-btn:hover {
    background: #e4e6ea;
    color: #0079bf;
}

.attach-file-btn i {
    font-size: 18px;
}

.chat-input-wrapper button[type="submit"] {
    padding: 8px 16px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.chat-input-wrapper button[type="submit"]:hover {
    background: #026aa7;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-content {
    word-break: break-word;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.logout-btn {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    margin-left: 10px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.navbar {
    background: #026aa7;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.user-info {
    display: flex;
    align-items: center;
    color: white;
    gap: 15px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card-label {
    height: 8px;
    width: 40px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.label-manager {
    padding: 16px;
}

.labels-list {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 3px;
    color: white;
}

.label-actions {
    display: flex;
    gap: 8px;
}

.label-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    background: rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
}

.add-list {
    min-width: 272px;
    margin: 0 8px;
}

.add-list-btn {
    background: rgba(0,0,0,0.24);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 10px;
    width: 272px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.add-list-btn:hover {
    background: rgba(0,0,0,0.32);
}

.add-card-btn {
    width: 100%;
    padding: 8px;
    color: #5e6c84;
    background: transparent;
    border: none;
    border-radius: 3px;
    text-align: left;
    cursor: pointer;
    margin-top: 5px;
    font-size: 14px;
}

.add-card-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #172b4d;
}

.card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .card-actions {
    opacity: 1;
}

.label-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #5e6c84;
}

.label-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #172b4d;
}

.labels-dialog {
    padding: 16px;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card-label {
    width: 40px;
    height: 8px;
    border-radius: 4px;
}

.label-manager {
    padding: 15px;
}

.labels-list {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 3px;
    color: white;
}

.label-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.label-actions button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
}

.create-label-btn {
    width: 100%;
    padding: 8px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card-label {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: white;
    display: inline-block;
}

.label-manager {
    padding: 16px;
}

.labels-list {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 3px;
    color: white;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
}

.form-group input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.card-form {
    padding: 8px;
    margin-bottom: 8px;
}

.card-title-input {
    width: 100%;
    min-height: 54px;
    padding: 8px;
    border: none;
    border-radius: 3px;
    resize: none;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.card-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-form-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.save-card {
    background: #0079bf;
    color: white;
}

.cancel-card {
    background: transparent;
    color: #6b778c;
}

.add-label-btn {
    width: 100%;
    padding: 8px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card-label {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: white;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-menu-dialog {
    padding: 0;
    border-radius: 3px;
    overflow: hidden;
}

.menu-header {
    padding: 12px;
    background: #f4f5f7;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-section {
    padding: 12px;
}

.labels-container {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    padding: 8px;
    border-radius: 3px;
    cursor: pointer;
}

.label-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.create-label-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label-name-input, .label-color-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.color-picker {
    margin: 15px 0;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #0079bf;
}

.selected-color {
    height: 24px;
    border-radius: 3px;
    margin: 10px 0;
}

.label-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 3px;
    background: #f4f5f7;
}

.label-color {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    margin-right: 8px;
}

.label-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.create-label-dialog {
    padding: 16px;
}

.label-name-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-bottom: 10px;
}

.create-label-submit {
    width: 100%;
    padding: 8px;
    background: #0079bf;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-label-btn {
    background: rgba(255,0,0,0.1);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    color: #fff;
}

.delete-label-btn:hover {
    background: rgba(255,0,0,0.2);
}

.label-actions button {
    margin-left: 4px;
}

.label-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.label-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 3px;
}

.delete-label-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
}

.delete-label-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

.edit-label-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    color: white;
}

.edit-label-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.label-item {
    margin-bottom: 8px;
    border-radius: 3px;
}

.label-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
}

.label-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    color: white;
}

.delete-label-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

.edit-label-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.label-dialog {
    padding: 0;
}

.label-item {
    margin-bottom: 8px;
    border-radius: 3px;
    padding: 8px;
}

.label-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-title {
    color: white;
    flex-grow: 1;
}

.label-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.label-buttons button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-buttons .delete-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

.label-buttons .edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.checkbox-container input:checked ~ .checkmark:after {
    content: '\2713';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 1px;
    left: 3px;
}

.custom-dialog-wrapper .ui-dialog-titlebar {
    display: none;
}

.custom-dialog {
    padding: 0;
}

.dialog-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.dialog-content {
    padding: 15px;
}

.dialog-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.dialog-actions {
    padding: 15px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.dialog-button {
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.dialog-button.primary {
    background-color: #0079bf;
    color: white;
}

.dialog-button.cancel {
    background-color: #ebecf0;
}

/* Labels Styling */
.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    min-height: 8px;
    transition: all 0.2s ease;
}

.label-pill {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    display: inline-block;
    margin-right: 4px;
    margin-bottom: 4px;
    height: 8px;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 1;
}

.label-pill:hover {
    opacity: 0.8;
}

.label-pill.removing {
    opacity: 0;
    transform: scale(0.8);
}

.label-pill.adding {
    animation: addLabel 0.2s ease;
}

@keyframes addLabel {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.no-labels {
    color: #5e6c84;
    font-size: 12px;
    font-style: italic;
}

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

.modal-content {
    background: white;
    width: 400px;
    margin: 50px auto;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

.modal-body {
    padding: 12px;
}

.labels-list {
    margin-bottom: 12px;
}

.label-item {
    display: flex;
    align-items: center;
    padding: 6px;
    margin-bottom: 4px;
    border-radius: 3px;
}

.label-preview {
    flex-grow: 1;
    padding: 6px 12px;
    border-radius: 3px;
    color: white;
}

.label-controls {
    margin-left: 8px;
}

.color-picker {
    margin-top: 8px;
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
}

.color-option.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #0079bf;
}

/* Board Toolbar */
.board-toolbar {
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Card Modal Styles */
.card-detail {
    width: 768px;
    max-width: 90%;
}

.card-title-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-labels-section {
    margin: 20px 0;
}

.card-labels-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-labels-list .label-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    width: calc(50% - 4px);
    background: #f5f6f7;
}

.card-labels-list .label-item:hover {
    background: #eaecef;
}

.card-labels-list .label-color {
    width: 32px;
    height: 8px;
    border-radius: 4px;
}

.card-labels-list .label-check {
    margin-left: auto;
    display: none;
}

.card-labels-list .label-item.active .label-check {
    display: block;
    color: #42526e;
}

/* تحديث أسلوب Labels على البطاقة */
.card .card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card .label-pill {
    height: 8px;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
}

.card .label-pill:hover {
    opacity: 0.8;
}

.selected-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.selected-label {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    margin-right: 4px;
}

.card-labels-list .label-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 3px;
    cursor: pointer;
}

.card-labels-list .label-item:hover {
    background-color: rgba(0,0,0,0.08);
}

.card-labels-list .label-item.active {
    background-color: rgba(0,0,0,0.05);
}

.card-labels-list .label-item.active .label-check {
    display: inline-block;
    margin-left: auto;
    color: #42526e;
}

.card-labels-list .label-check {
    display: none;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    min-height: 8px;
}

.label-pill {
    height: 8px;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.label-pill.adding {
    animation: addLabel 0.3s ease;
}

.label-pill.removing {
    opacity: 0;
    transform: scale(0.8);
}

@keyframes addLabel {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* تنسيقات النافذة المنبثقة للبطاقة */
.card-detail {
    max-width: 800px;
    width: 95%;
    background: #f4f5f7;
}

.card-detail .modal-header {
    background: #fff;
    padding: 16px;
    border-bottom: 1px solid #ddd;
}

.card-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title-section i {
    color: #42526e;
    font-size: 20px;
}

.card-title-section h3 {
    margin: 0;
    color: #172b4d;
    font-size: 20px;
}

.card-detail .modal-body {
    padding: 20px;
}

/* تنسيقات قسم Labels */
.card-labels-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-labels-section h4 {
    color: #172b4d;
    font-size: 16px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-labels-section h4 i {
    color: #42526e;
}

.selected-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    min-height: 24px;
    padding: 8px;
    background: #f4f5f7;
    border-radius: 4px;
}

.selected-label {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.card-labels-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.card-labels-list .label-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-labels-list .label-item:hover {
    background: #f4f5f7;
}

.card-labels-list .label-item.active {
    background: #e4f0f6;
    border-color: #0079bf;
}

.card-labels-list .label-color {
    width: 32px;
    height: 8px;
    border-radius: 4px;
    margin-right: 8px;
}

.card-labels-list .label-name {
    flex-grow: 1;
    color: #172b4d;
    font-size: 14px;
}

.card-labels-list .label-check {
    color: #0079bf;
    display: none;
}

.card-labels-list .label-item.active .label-check {
    display: block;
}

/* تحسين تنسيق Labels على البطاقة */
.card .card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card .label-pill {
    height: 8px;
    width: 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card .label-pill:hover {
    transform: scale(1.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #026aa7;
    color: white;
}

.nav-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-btn i {
    font-size: 14px;
}

/* Labels Manager Modal */
#labelsManager .modal-content {
    max-width: 600px;
    background: #f4f5f7;
}

#labelsManager .modal-header {
    background: #fff;
    padding: 16px 20px;
    border-bottom: 1px solid #dfe1e6;
}

#labelsManager .modal-header h3 {
    color: #172b4d;
    margin: 0;
}

#labelsManager .modal-body {
    padding: 20px;
}

.labels-list {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.labels-list .label-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #dfe1e6;
    background: #fff;
    transition: all 0.2s ease;
}

.labels-list .label-item:hover {
    background: #f4f5f7;
    border-color: #c1c7d0;
}

.labels-list .label-preview {
    flex-grow: 1;
    padding: 8px 12px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.labels-list .label-controls {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.labels-list .edit-label-btn,
.labels-list .delete-label-btn {
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #42526e;
    background: transparent;
    transition: all 0.2s ease;
}

.labels-list .edit-label-btn:hover {
    background: #e4f0f6;
    color: #0079bf;
}

.labels-list .delete-label-btn:hover {
    background: #ffebe6;
    color: #c9372c;
}

.create-label-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: #0079bf;
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.create-label-btn:hover {
    background: #026aa7;
}

.create-label-btn i {
    font-size: 14px;
}

/* Color Options in Label Form */
.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-option.selected {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0079bf;
}

/* Label Form Inputs */
#labelEditForm .form-group {
    margin-bottom: 16px;
}

#labelEditForm label {
    display: block;
    color: #172b4d;
    margin-bottom: 8px;
    font-weight: 500;
}

#labelEditForm input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
}

#labelEditForm input[type="text"]:focus {
    border-color: #0079bf;
    outline: none;
}

#labelEditForm .btn-save {
    background: #0079bf;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#labelEditForm .btn-save:hover {
    background: #026aa7;
}

.list-dragging {
    opacity: 0.9;
    transform: rotate(2deg);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.list-placeholder {
    border: 2px dashed #ccc;
    background-color: rgba(0,0,0,0.03);
    margin: 0 4px;
    border-radius: 3px;
    min-width: 272px;
}

.list .list-header {
    cursor: grab;
}

.list .list-header:active {
    cursor: grabbing;
}

.shared-users {
    margin-top: 20px;
}

.shared-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.shared-user button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
}

.share-button {
    margin-left: auto;
}

.share-button button {
    background: #0079bf;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
}

.board-card.shared {
    background-color: #f0f2f5;
    border: 1px solid #ddd;
}

.shared-indicator {
    font-size: 0.8em;
    color: #666;
    display: block;
    margin-top: 5px;
}

.shared-indicator i {
    margin-right: 5px;
    color: #0079bf;
}

.board-role {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 3px;
}

.board-role.owner {
    background-color: #61bd4f;
    color: white;
}

.board-role.shared {
    background-color: #0079bf;
    color: white;
}

/* Home Page Styles */
.home-page {
    background-color: #f0f2f5;
    min-height: 100vh;
}

.boards-container {
    max-width: 1200px;
    margin: 60px auto 20px; /* تعديل هنا: إضافة margin-top بقيمة 60px */
    padding: 0 20px;
}

.boards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.boards-header h1 {
    color: #172b4d;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.create-board-btn {
    background-color: #0079bf;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    transition: background-color 0.2s;
}

.create-board-btn:hover {
    background-color: #026aa7;
}

.boards-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.boards-section h2 {
    color: #172b4d;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.board-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.board-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 20px;
}

.board-card-content h3 {
    color: #172b4d;
    margin-bottom: 10px;
    font-size: 16px;
}

.board-meta {
    color: #5e6c84;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.board-card.shared {
    background-color: #f4f5f7;
    border: 1px solid #dfe1e6;
}

.delete-board {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #42526e;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.board-card:hover .delete-board {
    opacity: 1;
}

.delete-board:hover {
    color: #ee362c;
}

.no-boards {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    background-color: #f4f5f7;
    border-radius: 8px;
    color: #5e6c84;
}

.no-boards i {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Navbar improvements */
.navbar {
    background-color: #026aa7;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 3px;
    background-color: rgba(255,255,255,0.1);
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.back-btn i {
    margin-right: 5px;
}

/* Login & Register Pages Styles */
.login-container,
.register-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h2,
.register-container h2 {
    text-align: center;
    color: #172b4d;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-container form,
.register-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container input,
.register-container input {
    padding: 12px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.login-container input:focus,
.register-container input:focus {
    border-color: #0079bf;
    outline: none;
}

.login-container button,
.register-container button {
    padding: 12px;
    background-color: #0079bf;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-container button:hover,
.register-container button:hover {
    background-color: #026aa7;
}

.login-link,
.register-link {
    text-align: center;
    margin-top: 20px;
    color: #5e6c84;
}

.login-link a,
.register-link a {
    color: #0079bf;
    text-decoration: none;
}

.login-link a:hover,
.register-link a:hover {
    text-decoration: underline;
}

.error {
    background-color: #eb5a46;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error p {
    margin: 5px 0;
}

.success {
    background-color: #61bd4f;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Override body style for login/register pages */
body {
    background-color: #f9fafc;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container,
    .register-container {
        margin: 40px 20px;
        padding: 20px;
    }
}

.board-header {
    margin-top: 20px;
    padding: 10px 0;
}

.board-header h2 {
    color: #ffffff;
    font-size: 24px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
