/* Basic Setup & Background */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #1a1a2e;
    background-size: cover;
    background-position: center;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.5s ease;
}

body.authenticated {
    background-image: url('images/background.jpg');
    background-color: transparent;
}

/* Screen container to center content */
.screen {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The main content box from the images */
.container {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* ======== Login Screen Styles ======== */
.login-container {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 360px;
}

.login-container h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 5px;
}

.login-container p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
    margin-bottom: 20px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-form input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px;
}

#login-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#login-form input:focus {
    outline: none;
    border-color: #e83e8c;
}

.login-error {
    color: #ff6b9d;
    font-size: 0.85em;
    margin: 0;
}

/* Typography */
h1, h2 {
    color: #e83e8c; /* A nice pink color */
    margin-bottom: 20px;
}

p {
    margin-bottom: 25px;
    font-size: 1.1em;
}

.small-text {
    font-size: 0.9em;
    color: #555;
}

/* Form Styling */
#grievance-form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* space between form elements */
}

input, textarea, select {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-family: 'Nunito', sans-serif;
    font-size: 1em;
    background-color: rgba(255, 255, 255, 0.8);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

label {
    text-align: left;
    font-weight: bold;
    color: #555;
    margin-top: 10px;
    margin-bottom: -10px; /* pull the select box closer */
}

/* Button Styling */
button {
    padding: 15px 20px;
    border: none;
    background-color: #e83e8c;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #d1307b;
}

.days-text {
    font-weight: bold;
    color: #5d429a; /* A nice deep purple, change as you wish */
    font-size: 1.2em; /* Make it slightly bigger */
    margin-top: -10px; /* Adjust spacing if needed */
}

/* ======== Music Wall Styles ======== */

/* Wider container for music wall to accommodate embeds */
.music-wall-container {
    max-width: 600px;
}

/* Back button */
.back-btn {
    align-self: flex-start;
    background: transparent;
    color: #5d429a;
    font-size: 0.9em;
    padding: 5px 10px;
    margin-bottom: 10px;
}

.back-btn:hover {
    background-color: rgba(93, 66, 154, 0.1);
    color: #5d429a;
}

/* Secondary button style (Music Wall button on welcome screen) */
.btn-secondary {
    background-color: #5d429a;
    margin-top: 10px;
}

.btn-secondary:hover {
    background-color: #4a3580;
}

/* Add Song Form */
.add-song-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.add-song-row {
    display: flex;
    gap: 10px;
}

.add-song-row input {
    flex: 1;
}

.add-song-btn {
    padding: 12px 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Error message */
.song-error {
    color: #e83e8c;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Songs Grid */
.songs-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.songs-grid::-webkit-scrollbar {
    width: 6px;
}

.songs-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.songs-grid::-webkit-scrollbar-thumb {
    background: rgba(232, 62, 140, 0.4);
    border-radius: 3px;
}

/* Individual Song Card */
.song-card {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.song-card iframe {
    border-radius: 10px;
    width: 100%;
}

.song-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8em;
    color: #5d429a;
}

.song-note {
    font-style: italic;
    color: #555;
    font-size: 0.85em;
    margin-top: 6px;
    text-align: left;
}

/* Loading state */
.loading-songs {
    text-align: center;
    padding: 20px;
    color: #5d429a;
}

/* ======== Love Notes / Messages Screen Styles ======== */

.messages-container {
    max-width: 600px;
}

.messages-error {
    color: #e83e8c;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Category Selection Area */
.categories-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.category-btn {
    padding: 14px 20px;
    border: 1px solid rgba(93, 66, 154, 0.2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(232, 62, 140, 0.15), rgba(93, 66, 154, 0.15));
    color: #5d429a;
    font-family: 'Nunito', sans-serif;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    animation: fadeInUp 0.3s ease-out both;
}

.category-btn:hover {
    background: linear-gradient(135deg, rgba(232, 62, 140, 0.3), rgba(93, 66, 154, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(93, 66, 154, 0.2);
    color: #5d429a;
}

.category-btn:active {
    transform: translateY(0);
}

/* Message Display Area */
.message-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.message-card {
    background: linear-gradient(135deg, rgba(232, 62, 140, 0.1), rgba(93, 66, 154, 0.1));
    border: 1px solid rgba(232, 62, 140, 0.2);
    border-radius: 16px;
    padding: 25px 20px;
    width: 100%;
    animation: messageReveal 0.5s ease-out;
}

.message-category-label {
    font-size: 0.8em;
    color: #5d429a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.message-text {
    font-size: 1.25em;
    color: #333;
    line-height: 1.6;
    margin-bottom: 0;
    white-space: pre-line;
}

.message-display > button {
    width: 100%;
}

.pick-category-btn {
    margin-top: 0;
}

@keyframes messageReveal {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .music-wall-container,
    .messages-container {
        max-width: 100%;
    }

    .add-song-row {
        flex-direction: column;
    }

    .category-btn {
        min-width: 120px;
        flex: 1 1 calc(50% - 12px);
    }

    .message-text {
        font-size: 1.1em;
    }
}