/* --- NEW: Import a modern font from Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Basic Setup */
body {
    /* Use the new font */
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow: hidden;
    background-color: #333;
    background-image: url('https://www.transparenttextures.com/patterns/cork-wallet.png');
}

#notes-canvas {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* --- NEW: Styles for the Site Header --- */
.site-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 1; /* Puts the header behind the notes */
    pointer-events: none; /* Allows you to click "through" the header */
}

.site-header h1 {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.site-header p {
    font-size: 1rem;
    margin-top: 5px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
}


/* Floating Action Button (the plus icon) */
#add-note-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #6e8efb, #a777e3);
    color: white;
    font-size: 2.5rem;
    line-height: 55px;
    text-align: center;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

#add-note-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* --- IMPROVED: Modal Styles --- */
.hidden {
    display: none !important;
}

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; /* Start hidden for animation */
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-30px); /* Start from above for animation */
    animation: slideIn 0.4s 0.1s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.close-btn:hover {
    color: #333;
    transform: rotate(90deg);
}

#shout-form h3 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

/* --- IMPROVED: Textarea and Button Styles --- */
textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 100px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #6e8efb;
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.3);
}

button[type="submit"] {
    width: 100%;
    background: linear-gradient(45deg, #6e8efb, #a777e3);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[type="submit"]:hover {
    box-shadow: 0 5px 15px rgba(110, 142, 251, 0.4);
    transform: translateY(-2px);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: none;
}


/* --- Note styling updated for timestamp --- */
.note {
    position: absolute;
    width: 200px;
    height: 200px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    font-size: 1.1rem;
    font-family: 'Georgia', serif; /* Keep the classic font for notes */
    word-wrap: break-word;
    cursor: grab;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    /* --- MODIFIED: Added these three lines for positioning --- */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.note:hover {
    transform: scale(1.05) !important; /* Use important to override dragging transform */
}

.note.dragging {
    cursor: grabbing;
    transition: none;
}

.note p { margin: 0; }

/* --- Style for the timestamp text --- */
.note small {
    font-size: 0.75rem;
    color: #555;
    text-align: right;
    font-family: 'Poppins', sans-serif; /* Use the modern font for the date */
}


/* --- Keyframe animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* --- Color picker styles --- */
.color-picker {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

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

.color-swatch.selected {
    border-color: #4a90e2;
    transform: scale(1.1);
}