/* Calendar Styles */

.ce-calendar-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: auto;
}

/* Calendar Navigation */
.ce-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.ce-calendar-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.ce-calendar-nav {
    display: flex;
    gap: 10px;
}

.ce-calendar-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ce-calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.ce-calendar-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Calendar Table */
.ce-calendar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ce-calendar thead {
    background: #f5f5f5;
}

.ce-calendar th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ce-calendar td {
    padding: 0;
    border: 1px solid #eee;
    height: 140px;
    vertical-align: top;
    position: relative;
    background: white;
    overflow: hidden;
}

.ce-calendar td.ce-other-month {
    background: #f9f9f9;
    color: #999;
}

.ce-day-content {
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ce-day-number {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.ce-day-events {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Event Item */
.ce-event-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ce-event-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
}

.ce-event-title {
    font-weight: 600;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

.ce-event-time {
    color: #666;
    font-size: 10px;
    display: block;
}

.ce-event-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: fit-content;
}

.ce-event-link {
    display: block;
    padding: 4px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: none;
}

.ce-event-link:hover {
    background: #667eea;
}

/* Loading State */
.ce-calendar-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.ce-calendar-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: ce-spin 1s linear infinite;
    z-index: 10;
}

@keyframes ce-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* LIST VIEW */
.ce-list-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ce-list-wrapper h2 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.ce-list-view {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ce-event-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.ce-event-row:last-child {
    border-bottom: none;
}

.ce-event-row {
    /* Hover effect removed */
}

.ce-event-date {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.ce-event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-event-info-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ce-event-info-time {
    color: #666;
    font-size: 13px;
}

.ce-event-info-category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
}

.ce-event-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ce-event-link-list {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.ce-event-link-list:hover {
    background: #5568d3;
}

.ce-no-events {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.ce-no-events p {
    margin: 0;
    font-size: 14px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .ce-calendar td {
        height: 120px;
    }

    .ce-calendar th {
        padding: 10px 6px;
        font-size: 12px;
    }

    .ce-event-item {
        font-size: 11px;
        padding: 5px;
    }

    .ce-event-title {
        font-size: 10px;
    }

    .ce-event-time {
        font-size: 9px;
    }

    .ce-event-tag {
        font-size: 8px;
        padding: 1px 4px;
    }
}

@media (max-width: 768px) {
    .ce-calendar-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .ce-calendar-header h2 {
        font-size: 20px;
    }

    .ce-calendar-nav {
        justify-content: center;
        width: 100%;
    }

    .ce-calendar th {
        padding: 8px 4px;
        font-size: 11px;
    }

    .ce-calendar td {
        height: 110px;
    }

    .ce-day-content {
        padding: 6px;
    }

    .ce-day-number {
        font-size: 12px;
    }

    .ce-event-item {
        font-size: 10px;
        padding: 4px;
    }

    .ce-event-title {
        font-size: 9px;
    }

    .ce-event-time {
        font-size: 8px;
    }

    /* List view responsive */
    .ce-event-row {
        grid-template-columns: 80px 1fr auto;
        padding: 12px;
        gap: 10px;
    }

    .ce-event-date {
        font-size: 12px;
    }

    .ce-event-info-title {
        font-size: 13px;
    }

    .ce-event-info-time {
        font-size: 12px;
    }

    .ce-event-link-list {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ce-calendar {
        font-size: 12px;
    }

    .ce-calendar th {
        padding: 6px 2px;
        font-size: 10px;
    }

    .ce-calendar td {
        height: 100px;
    }

    .ce-day-content {
        padding: 4px;
    }

    .ce-day-number {
        font-size: 11px;
        font-weight: bold;
    }

    .ce-event-item {
        font-size: 9px;
        padding: 3px;
    }

    .ce-event-link {
        font-size: 8px;
        padding: 1px 4px;
    }

    .ce-calendar-nav button {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* List view mobile */
    .ce-event-row {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 8px;
    }

    .ce-event-date {
        font-size: 11px;
    }

    .ce-event-info-title {
        font-size: 12px;
    }

    .ce-event-info-time {
        font-size: 11px;
    }

    .ce-event-actions {
        flex-direction: column;
        width: 100%;
    }

    .ce-event-link-list {
        width: 100%;
        text-align: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .ce-event-item,
    .ce-calendar-nav button,
    .ce-event-link,
    .ce-calendar-loader,
    .ce-event-row {
        animation: none;
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ce-calendar {
        background: #2d2d2d;
        border-color: #444;
    }

    .ce-calendar th {
        background: #3d3d3d;
        color: #e0e0e0;
        border-color: #444;
    }

    .ce-calendar td {
        border-color: #444;
        background: #2d2d2d;
    }

    .ce-calendar td.ce-other-month {
        background: #1a1a1a;
        color: #666;
    }

    .ce-day-number {
        color: #e0e0e0;
    }

    .ce-event-item {
        background: #3d3d3d;
        color: #e0e0e0;
    }

    .ce-event-title {
        color: #e0e0e0;
    }

    .ce-event-time {
        color: #aaa;
    }

    /* List view dark mode */
    .ce-list-view {
        background: #2d2d2d;
    }

    .ce-event-row {
        border-bottom-color: #444;
    }



    .ce-event-info-title {
        color: #e0e0e0;
    }

    .ce-event-info-time {
        color: #aaa;
    }

    .ce-no-events {
        color: #666;
    }
}
