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

body {
    user-select: none;
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
    min-width: 916px;
}

h1 {
    text-transform: uppercase;
    font-family: 'Courier New', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

.container {
    display: flex;
    height: 100vh;
}

.left-panel {
    width: 500px;
    background-color: #e8e8e8;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.main-content {
    flex: 1;
    background-color: #ecf0f1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow-y: auto;
    padding: 20px 0;
}

.notebook-bg {
    width: 916px;
    height: 811px;
    background-image: url('img/notebook_open.png');
    background-repeat: no-repeat;
    background-position: top-left;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.copyright {
    position: absolute;
    bottom: 120px;
    right: 100px;
    font-size: 12px;
    color: #2c2c2c;
    opacity: 0.1;
    font-size: 10px;
}

.main-content > * {
    position: relative;
    z-index: 2;
}

.stamps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    gap: 15px;
    justify-content: center;
    width: 100%;
    padding: 20px 0;
}

.stamp-item {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: visible;
    background-color: transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-image {
    width: 200px;
    max-height: 200px;
    height: auto;
    object-fit: contain;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: element;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

.stamp-image:active {
    cursor: grabbing;
}

.stamp-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

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

.stamp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stamp-text {
    display: inline-block;
    padding: 8px 12px;
    font-family: 'Courier New', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #1a365d;
    background: transparent;
    border: 3px solid #1a365d;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    text-align: center;
    max-width: 180px;
    word-wrap: break-word;
    white-space: normal;
    user-select: none;
    -webkit-user-drag: element;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    font-size: 18px;
    margin-top: 50px;
}

.error {
    text-align: center;
    color: #e74c3c;
    font-size: 18px;
    margin-top: 50px;
}

.header {
    color: #2c2c2c;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #b0b0b0;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.header p {
    font-size: 14px;
    opacity: 0.8;
}

.stats {
    background-color: #d0d0d0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #2c2c2c;
    text-align: left;
}

.stats h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.stats p {
    font-size: 12px;
    opacity: 0.9;
}

.search-container {
    margin-bottom: 20px;
}

.search-box {
    width: 100%;
    padding: 10px;
    border: 2px solid #b0b0b0;
    border-radius: 5px;
    background-color: #f8f8f8;
    color: #2c2c2c;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.search-box::placeholder {
    color: #7f8c8d;
}

.filter-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
    color: #2c2c2c;
    font-size: 14px;
}

.filter-checkbox {
    margin-right: 8px;
    transform: scale(1.2);
    cursor: pointer;
}

.filter-label {
    cursor: pointer;
    user-select: none;
}
.page-controls {
    position: fixed;
    right: 20px;
    top: 20px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
    z-index: 3;
}

.nav-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
}

.map-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.map-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

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

.page-indicator {
    color: #2c3e50;
    background: rgba(255,255,255,0.7);
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    padding: 8px 10px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.nav-btn {
    background: #2c3e50;
    color: #ecf0f1;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: #34495e;
}

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

.save-btn {
    background: rgba(255,255,255,0.7);
    color: white;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

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

.load-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.load-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.9);
}

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

.new-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.9);
}

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

.bucket-list {
    position: fixed;
    right: 30px;
    bottom: 20px;
    color: #2c2c2c;
    font-family: 'Caveat', cursive;
    font-size: 16px;
    font-weight: 600;
    z-index: 3;
}

.undo-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.undo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.9);
}

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

.undo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.undo-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.7);
}

.add-text-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.add-text-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.9);
}

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

.notebook-selector {
    position: relative;
    display: inline-block;
}

.notebook-select-btn {
    background: rgba(255,255,255,0.7);
    color: #2c2c2c;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.notebook-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.9);
}

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

.notebook-dropdown {
    position: absolute;
    top: 0;
    right: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-right: 5px;
}

.notebook-dropdown.show {
    display: block;
}

.notebook-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #2c2c2c;
}

.notebook-item:hover {
    background: #f5f5f5;
}

.notebook-item:last-child {
    border-bottom: none;
}

.notebook-item.active {
    background: #e3f2fd;
    font-weight: bold;
}

.text-note {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-size: 22px;
    font-weight: 500;
    color: #2c2c2c;
    border-radius: 8px;
    padding: 10px;
    resize: both;
    overflow: auto;
    cursor: move;
    z-index: 10;
    min-width: 200px;
    min-height: 100px;
    overflow: hidden;
}

.text-note:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.text-note.locked {
    cursor: not-allowed;
}

.stamp-image.locked,
.stamp-text.locked {
    cursor: not-allowed;
}

.show-all-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.show-all-btn:hover {
    background: #2980b9;
}

/* Tooltip bubble */
.tooltip-bubble {
    position: fixed;
    background: yellow;
    color: #2c2c2c;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Caveat', cursive;
    font-size: 26px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 250px;
    text-align: center;
}

.tooltip-bubble.show {
    opacity: 1;
    transform: scale(1);
}

.tooltip-bubble::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: yellow;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: #e8e8e8;
    border-right: 1px solid #2c2c2c;
    width: 50px;
    height: 100vh;
    cursor: pointer;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

.hamburger-menu .arrow {
    font-size: 20px;
    color: #2c2c2c;
    font-weight: bold;
}

.hamburger-menu .title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(270deg);
    font-size: 12px;
    color: #2c2c2c;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    font-family: 'Courier New', Courier, monospace;
}

/* Responsive Design */
@media (max-width: 1599px) {
    .hamburger-menu {
        display: flex;
    }

    .left-panel {
        position: fixed;
        background-color: #e8e8e8;
        top: 0;
        left: -500px;
        width: 500px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }

    .left-panel.open {
        left: 0;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .container {
        min-width: 100vw;
    }
}

.text-note.locked:focus {
    outline: none;
    border-color: #ccc;
    box-shadow: none;
}
