﻿/* ------------------------------
   BASE CALENDAR WRAPPER
------------------------------ */
.calendar {
    overflow: auto;
    direction: ltr;
    user-select: none;
    -webkit-user-select: none;
    margin: 0 auto;
    font-family: system-ui, sans-serif;
}

.calendar.calendar-rtl {
    direction: rtl;
}

.calendar.calendar-rtl table tr td span {
    float: right;
}

/* ------------------------------
   TABLE BASE
------------------------------ */
.calendar table {
    margin: auto;
    border-collapse: collapse;
}

.calendar table td,
.calendar table th {
    text-align: center;
    width: 35px;
    height: 30px;
    border: 1px solid #ddd;
    padding: 4px 5px;
    font-size: 15px;
}

/* ------------------------------
   YEAR HEADER
------------------------------ */
.calendar .year-title {
    font-weight: 700;
    text-align: center;
    height: 20px;
}

.calendar .year-neighbor {
    color: #aaa;
}

.calendar .year-neighbor2,
.calendar table.month tr td.disabled,
.calendar table.month tr td.disabled:hover {
    color: #ddd;
}

/* ------------------------------
   MONTHS LAYOUT
------------------------------ */
.calendar .months-container {
    width: 100%;
    display: none;
}

.calendar .month-container {
    min-width: 200px;
    text-align: center;
    height: 260px;
    padding: 0;
    margin-bottom: 15px;
}

/* ------------------------------
   MONTH HEADER
------------------------------ */
.calendar table.month th.month-title {
    font-size: 18px;
    padding: 3px 0 4px;
    color: white;
    background-color: #064685;
}

/* Sunday / Saturday colors */
table.month td:last-child,
table.month thead tr:nth-child(2) th:last-child {
    color: #f00000;
}

table.month thead tr:nth-child(2) th:nth-last-child(2) {
    color: #053e76;
}

table.month thead tr:nth-child(2) th:nth-last-child(8) {
    color: #8A8A8A;
}

/* ------------------------------
   DAY STYLES
------------------------------ */
.event-name {
    font-size: 16px;
}

.day-today {
    border-left: 4px solid red;
    border-right: 4px solid red;
    border-bottom: none;
    box-shadow: inset 0 4px 0 red;
}

.day-sunday {
    color: #f00000 !important;
}

.day-saturday {
    color: #064685 !important;
}

.calendar table.month th.day-header,
.calendar table.month th.day-header-ne {
    font-size: 15px;
    background-color: #b2d8fd;
}

.calendar table.month tr td,
.calendar table.month tr th {
    padding: 0;
}

/* Week numbers */
.calendar table.month td.week-number {
    cursor: default;
    font-weight: 250;
    border-right: 1px solid #b2d8fd;
    padding: 5px;
    color: #8A8A8A;
}

/* Rounded edges */
.calendar .round-left {
    border-radius: 8px 0 0 8px;
}

.calendar .round-right {
    border-radius: 0 8px 8px 0;
}

/* Day content */
.calendar table.month tr td .day-content {
    border-radius: 4px;
    padding: 5px 6px;
    transition: background 0.15s ease;
}

.calendar table.month td.day .day-content:hover {
    background: rgba(0,0,0,.1);
    cursor: pointer;
}

.calendar table.month td.day.disabled .day-content:hover,
.calendar table.month tr td.new,
.calendar table.month tr td.old {
    background: none;
    cursor: default;
}

/* Range selection */
.calendar table.month tr td.range .day-content {
    background: rgba(0,0,0,.2);
    border-radius: 0;
}

.calendar table.month tr td.range.range-start .day-content {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.calendar table.month tr td.range.range-end .day-content {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* ------------------------------
   CONTEXT MENU
------------------------------ */
.calendar-context-menu,
.calendar-context-menu .submenu {
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,.2);
    position: absolute;
    display: none;
    border-radius: 6px;
}

.calendar-context-menu .item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-context-menu .item:hover {
    background: #eee;
}

.calendar-context-menu .submenu {
    left: 100%;
    margin-top: -6px;
}

.calendar-context-menu .item:hover > .submenu {
    display: block;
}

/* ------------------------------
   DROPDOWN
------------------------------ */
.gdropdown {
    position: relative;
    display: inline-block;
    border-radius: 5px;
    padding: 5px;
}

.gdropbtn {
    background-color: #fff;
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.gdropdown-content {
    display: none;
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 0;
    margin-top: 1px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 110px;
}

.gdropdown-content a {
    display: block;
    padding: 7px;
    text-decoration: underline;
}

.gdropdown-content a:hover {
    text-decoration: none;
    background-color: #e6f2ff;
}

.gdropdown:hover .gdropdown-content {
    display: block;
}

/* ------------------------------
   RESPONSIVE
------------------------------ */
@media (max-width: 969px) {
    .calendar table {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .calendar table.month th.month-title {
        font-size: 20px;
        padding: 3px 0 6px;
    }
}
