:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    color: var(--text-color);
    font-family: 'Outfit', 'Jannat', 'Cairo', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: none;
}

#wall-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

#bg-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

#particle-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 500;
}

.idea-bubble {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 12px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform-origin: center center;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    min-width: 90px;
    min-height: 90px;
    will-change: transform, left, top;
}

.idea-bubble.expanded {
    z-index: 100 !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 20px var(--bubble-color, rgba(255,255,255,0.5));
    min-width: 250px;
    min-height: auto;
    padding: 24px 16px;
    cursor: default;
}

.idea-bubble:active.draggable {
    cursor: grabbing;
}

.idea-bubble::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bubble-color, rgba(255,255,255,0.1));
    opacity: 0.2;
    z-index: -1;
    border-radius: inherit;
}

.idea-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    word-break: break-word;
    pointer-events: none;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.expanded .idea-title {
    -webkit-line-clamp: unset;
    font-size: 1.25rem;
}

.idea-desc {
    display: none;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 16px;
    line-height: 1.5;
    word-break: break-word;
    pointer-events: none;
    width: 100%;
}

.expanded .idea-desc {
    display: block;
    animation: fadeIn 0.3s forwards;
}

.vote-wrapper {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.expanded .vote-wrapper {
    display: flex;
}

.vote-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.vote-btn:active {
    transform: scale(0.95);
}

.vote-score {
    font-weight: bold;
    font-size: 1.4rem;
}

.vote-btn svg { width: 28px; height: 28px; }

.admin-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: none;
    z-index: 10;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.admin-mode .admin-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-idea-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(118, 75, 162, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

#add-idea-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(118, 75, 162, 0.6);
}

#add-idea-fab:active {
    transform: scale(0.95);
}

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e293b;
    padding: 32px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(0);
    transition: transform 0.3s;
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal h2 { margin-bottom: 24px; text-align: center; }

input, textarea {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus { border-color: #667eea; }

textarea { resize: none; height: 100px; }

.color-picker {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-opt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s, border-color 0.1s;
}

.color-opt.selected {
    transform: scale(1.15);
    border-color: white;
}

.modal-actions { display: flex; gap: 16px; }

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #764ba2; }

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

#admin-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #ff4757;
    color: white;
    text-align: center;
    padding: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 5000;
}

#admin-banner.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    opacity: 0;
}
