/* --- Root Variables and Basic Setup --- */
.main-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.public-title {
    text-align: center;
    color: #353272;
}

/* --- Event Form (Admin Only) --- */
.event-form-container {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.event-form-container h1 {
    margin-bottom: 5px;
}

.event-form-container p {
    margin-bottom: 20px;
    color: #6c757d;
}

.form-control {
    height: 40px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
}

#add-event-form button {
    padding: 12px 25px;
    background-color: #4a47a3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 11px 0;
    width: auto;
}

#add-event-form button:hover {
    background-color: #353272;
}

/* --- Calendar --- */
.calendar-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.month-year {
    font-size: 1.75rem;
    font-weight: 600;
}

.nav-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.nav-btn:hover {
    background-color: #f1f3f5;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.day {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    min-height: 120px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.day:nth-child(7n) {
    border-right: none;
}

.day:hover {
    background-color: #f8f9fa;
}

.day-number {
    font-weight: 600;
}

.other-month .day-number {
    color: #ced4da;
}

.today .day-number {
    background-color: #4a47a3;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Events in Calendar --- */
.event {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(0, 0, 0, 0.1)
}

.event.blue {
    background-color: #e6f5ff;
    color: #005a9e;
}

.event.green {
    background-color: #e3f3d9;
    color: #2b641e;
}

.event.pink {
    background-color: #fee2ea;
    color: #9c27b0;
}

.event.yellow {
    background-color: #fff8e0;
    color: #7d5a00;
}

/* NEW: Style for the event title when the whole day is colored */
.full-day-event-title {
    font-weight: bold;
    margin-top: 8px;
    font-size: 0.9rem;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover, .close-btn:focus {
    color: black;
    text-decoration: none;
}

.modal-body {
    padding-top: 15px;
}

.modal-event {
    position: relative;
    margin-bottom: 10px;
    padding: 10px 30px 10px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.delete-event-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: bold;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s;
}

.delete-event-btn:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #add-event-form {
        flex-direction: column;
        align-items: stretch;
    }

    .day {
        min-height: 90px;
    }

    .event {
        font-size: 0.7rem;
    }
}