/* Insight Wall - Collaborative Sticky Board */
:root {
    --iw-primary: #f472b6;
    --iw-bg: rgba(15, 23, 42, 0.95);
    --iw-glass: rgba(255, 255, 255, 0.03);
    --iw-border: rgba(255, 255, 255, 0.1);
}

.iw-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    align-items: center;
    justify-content: center;
}

.iw-overlay.show {
    display: flex;
    opacity: 1;
}

.iw-modal {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: var(--iw-bg);
    border: 1px solid var(--iw-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.iw-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--iw-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.iw-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
}

.iw-title i {
    color: var(--iw-primary);
}

.iw-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.iw-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.iw-btn-primary {
    background: var(--iw-primary);
    color: white;
}

.iw-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--iw-border);
}

.iw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.iw-btn:active {
    transform: translateY(0);
}

.iw-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.iw-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Wall Content & Textures */
.iw-wall {
    flex: 1;
    position: relative;
    overflow: auto;
    padding: 28px 28px 60px;
    background-color: #0f172a;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    align-items: start;   /* ⭐ cells don't stretch to row height */
    align-content: start;
    transition: background 0.3s ease;
}

/* Textures */
.iw-wall.texture-dots {
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 40px 40px;
}

.iw-wall.texture-grid {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.iw-wall.texture-brick {
    background-image: 
        linear-gradient(335deg, rgba(0,0,0,0.1) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.1) 23px, transparent 23px),
        linear-gradient(335deg, rgba(0,0,0,0.1) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.1) 23px, transparent 23px);
    background-size: 58px 58px;
    background-position: 0px 2px, 4px 35px, 29px 31px, 34px 6px;
}

.iw-wall.texture-cork {
    background-color: #7b5e43;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.1) 1px, transparent 0),
        radial-gradient(circle at 0% 0%, rgba(0,0,0,0.1) 1px, transparent 0);
    background-size: 10px 10px;
}

.iw-wall.texture-wood {
    background-color: #3d2b1f;
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 100px);
}

.iw-wall.texture-dark {
    background-color: #020617;
}

/* Sticky Note */
.iw-note {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.13);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    cursor: default;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    align-self: start;  /* ⭐ each card only as tall as content */
}

@keyframes noteAppear {
    from { opacity: 0; transform: scale(0.8) rotate(-5deg); }
    to { opacity: 1; transform: scale(1) rotate(var(--note-rotation, 0deg)); }
}

.iw-note:hover {
    transform: translateY(-8px) scale(1.02) rotate(0deg) !important;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.iw-note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.iw-note-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iw-note-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--iw-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iw-note-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.iw-note-content {
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.6;
    word-break: break-word;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 4px;
    /* Clamp long text at 6 lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    overflow: hidden;
}

.iw-note-image {
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 6px;
    object-fit: cover;
    max-height: 160px;
    display: block;
    border: 1px solid rgba(0,0,0,0.05);
}

.iw-note-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iw-note-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

.iw-note-reactions {
    display: flex;
    gap: 8px;
}

.iw-reaction {
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.iw-reaction:hover {
    background: rgba(244, 114, 182, 0.1);
    color: var(--iw-primary);
}

.iw-reaction.active {
    background: var(--iw-primary);
    color: white;
}

/* Creator Overlay */
.iw-creator-ov {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.iw-creator-ov.show {
    display: flex;
}

.iw-creator-card {
    background: #1e293b;
    width: 90%;
    max-width: 480px;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 25px 70px -12px rgba(0, 0, 0, 0.5);
    animation: creatorPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.iw-creator-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
    text-align: left;
}

.iw-textarea {
    width: 100%;
    min-height: 140px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    margin-bottom: 24px;
    resize: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.iw-textarea::placeholder {
    color: #64748b;
}

.iw-textarea:focus {
    outline: none;
    border-color: var(--iw-primary);
    background: rgba(0, 0, 0, 0.3);
}

.iw-textarea:focus {
    outline: none;
    border-color: var(--iw-primary);
}

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

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

.iw-color-opt.active {
    transform: scale(1.2);
    border-color: #1e293b;
}

.iw-media-preview {
    width: 100%;
    height: 150px;
    background: var(--bg-item);
    border-radius: 16px;
    border: 2px dashed var(--border-strong);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.iw-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iw-media-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Empty State */
.iw-empty {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
    /* No grid-column needed — works in both grid and column layouts */
    width: 100%;
    display: block;
}

.iw-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.iw-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #fff;
}

/* Configurator Modal */
.iw-config-card {
    background: var(--bg-surface-solid);
    width: 95%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 70px -12px rgba(0, 0, 0, 0.4);
    animation: creatorPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.iw-config-group {
    margin-bottom: 14px;
}

.iw-config-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.iw-input-premium {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid var(--border-strong);
    background: var(--bg-item);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.iw-input-premium:focus {
    outline: none;
    border-color: var(--iw-primary);
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.1);
}

.iw-texture-grid-opt {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.iw-texture-btn {
    padding: 8px;
    border-radius: 10px;
    border: 2px solid var(--border-strong);
    background: var(--bg-item);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
}

.iw-texture-btn:hover {
    border-color: var(--iw-primary);
    background: var(--bg-item-hover);
}

.iw-texture-btn.active {
    background: var(--iw-primary);
    color: white;
    border-color: var(--iw-primary);
}

/* Note Colors — Vibrant & Distinguished */
.iw-bg-white  { background: #ffffff; border-left: 4px solid #cbd5e1; }
.iw-bg-yellow { background: #fff3bf; border-left: 4px solid #f59e0b; }
.iw-bg-blue   { background: #bfdbfe; border-left: 4px solid #3b82f6; }
.iw-bg-green  { background: #bbf7d0; border-left: 4px solid #22c55e; }
.iw-bg-pink   { background: #fbcfe8; border-left: 4px solid #ec4899; }
.iw-bg-purple { background: #ddd6fe; border-left: 4px solid #8b5cf6; }
.iw-bg-orange { background: #fed7aa; border-left: 4px solid #f97316; }
.iw-bg-coral  { background: #fecaca; border-left: 4px solid #ef4444; }
.iw-bg-mint   { background: #a7f3d0; border-left: 4px solid #10b981; }
.iw-bg-lavender { background: #e0e7ff; border-left: 4px solid #6366f1; }
.iw-bg-sky    { background: #bae6fd; border-left: 4px solid #0ea5e9; }
.iw-bg-peach  { background: #fde68a; border-left: 4px solid #d97706; }

/* Pinned Note */
.iw-note-pinned {
    border-top: 3px solid var(--iw-primary) !important;
    box-shadow: 0 8px 25px -4px rgba(244, 114, 182, 0.2), 0 0 0 1px rgba(244, 114, 182, 0.15);
}

.iw-pin-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--iw-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(244, 114, 182, 0.2);
}

.iw-pin-badge i {
    font-size: 0.7rem;
    transform: rotate(-30deg);
    animation: iwPinWiggle 2s ease-in-out infinite;
}

@keyframes iwPinWiggle {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(-25deg); }
}
