/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

header h1 {
    font-size: 28px;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
}

.toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-add {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker span {
    font-weight: bold;
    color: #4a5568;
}

.color-btn {
    width: 35px;
    height: 35px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

.color-btn.selected {
    border-color: #333;
    transform: scale(1.15);
}

/* ホワイトボード */
.whiteboard {
    flex: 1;
    position: relative;
    background:
        radial-gradient(circle at 20px 20px, #ddd 2px, transparent 2px),
        linear-gradient(to right, #f8f9fa 0%, #e9ecef 100%);
    background-size: 40px 40px;
    overflow: hidden;
    border-top: 3px solid #dee2e6;
}

/* 付箋スタイル */
.sticky-note {
    position: absolute;
    width: 200px;
    min-height: 200px;
    background: #ffeb3b;
    border-radius: 8px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    cursor: move;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    transform: rotate(-1deg);
}

.sticky-note:nth-child(even) {
    transform: rotate(1deg);
}

.sticky-note:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.2);
}

.note-header {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
}

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

.note-number {
    font-size: 12px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.6);
}

.delete-btn {
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.note-content {
    width: 100%;
    height: calc(100% - 40px);
    min-height: 160px;
    border: none;
    background: transparent;
    padding: 15px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    color: rgba(0, 0, 0, 0.8);
    line-height: 1.4;
}

.note-content::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

/* 付箋の色バリエーション */
.sticky-note[style*="#ffeb3b"] {
    color: #333;
}

.sticky-note[style*="#ff9800"] {
    color: #fff;
}

.sticky-note[style*="#f44336"] {
    color: #fff;
}

.sticky-note[style*="#e91e63"] {
    color: #fff;
}

.sticky-note[style*="#9c27b0"] {
    color: #fff;
}

.sticky-note[style*="#2196f3"] {
    color: #fff;
}

.sticky-note[style*="#4caf50"] {
    color: #fff;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }

    .toolbar {
        flex-direction: column;
        gap: 15px;
    }

    .sticky-note {
        width: 180px;
        min-height: 180px;
    }

    .btn-add {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* アニメーション */
@keyframes noteAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(-1deg);
    }
}

.sticky-note {
    animation: noteAppear 0.3s ease-out;
}

/* スクロールバーのカスタマイズ */
.note-content::-webkit-scrollbar {
    width: 8px;
}

.note-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.note-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.note-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.description {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    font-size: 14px;
    color: #666;
}
