/* 사용자 맞춤 노트 분류 스타일 */

/* 구분선 */
.filter-divider {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, #ccc, transparent);
    margin: 0 10px;
    flex-shrink: 0;
}

/* 사용자 정의 분류 버튼 */
.filter-btn.user-type {
    position: relative;
    padding-right: 40px;
    cursor: move;
}

.filter-btn.user-type .edit-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    padding: 4px;
}

.filter-btn.user-type:hover .edit-icon {
    opacity: 0.6;
}

.filter-btn.user-type .edit-icon:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

/* 드래그 중 스타일 */
.filter-btn.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* + 버튼 */
.filter-btn.add-type-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
}

.filter-btn.add-type-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.filter-btn.add-type-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #999 0%, #666 100%);
}

/* 인라인 편집 */
.filter-btn.editing input {
    width: 100%;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 14px;
    font-family: inherit;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="color"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #555;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.limit-info {
    margin-top: 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 삭제 확인 모달 */
.delete-options {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.delete-options label {
    display: block;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
    margin-bottom: 5px;
}

.delete-options label:hover {
    background: #e9ecef;
}

.delete-options input[type="radio"] {
    margin-right: 10px;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        flex: 0 1 calc(50% - 4px);
        font-size: 13px;
    }
    
    .filter-divider {
        width: 100%;
        height: 2px;
        margin: 10px 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
    
    .modal-content h3 {
        font-size: 20px;
    }
}

/* 편집 옵션 메뉴 */
#editOptionsMenu {
    min-width: 150px;
}

#editOptionsMenu button {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
    margin-bottom: 5px;
}

#editOptionsMenu button:hover {
    background: #f0f0f0;
}

#editOptionsMenu button:last-child {
    background: #f5576c;
    color: white;
    margin-bottom: 0;
}

#editOptionsMenu button:last-child:hover {
    background: #e04a5f;
}

/* ─── 다크 테마 (dark / deepfloat) ─── */
html[data-card-theme="dark"] .modal-content,
html[data-card-theme="deepfloat"] .modal-content {
    background: #1e2130;
    color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

html[data-card-theme="dark"] .modal-content h3,
html[data-card-theme="deepfloat"] .modal-content h3 {
    color: #f1f5f9;
}

html[data-card-theme="dark"] .form-group label,
html[data-card-theme="deepfloat"] .form-group label {
    color: #cbd5e1;
}

html[data-card-theme="dark"] .form-group input[type="text"],
html[data-card-theme="dark"] .form-group input[type="email"],
html[data-card-theme="dark"] .form-group textarea,
html[data-card-theme="deepfloat"] .form-group input[type="text"],
html[data-card-theme="deepfloat"] .form-group input[type="email"],
html[data-card-theme="deepfloat"] .form-group textarea {
    background: #0f1117;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-card-theme="dark"] .form-group input:focus,
html[data-card-theme="dark"] .form-group textarea:focus,
html[data-card-theme="deepfloat"] .form-group input:focus,
html[data-card-theme="deepfloat"] .form-group textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

html[data-card-theme="dark"] .keyword-group > div,
html[data-card-theme="deepfloat"] .keyword-group > div {
    background: #0f1117 !important;
    border-color: #334155 !important;
}

html[data-card-theme="dark"] .btn-secondary,
html[data-card-theme="deepfloat"] .btn-secondary {
    background: #1e2130;
    color: #94a3b8;
    border: 1px solid #334155;
}

html[data-card-theme="dark"] .btn-secondary:hover,
html[data-card-theme="deepfloat"] .btn-secondary:hover {
    background: #334155;
    color: #e2e8f0;
}

html[data-card-theme="dark"] .share-section,
html[data-card-theme="deepfloat"] .share-section {
    border-top-color: #334155 !important;
}

html[data-card-theme="dark"] .share-section label,
html[data-card-theme="deepfloat"] .share-section label {
    color: #e2e8f0 !important;
}

html[data-card-theme="dark"] .share-section p,
html[data-card-theme="deepfloat"] .share-section p {
    color: #94a3b8 !important;
}

html[data-card-theme="dark"] .share-section input,
html[data-card-theme="dark"] .share-section textarea,
html[data-card-theme="deepfloat"] .share-section input,
html[data-card-theme="deepfloat"] .share-section textarea {
    background: #0f1117 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-card-theme="dark"] #editActiveShares > div,
html[data-card-theme="deepfloat"] #editActiveShares > div {
    background: #0f1117 !important;
}

html[data-card-theme="dark"] #editActiveShares div[style],
html[data-card-theme="deepfloat"] #editActiveShares div[style] {
    border-color: #334155 !important;
}

html[data-card-theme="dark"] #editActiveShares span[style*="color:#374151"],
html[data-card-theme="deepfloat"] #editActiveShares span[style*="color:#374151"] {
    color: #cbd5e1 !important;
}

/* ─── 이모지 그리드 피커 ─── */
.emoji-grid-picker {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    cursor: default;
    background: #f8fafc;
    transition: border-color .2s;
}
.emoji-grid-picker:focus-within { border-color: #6366f1; }

.emoji-selected-display {
    display: inline-block;
    font-size: 28px;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-width: 44px;
    text-align: center;
}

.emoji-grid-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.emoji-grid-item {
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s, transform .1s;
    user-select: none;
}
.emoji-grid-item:hover { background: rgba(99,102,241,.12); transform: scale(1.15); }
.emoji-grid-item.selected { background: rgba(99,102,241,.2); outline: 2px solid #6366f1; }

.emoji-more-btn {
    font-size: 11px;
    color: #6366f1;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}
.emoji-more-btn:hover { background: rgba(99,102,241,.1); }

/* 다크 테마 이모지 피커 */
html[data-card-theme="dark"] .emoji-grid-picker,
html[data-card-theme="deepfloat"] .emoji-grid-picker {
    background: #0f1117;
    border-color: #334155;
}
html[data-card-theme="dark"] .emoji-selected-display,
html[data-card-theme="deepfloat"] .emoji-selected-display {
    background: #1e2130;
    border-color: #334155;
}
html[data-card-theme="dark"] .emoji-grid-item:hover,
html[data-card-theme="deepfloat"] .emoji-grid-item:hover {
    background: rgba(99,102,241,.25);
}
