* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pangolin', cursive;
}

body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

#sticky-notes-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: center;
    width: 100%;
    justify-content: center;
}

canvas {
    background-color: #ffffd4;
    border: 1px solid #e6e6bf;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

#current-canvas {
    position: relative;
}

canvas:not(#current-canvas) {
    transform: scale(0.8);
    opacity: 0.8;
}

.frame-wrapper {
    position: relative;
}

.pen-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    fill: #666;
    transition: fill 0.3s ease;
}

.pen-icon:hover {
    fill: #000;
}

.minimal-button {
    background-color: white;
    border: 1px solid #000;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 10;
    font-family: 'Pangolin', cursive;
}

.minimal-button:hover {
    background-color: #000;
    color: white;
}

.controls {
    display: flex;
    gap: 10px;
    position: fixed;
    bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#add-frame {
    white-space: nowrap;
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#show-all-frames {
    white-space: nowrap;
    position: fixed;
    right: 20px;
    top: calc(50% + 50px);
    transform: translateY(-50%);
}

.corner-link {
    position: fixed;
    top: 250px;
    left: 1;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    color: #000;
    transition: all 0.3s ease;
    z-index: 1000;
}

.corner-link:hover {
    transform: scale(1.1);
    color: #666;
}

.frames-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.grid-content {
    display: grid;
    grid-template-columns: repeat(5, 200px);
    grid-template-rows: repeat(10, 200px);
    gap: 10px;
    width: fit-content;
    height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.grid-content .frame-wrapper {
    width: 200px;
    height: 200px;
}

.grid-content canvas {
    width: 100%;
    height: 100%;
    transform: none;
    opacity: 1;
}

.grid-content .pen-icon {
    width: 20px;
    height: 20px;
    top: 5px;
    right: 5px;
}

.close-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gallery Styles */
.header-links {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.gallery-container {
    padding: 80px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-container h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gallery-item h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.gallery-item p {
    margin: 5px 0;
    color: #666;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.modal h2 {
    margin-top: 0;
    color: #333;
}

.share-url-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-url-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Pen Settings Panel */
.pen-settings-panel {
    position: fixed;
    top: 50px;
    right: 50px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-family: 'Pangolin', cursive;
    user-select: none;
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px 8px 0 0;
    cursor: move;
}

.panel-header h3 {
    margin: 0;
    flex-grow: 1;
    font-size: 16px;
}

.panel-header button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    border-radius: 4px;
}

.panel-header button:hover {
    background: #e0e0e0;
}

.panel-content {
    padding: 15px;
    max-height: 80vh;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.setting-group input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.setting-group input[type="color"] {
    width: 50px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 4px;
}

.color-presets {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.color-preset {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.setting-group select {
    width: 100%;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: 'Pangolin', cursive;
}

.value-display {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.preset-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Pangolin', cursive;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Minimized state */
.pen-settings-panel.minimized .panel-content {
    display: none;
}

.pen-settings-panel.minimized {
    width: auto;
}

/* Hide panel */
.pen-settings-panel.hidden {
    display: none;
}

.buttons-group {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.buttons-group button {
    flex: 1;
    font-size: 12px;
    padding: 5px;
}

.tools-group {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #f0f0f0;
}

.tool-btn.active {
    background: #e0e0e0;
    border-color: #999;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}