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

body {
    font-family: "Caveat", cursive;
    background: linear-gradient(135deg, #fff 0%, #fbf7f0 50%, #f0e8dc 100%);
    /* background-attachment: fixed is broken on iOS Safari — use scroll there */
    background-attachment: scroll;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

@media screen and (min-width: 1024px) {
    body {
        min-height: 133.33vh;
        /* Compensate for zoom: 0.75 */
    }
}

/* Corkboard Background */
.corkboard-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #C4704A;
    background-image: url("https://www.transparenttextures.com/patterns/cork-1.png");
    /* Simple cork pattern if available, fallback */
    background-blend-mode: overlay;
    opacity: 0.1;
    /* Blend with gradient */
}


.nav-pin {
    font-family: "Kelly Slab", cursive;
    font-size: 16px;
    color: #7A3B1E;
    text-decoration: none;
    background: #fffacd;
    padding: 8px 16px;
    transform: rotate(-1deg);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 90, 43, 0.2);
    cursor: pointer;
}

.nav-pin:hover {
    transform: rotate(1deg) translateY(-2px);
    box-shadow: 3px 5px 12px rgba(0, 0, 0, 0.2);
}

.nav-pin.primary {
    background: #ffecb3;
    font-weight: bold;
    font-size: 18px;
    transform: rotate(2deg);
}

.page-title {
    font-family: "Neucha", cursive;
    font-size: 48px;
    color: #5C2A0E;
    text-align: center;
    transform: rotate(-2deg);
}

/* Board */
.board-container {
    padding: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    /* Pushes footer down */
    width: 100%;
}

/* Sticky Notes */
.sticky-note {
    width: 250px;
    height: 250px;
    padding: 25px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, z-index 0s;
    position: relative;
    cursor: grab;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 20px;
    line-height: 1.4;
    color: #333;
    /* Default rotation handled by JS */
}

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

.sticky-note.yellow {
    background-color: #fff740;
}

.sticky-note.pink {
    background-color: #ff7eb9;
}

.sticky-note.green {
    background-color: #7afcff;
}

.sticky-note.blue {
    background-color: #aeebff;
}

/* Note Pin */
.pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #C4704A, #9E4F2E);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.note-content {
    flex-grow: 1;
    overflow: hidden;
    font-weight: 500;
}

.note-author {
    font-family: "Kelly Slab", serif;
    font-size: 0.9em;
    text-align: right;
    margin-top: 10px;
    color: #555;
}

/* Admin Delete Button */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    color: #6B7C45;
    /* Red */
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: none;
    /* Hidden by default */
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Auth check - show delete buttons if authenticated */
body.admin-mode .delete-btn {
    display: block;
}


.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 40px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: var(--font-body);
}

/* Close modal button (×) */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

input,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus {
    border-color: #C4704A;
    outline: 2px solid #C4704A;
    outline-offset: 0;
    box-shadow: 0 0 0 4px rgba(196, 112, 74, 0.15);
}

/* Color Picker */
.colors {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

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

.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #C4704A;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #9E4F2E;
}

/* Footer Trigger */
.guestbook-footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.admin-trigger {
    /* Reset browser button defaults (changed from div to button element) */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #000;
    font-size: 18px;
    transition: transform 0.3s;
    margin-top: 20px;
}

.admin-trigger:hover {
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 600px) {
    .board-container {
        padding: 20px;
        gap: 20px;
    }

    .sticky-note {
        width: 100%;
        height: auto;
        min-height: 200px;
    }

    .page-title {
        font-size: 32px;
    }
}