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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,.3) 35px, rgba(255,255,255,.3) 70px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

#clear-all-btn {
    background-color: #f44336;
}

#clear-all-btn:hover {
    background-color: #da190b;
}

.search-container {
    flex: 1;
    min-width: 200px;
}

#search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #4CAF50;
}

#language-selector {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

main {
    flex: 1;
    padding-top: 120px;
    position: relative;
}

.notes-container {
    position: relative;
    min-height: calc(100vh - 200px);
}

.sticky-note {
    position: absolute;
    width: 250px;
    min-height: 250px;
    padding: 0;
    border-radius: 5px;
    box-shadow: 
        0 5px 10px rgba(0,0,0,0.2),
        inset 0 0 40px rgba(0,0,0,0.1);
    cursor: move;
    transform: rotate(-2deg);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

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

.sticky-note:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    z-index: 100;
}

.sticky-note.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.note-date {
    font-size: 0.8rem;
    color: #666;
}

.note-controls {
    display: flex;
    gap: 0.3rem;
}

.note-controls button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
}

.note-controls button:hover {
    opacity: 1;
    transform: scale(1.2);
}

.note-content {
    flex: 1;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    background: transparent;
    resize: none;
    outline: none;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    line-height: 1.5;
}

/* 付箋の色 */
.color-yellow {
    background-color: #ffd700;
    background-image: linear-gradient(135deg, #ffd700 0%, #ffed4b 100%);
}

.color-pink {
    background-color: #ffb6c1;
    background-image: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
}

.color-blue {
    background-color: #87ceeb;
    background-image: linear-gradient(135deg, #87ceeb 0%, #98d8f4 100%);
}

.color-green {
    background-color: #90ee90;
    background-image: linear-gradient(135deg, #90ee90 0%, #98fb98 100%);
}

.color-orange {
    background-color: #ffa500;
    background-image: linear-gradient(135deg, #ffa500 0%, #ffb347 100%);
}

.color-purple {
    background-color: #dda0dd;
    background-image: linear-gradient(135deg, #dda0dd 0%, #e6b8e6 100%);
}

/* カラーパレット */
.color-palette {
    position: fixed;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1001;
}

.color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.2);
    border-color: #333;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    nav {
        gap: 0.5rem;
    }
    
    button {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .sticky-note {
        width: 200px;
        min-height: 200px;
    }
    
    button .text {
        display: none;
    }
    
    button .icon {
        font-size: 1.2rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 印刷対応 */
@media print {
    header, footer {
        display: none;
    }
    
    .sticky-note {
        position: static !important;
        margin: 1rem;
        page-break-inside: avoid;
    }
    
    .note-controls {
        display: none;
    }
}