/* Calendar Page Specific Styles */

/* Calendar Controls */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
}

/* Button Styles */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(94, 0, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(94, 0, 255, 0.3);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--bg-card);
    color: #EF4444;
    border: 1px solid #EF4444;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #EF4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.nav-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--purple);
    color: var(--purple);
}

#currentMonth {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-card);
    border-radius: 10px;
}

.view-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Calendar Section */
.calendar-section {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.calendar-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1rem;
}

.calendar-day-name {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--bg-card);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.calendar-day:hover {
    background: var(--bg-secondary);
    transform: scale(1.02);
    z-index: 10;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
}

.calendar-day.today .day-number {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.selected {
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.15), rgba(0, 134, 255, 0.15));
    border: 2px solid var(--purple);
}

.day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.mini-event {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
    color: var(--purple);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    max-width: 100%;
}

.mini-event:hover {
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.15), rgba(0, 134, 255, 0.15));
}

.mini-event.callback {
    background: linear-gradient(135deg, rgba(0, 134, 255, 0.1), rgba(0, 134, 255, 0.2));
    color: var(--blue);
}

.mini-event.emergency {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
    color: var(--danger);
}

.mini-event.consultation {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
    color: var(--success);
}

.mini-event.more-count {
    background: var(--bg-secondary);
    color: var(--purple);
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    border: 1px solid var(--border);
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    transition: all 0.2s ease;
}

.mini-event.more-count:hover {
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.15), rgba(0, 134, 255, 0.15));
    color: var(--purple);
    border-color: var(--purple);
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(94, 0, 255, 0.2);
}

/* Upcoming Events Sidebar */
.upcoming-events {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.events-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.filter-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.filter-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--purple);
    color: var(--purple);
}

.view-toggle-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(94, 0, 255, 0.3);
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--purple);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.event-item.callback {
    border-left-color: var(--blue);
}

.event-item.emergency {
    border-left-color: var(--danger);
}

.event-item.consultation {
    border-left-color: var(--success);
}

.event-item.other {
    border-left-color: var(--text-tertiary);
}

.event-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.event-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.event-time-slot {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--purple);
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.event-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.125rem;
}

.event-notes {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.event-actions {
    display: flex;
    align-items: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-card);
    border-color: var(--purple);
    color: var(--purple);
}

.event-type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, rgba(94, 0, 255, 0.1), rgba(0, 134, 255, 0.1));
    color: var(--purple);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.empty-state .text-secondary {
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--purple);
    background: var(--bg-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Event Detail Modal */
.event-detail-section {
    margin-bottom: 2rem;
}

.event-detail-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.event-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.event-detail-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.event-detail-row .event-detail-item {
    margin-bottom: 0;
}

.event-detail-item svg {
    color: var(--purple);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

#viewEventType {
    display: inline-block;
}

/* Responsive */
@media (max-width: 1200px) {
    .calendar-section {
        grid-template-columns: 1fr;
    }

    .upcoming-events {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    #currentMonth {
        min-width: auto;
    }

    .calendar-day {
        padding: 0.5rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .mini-event {
        font-size: 0.5rem;
    }

    .modal-content {
        width: 95%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .event-detail-row {
        grid-template-columns: 1fr;
    }
}