@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --bg-gradient: radial-gradient(circle at 0% 0%, #4facfe 0%, #00f2fe 100%);
    --mesh-gradient:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 0% 50%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 50% 50%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 100% 50%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 50% 100%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(253, 16%, 7%, 1) 0, transparent 50%);

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #ff007c;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #0a0a0c;
    background-image: var(--mesh-gradient);
    background-attachment: fixed;
    height: 100vh;
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    position: relative;
}

.board-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-name-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.board-name {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px dashed transparent;
}

.board-name:hover {
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.board-id-sub {
    font-size: 0.7rem;
    opacity: 0.5;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 8px #ff4d4d;
    transition: all 0.3s ease;
}

.status-dot.connected {
    background: #00f2fe;
    box-shadow: 0 0 10px #00f2fe;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.action-btn.secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 124, 0.3);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem 0.35rem 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #7b2ff7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.user-name-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-main);
}

.board-container {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem 3rem 2rem 180px;
    overflow-x: auto;
    align-items: flex-start;
    justify-content: center;
}

/* Online Users Panel */
.users-panel {
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    width: 160px;
    padding: 1.25rem 0.75rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.users-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.users-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00c853;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

#users-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    overflow-y: auto;
}

.user-presence-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.25rem;
    border-radius: 10px;
    transition: background 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.user-presence-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-presence-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #7b2ff7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.user-presence-avatar.host-avatar {
    background: linear-gradient(135deg, #00c853, #00acc1);
}

.user-presence-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.column {
    flex: 0 0 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.column-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.add-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.card-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 4px;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.card-list::-webkit-scrollbar {
    width: 6px;
}

.card-list::-webkit-scrollbar-track {
    background: transparent;
}

.card-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: default;
    animation: fadeIn 0.5s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    box-shadow: none;
}

.card-list.drag-over {
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.card-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 1rem;
    min-height: 1.5rem;
    outline: none;
}

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

.card-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.card-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #7b2ff7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.card-author-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.card-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vote-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vote-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

.vote-btn:hover {
    color: var(--accent-color);
}

.delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: color 0.3s ease;
    opacity: 0;
}

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

.delete-btn:hover {
    color: #ff4d4d;
}

[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
    margin-bottom: 1.5rem;
}

.modal-input:focus {
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Boards Panel */
.boards-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
}

.boards-panel-overlay.active {
    display: block;
}

.boards-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: 100vh;
    background: rgba(20, 20, 30, 0.97);
    border-left: 1px solid var(--glass-border);
    z-index: 950;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
}

.boards-panel.open {
    right: 0;
}

.boards-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.boards-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.boards-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.board-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}

.board-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.board-item.active {
    background: rgba(255, 0, 124, 0.12);
    border: 1px solid rgba(255, 0, 124, 0.25);
}

.board-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    flex-shrink: 0;
}

.board-item-info {
    flex: 1;
    min-width: 0;
}

.board-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-item-id {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.board-item-cards {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.5;
    flex-shrink: 0;
}