/* Calendar Styles */
.calendar-container {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--theme-color);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.calendar-header > *:not(.calendar-view-toggle) {
    margin-right: 0.5rem;
}

#currentMonthYear {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
    flex-grow: 1;
    text-shadow: 0 0 8px rgba(var(--rgb-theme-color), 0.5);
}

.calendar-view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 3px;
    margin-left: auto;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--theme-color);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.view-toggle-btn.active {
    background: rgba(var(--rgb-theme-color), 0.2);
    box-shadow: 0 0 8px rgba(var(--rgb-theme-color), 0.3);
}

.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: rgba(var(--rgb-theme-color), 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Specific styles for shared calendar navigation buttons */
#sharedCalendarViewModal .prev-month-btn,
#sharedCalendarViewModal .next-month-btn {
    background: transparent;
    border: 1px solid rgba(var(--rgb-theme-color));
    color: var(--theme-color);
    width: 36px !important; /* Force width with !important */
    height: 36px !important; /* Force height with !important */
    min-width: 36px !important; /* Prevent expansion */
    max-width: 36px !important; /* Prevent expansion */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0; /* Remove any padding */
    margin: 0 10px; /* Add margin instead */
    overflow: hidden; /* Prevent content from expanding the button */
    flex: 0 0 36px; /* Don't allow flexbox to resize */
}

/* Shared calendar date selector layout fix */
#sharedCalendarViewModal .shared-calendar-date-selector {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Shared calendar month label */
#sharedCalendarViewModal .shared-calendar-month {
    flex: 0 0 auto;
    text-align: center;
    min-width: 150px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

.weekday-header {
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--theme-color);
    opacity: 0.85;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--rgb-theme-color), 0.3);
}

.calendar-days-container {
    display: contents;
}

.calendar-day {
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(var(--rgb-theme-color), 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 5px;
}

.calendar-day:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
    border-color: var(--theme-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.calendar-day.selected {
    background: rgba(var(--rgb-theme-color), 0.15);
    border-color: var(--theme-color);
    box-shadow: 0 0 12px rgba(var(--rgb-theme-color), 0.5);
    transform: translateY(-3px) scale(1.02);
}

.calendar-day.today {
    border: 2px solid var(--theme-color);
    box-shadow: 0 0 10px rgba(var(--rgb-theme-color), 0.4);
}

.calendar-day.outside-month {
    opacity: 0.4;
    background: rgba(0, 0, 0, 0.2);
}

.day-number {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    color: var(--theme-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.today .day-number {
    background: var(--theme-color);
    color: #000;
}

.calendar-day:hover .day-number {
    background: rgba(var(--rgb-theme-color), 0.2);
}

.day-events {
    margin-top: 25px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    max-height: calc(100% - 30px);
}

.day-event-dot {
    height: 4px;
    border-radius: 2px;
    margin: 0 5px;
    opacity: 0.8;
}

.day-event-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
    color: var(--theme-color);
}

/* Event form styling */
.calendar-event-section {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
}

#selectedDateHeader {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--theme-color);
}

.event-form {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
}

.event-title-input {
    width: 100%;
    padding: 0.8rem;
    background-color: rgba(var(--rgb-theme-color), 0.1);
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
    color: var(--theme-color);
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.event-title-input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 10px rgba(var(--rgb-theme-color), 0.3);
}

.event-form-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.event-type-selector {
    display: flex;
    gap: 1rem;
}

.event-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.event-type-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--theme-color);
    border-radius: 50%;
    margin-right: 0;
    position: relative;
    cursor: pointer;
    background: transparent;
}

.event-type-option input[type="radio"]:checked {
    border-width: 2px;
    box-shadow: 0 0 5px rgba(var(--rgb-theme-color), 0.5);
}

.event-type-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--theme-color);
    animation: pulse 0.6s ease-out;
}

.event-type-label {
    color: var(--theme-color);
    font-size: 0.9rem;
}

.event-time-container {
    flex-grow: 1;
    text-align: right;
}

.event-time-input {
    padding: 0.5rem;
    background-color: rgba(var(--rgb-theme-color), 0.1);
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
    color: var(--theme-color);
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
}

.event-time-input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 8px rgba(var(--rgb-theme-color), 0.3);
}

.event-description-input {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    background-color: rgba(var(--rgb-theme-color), 0.1);
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
    color: var(--theme-color);
    border-radius: 5px;
    outline: none;
    resize: vertical;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.event-description-input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 10px rgba(var(--rgb-theme-color), 0.3);
}

.event-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.event-priority {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-color);
}

.priority-options {
    display: flex;
    gap: 0.8rem;
}

.priority-option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: var(--theme-color);
}

.priority-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 0;
    height: 0;
    position: absolute;
    opacity: 0;
}

.priority-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.priority-dot.low {
    background-color: #4CAF50;
}

.priority-dot.medium {
    background-color: #FFC107;
}

.priority-dot.high {
    background-color: #F44336;
}

.priority-option input[type="radio"]:checked + .priority-dot {
    transform: scale(1.2);
    box-shadow: 0 0 5px currentColor;
}

/* Events List */
.events-list-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid rgba(var(--rgb-theme-color), 0.2);
    margin-top: 2rem;
}

.events-list-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--theme-color);
    font-size: 1.1rem;
    opacity: 0.9;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.event-item {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border-left: 3px solid;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
}

.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.event-item.goal {
    border-left-color: #4CAF50;
}

.event-item.event {
    border-left-color: #2196F3;
}

.event-item.reminder {
    border-left-color: #FF9800;
}

.event-item.low {
    border-left-color: #4CAF50;
}

.event-item.medium {
    border-left-color: #FFC107;
}

.event-item.high {
    border-left-color: #F44336;
}

.event-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1px solid var(--theme-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    background: rgba(var(--rgb-theme-color), 0.1);
    margin-top: 2px;
}

.event-checkbox.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--theme-color);
}

.event-details {
    flex: 1;
}

.event-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--theme-color);
}

.event-item.completed .event-title {
    text-decoration: line-through;
    opacity: 0.7;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--theme-color);
    opacity: 0.8;
}

.event-time-badge {
    background: rgba(var(--rgb-theme-color), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.event-type-badge {
    background: rgba(var(--rgb-theme-color), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-transform: capitalize;
}

.event-description {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--theme-color);
    opacity: 0.9;
}

.event-actions-btn {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
    border-radius: 20px;
}

.event-action-btn {
    background: transparent;
    border: none;
    color: var(--theme-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.event-action-btn:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
    opacity: 1;
}

.event-action-btn.delete {
    color: #F44336;
}

.event-action-btn.edit {
    color: #FFC107;
}

.no-events-message {
    text-align: center;
    padding: 2rem;
    color: var(--theme-color);
    opacity: 0.8;
}

.small-text {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Full Calendar View Styles */
.calendar-full-view {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.full-calendar-grid {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(var(--rgb-theme-color), 0.2);
}

.full-calendar-header {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid rgba(var(--rgb-theme-color), 0.2);
    margin-bottom: 15px;
}

.full-calendar-day-col {
    flex: 1;
    text-align: center;
    font-weight: bold;
    color: var(--theme-color);
}

.full-calendar-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.full-calendar-week {
    display: flex;
    min-height: 150px;
    border-bottom: 1px solid rgba(var(--rgb-theme-color), 0.1);
    padding-bottom: 5px;
}

.full-calendar-week:last-child {
    border-bottom: none;
}

.full-calendar-day-cell {
    flex: 1;
    padding: 10px;
    border-right: 1px solid rgba(var(--rgb-theme-color), 0.1);
    position: relative;
    min-height: 150px;
    transition: all 0.3s ease;
}

.full-calendar-day-cell:last-child {
    border-right: none;
}

.full-calendar-day-cell:hover {
    background: rgba(var(--rgb-theme-color), 0.05);
}

.full-calendar-day-cell.outside-month {
    opacity: 0.4;
    background: rgba(0, 0, 0, 0.2);
}

.full-calendar-day-cell.today {
    border: 1px solid var(--theme-color);
    box-shadow: 0 0 10px rgba(var(--rgb-theme-color), 0.2);
}

.full-calendar-day-cell.selected {
    background: rgba(var(--rgb-theme-color), 0.1);
    box-shadow: 0 0 15px rgba(var(--rgb-theme-color), 0.3);
}

.full-day-number {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--theme-color);
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.full-calendar-day-cell.today .full-day-number {
    background: var(--theme-color);
    color: #000;
}

.full-calendar-events {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: calc(100% - 35px);
    overflow-y: auto;
}

.full-calendar-event {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.85rem;
    margin-bottom: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid;
    display: flex;
    align-items: center;
    gap: 5px;
}

.full-calendar-event:hover {
    background: rgba(var(--rgb-theme-color), 0.2);
    transform: translateY(-2px);
}

.full-calendar-event.goal {
    border-left-color: #4CAF50;
}

.full-calendar-event.event {
    border-left-color: #2196F3;
}

.full-calendar-event.reminder {
    border-left-color: #FF9800;
}

.full-calendar-event.low {
    border-left-color: #4CAF50;
}

.full-calendar-event.medium {
    border-left-color: #FFC107;
}

.full-calendar-event.high {
    border-left-color: #F44336;
}

.full-event-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-right: 3px;
}

.full-event-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--theme-color);
}

.month-view-toggle {
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Calendar sharing styles */
.share-calendar-btn {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.share-calendar-btn:hover {
    background: rgba(var(--rgb-theme-color), 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 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.7);
}

.modal-content {
    background: rgba(0, 0, 0, 0.8);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--theme-color);
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(var(--rgb-theme-color), 0.4);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    color: var(--theme-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    opacity: 0.7;
}

.search-container {
    margin: 15px 0;
}

.search-container input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: var(--theme-color);
}

.friends-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.friend-item:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
}

.friend-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: bold;
    color: var(--theme-color);
}

.friend-username {
    font-size: 0.8rem;
    opacity: 0.7;
}

.friend-share-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.currently-shared-list {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    max-height: 150px;
    overflow-y: auto;
}

.shared-friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: rgba(var(--rgb-theme-color), 0.1);
}

.shared-friend-info {
    display: flex;
    align-items: center;
}

.shared-friend-info img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.remove-share-btn {
    background: transparent;
    border: none;
    color: #F44336;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 5px;
    border-radius: 3px;
}

.remove-share-btn:hover {
    background: rgba(244, 67, 54, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
}

.btn-secondary:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
}

/* Shared Calendars section */
.shared-calendars-section {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--theme-color);
}

.shared-calendars-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 1rem;
}

.shared-calendar-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 15px;
    width: calc(50% - 10px);
    border: 1px solid rgba(var(--rgb-theme-color), 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.shared-calendar-card:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.shared-calendar-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.shared-calendar-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.shared-calendar-info {
    flex: 1;
}

.shared-calendar-name {
    font-weight: bold;
    color: var(--theme-color);
}

.shared-calendar-username {
    font-size: 0.8rem;
    opacity: 0.7;
    color: var(--theme-color);
}

.shared-calendar-preview {
    margin-top: 10px;
    font-size: 0.9rem;
}

.shared-calendar-count {
    display: inline-block;
    background: rgba(var(--rgb-theme-color), 0.2);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--theme-color);
}

/* Shared Calendar Modal Styles */
.shared-calendar-modal {
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.shared-calendar-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shared-calendar-date-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.shared-calendar-month {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    color: var(--theme-color);
}

.shared-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.shared-calendar-weekday {
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--theme-color);
    opacity: 0.85;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--rgb-theme-color), 0.3);
}

.shared-calendar-day {
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(var(--rgb-theme-color), 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 5px;
}

.shared-calendar-day:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
    border-color: var(--theme-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.shared-calendar-day.selected {
    background: rgba(var(--rgb-theme-color), 0.15);
    border-color: var(--theme-color);
    box-shadow: 0 0 12px rgba(var(--rgb-theme-color), 0.5);
    transform: translateY(-3px) scale(1.02);
}

.shared-calendar-day.today {
    border: 2px solid var(--theme-color);
    box-shadow: 0 0 10px rgba(var(--rgb-theme-color), 0.4);
}

.shared-calendar-day.outside-month {
    opacity: 0.4;
    background: rgba(0, 0, 0, 0.2);
}

.shared-calendar-day .day-number {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    color: var(--theme-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.shared-calendar-day.today .day-number {
    background: var(--theme-color);
    color: #000;
}

.shared-calendar-day .day-events {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    max-height: calc(100% - 30px);
}

.shared-calendar-day .day-event-dot {
    height: 4px;
    width: 40%;
    margin: 0 auto;
    border-radius: 2px;
    opacity: 0.8;
}

.shared-calendar-day .day-event-dot.more-dot {
    background-color: var(--theme-color) !important;
    height: 16px;
    width: 16px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 2px;
}

.shared-calendar-events {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid rgba(var(--rgb-theme-color), 0.2);
}

.shared-calendar-events h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--theme-color);
    font-size: 1.1rem;
}

.shared-calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.shared-event-item {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border-left: 3px solid;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
}

.shared-event-item:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
}

.shared-event-item.goal {
    border-left-color: #4CAF50;
}

.shared-event-item.event {
    border-left-color: #2196F3;
}

.shared-event-item.reminder {
    border-left-color: #FF9800;
}

.shared-event-item.low {
    border-left-color: #4CAF50;
}

.shared-event-item.medium {
    border-left-color: #FFC107;
}

.shared-event-item.high {
    border-left-color: #F44336;
}

.shared-event-status {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1px solid var(--theme-color);
    border-radius: 50%;
    position: relative;
    background: rgba(var(--rgb-theme-color), 0.1);
    margin-top: 2px;
}

.shared-event-status.completed::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--theme-color);
}

.shared-event-details {
    flex: 1;
}

.shared-event-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--theme-color);
}

.shared-event-item.completed .shared-event-title {
    text-decoration: line-through;
    opacity: 0.7;
}

.shared-event-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--theme-color);
    opacity: 0.8;
}

.shared-event-time {
    background: rgba(var(--rgb-theme-color), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.shared-event-type {
    background: rgba(var(--rgb-theme-color), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-transform: capitalize;
}

.shared-event-description {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--theme-color);
    opacity: 0.9;
}

.no-events-message {
    text-align: center;
    padding: 1rem;
    color: var(--theme-color);
    opacity: 0.7;
}

/* Animation keyframes */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Empty state for no shared calendars */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--theme-color);
    opacity: 0.8;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Highlight animation for events */
.highlight-animation {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(var(--rgb-theme-color), 0.4);
    }
    100% {
        background-color: rgba(0, 0, 0, 0.6);
    }
}

/* Responsive styles */
@media (max-width: 992px) {
    .calendar-view-toggle {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        order: 3;
    }
    
    .calendar-header {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
    }
    
    .calendar-day {
        height: 60px;
    }
    
    .day-number {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
    
    .day-events {
        margin-top: 20px;
    }
    
    .event-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .event-time-container {
        width: 100%;
        text-align: left;
    }
    
    .event-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #addEventBtn {
        width: 100%;
        border-radius: 20px;
    }
    
    .full-calendar-week {
        min-height: 120px;
    }
    
    .full-calendar-day-cell {
        min-height: 120px;
        padding: 8px 5px;
    }
    
    .full-day-number {
        width: 22px;
        height: 22px;
        font-size: 0.85rem;
    }
    
    .full-calendar-events {
        margin-top: 25px;
    }
    
    .full-calendar-event {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .shared-calendar-card {
        width: 100%;
    }
    
    .shared-calendar-modal {
        width: 95%;
    }
    
    .shared-calendar-day {
        height: 60px;
    }
    
    .shared-calendar-day .day-events {
        margin-top: 22px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        height: 50px;
    }
    
    .weekday-header {
        font-size: 0.8rem;
    }
    
    .day-number {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .day-events {
        display: none;
    }
    
    .calendar-header {
        margin-bottom: 1rem;
    }
    
    #currentMonthYear {
        font-size: 1.2rem;
    }
    
    .event-type-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .shared-calendar-month {
        font-size: 1.2rem;
    }
    
    .shared-calendar-day {
        height: 50px;
    }
    
    .shared-calendar-day .day-events {
        display: none;
    }
}

/* Year Navigation Container */
.year-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Year Navigation Buttons */
#prevYear,
#nextYear {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
    width: 40px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

#prevYear:hover,
#nextYear:hover {
    background: rgba(var(--rgb-theme-color), 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--rgb-theme-color), 0.3);
}

/* If you want to use the nav-btn class as well */
.nav-btn {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
    width: 40px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(var(--rgb-theme-color), 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--rgb-theme-color), 0.3);
}

/* ─── LIGHT THEME ──────────────────────────────────────────── */
body.light-theme .calendar-container,
body.light-theme .calendar-event-section,
body.light-theme .shared-calendars-section {
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.17), 0 2px 8px rgba(0, 0, 0, 0.10);
    border: 1.5px solid rgba(var(--rgb-theme-color), 0.65);
}

body.light-theme .calendar-view-toggle {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .calendar-day,
body.light-theme .shared-calendar-day {
    background: #f5f6fa;
    border-color: rgba(var(--rgb-theme-color), 0.45);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.light-theme .calendar-day:hover,
body.light-theme .shared-calendar-day:hover {
    background: rgba(var(--rgb-theme-color), 0.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15), 0 2px 5px rgba(0, 0, 0, 0.08);
}

body.light-theme .calendar-day.outside-month,
body.light-theme .shared-calendar-day.outside-month,
body.light-theme .full-calendar-day-cell.outside-month {
    background: #eceef4;
}

body.light-theme .day-number,
body.light-theme .full-day-number,
body.light-theme .shared-calendar-day .day-number {
    background: rgba(0, 0, 0, 0.07);
    color: #1a1a2e;
}

body.light-theme .event-form {
    background: #f5f6fa;
    border-color: rgba(var(--rgb-theme-color), 0.2);
}

body.light-theme .event-title-input,
body.light-theme .event-description-input,
body.light-theme .event-time-input {
    background: #ffffff;
    color: #1a1a2e;
    border-color: rgba(var(--rgb-theme-color), 0.3);
}

body.light-theme .event-title-input::placeholder,
body.light-theme .event-description-input::placeholder {
    color: #8888a8;
}

body.light-theme .events-list-container,
body.light-theme .shared-calendar-events {
    background: #f5f6fa;
    border-color: rgba(var(--rgb-theme-color), 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.07);
}

body.light-theme .event-item,
body.light-theme .shared-event-item {
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13), 0 1px 4px rgba(0, 0, 0, 0.07);
    color: #1a1a2e;
}

body.light-theme .event-item:hover,
body.light-theme .shared-event-item:hover {
    background: rgba(var(--rgb-theme-color), 0.06);
    box-shadow: 0 7px 24px rgba(0, 0, 0, 0.16), 0 3px 7px rgba(0, 0, 0, 0.09);
}

body.light-theme .full-calendar-grid {
    background: #ffffff;
    border: 1.5px solid rgba(var(--rgb-theme-color), 0.60);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.09);
}

body.light-theme .full-calendar-event {
    background: #f5f6fa;
    color: #1a1a2e;
}

body.light-theme .full-calendar-event:hover {
    background: rgba(var(--rgb-theme-color), 0.1);
}

/* Calendar modal */
body.light-theme .modal-content {
    background: #ffffff;
    color: #1a1a2e;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(var(--rgb-theme-color), 0.68);
}

body.light-theme .search-container input {
    background: #f5f5ff;
    color: #1a1a2e;
    border-color: rgba(var(--rgb-theme-color), 0.3);
}

body.light-theme .friends-list,
body.light-theme .currently-shared-list {
    background: #f5f6fa;
}

body.light-theme .friend-item {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .friend-item:hover {
    background: rgba(var(--rgb-theme-color), 0.07);
}

body.light-theme .friend-name {
    color: #1a1a2e;
}

body.light-theme .friend-username {
    color: #6666aa;
}

/* Shared calendar cards */
body.light-theme .shared-calendar-card {
    background: #ffffff;
    border: 1.5px solid rgba(var(--rgb-theme-color), 0.62);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.09);
}

body.light-theme .shared-calendar-card:hover {
    background: rgba(var(--rgb-theme-color), 0.05);
    box-shadow: 0 10px 32px rgba(var(--rgb-theme-color), 0.28), 0 3px 9px rgba(0, 0, 0, 0.11);
}

/* highlight animation for light mode */
body.light-theme .highlight-animation {
    animation: highlight-light 1s ease-in-out;
}

@keyframes highlight-light {
    0%   { background-color: rgba(var(--rgb-theme-color), 0.25); }
    100% { background-color: #ffffff; }
}