/* ─── 3DP Events Calendar ─── Synthwave Theme */

:root {
    --tec-bg: #0d0b1a;
    --tec-surface: #151229;
    --tec-surface-hover: #1c1836;
    --tec-surface-active: #241f42;
    --tec-border: #2a2450;
    --tec-border-light: #342d5e;
    --tec-text: #e8e0f8;
    --tec-text-muted: #9088b8;
    --tec-text-dim: #5c5488;
    --tec-primary: #e040fb;
    --tec-primary-hover: #ea6aff;
    --tec-primary-glow: rgba(224, 64, 251, 0.15);
    --tec-cyan: #00e5ff;
    --tec-pink: #ff2d95;
    --tec-today: rgba(224, 64, 251, 0.08);
    --tec-today-border: var(--tec-primary);
    --tec-modal-bg: #12102a;
    --tec-radius: 10px;
    --tec-radius-sm: 6px;
    --tec-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --tec-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --tec-transition: 0.2s ease;
    --tec-glow-pink: 0 0 20px rgba(255, 45, 149, 0.3);
    --tec-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.3);
    --tec-glow-primary: 0 0 20px rgba(224, 64, 251, 0.3);
}

/* ─── Container ─── */

.tec-calendar-wrap {
    font-family: var(--tec-font);
    background: var(--tec-bg);
    border: 1px solid var(--tec-border);
    border-radius: var(--tec-radius);
    overflow: hidden;
    color: var(--tec-text);
    line-height: 1.5;
}

.tec-calendar-wrap *,
.tec-calendar-wrap *::before,
.tec-calendar-wrap *::after {
    box-sizing: border-box;
}

/* ─── Header ─── */

.tec-header {
    background: var(--tec-surface);
    border-bottom: 1px solid var(--tec-border);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.tec-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tec-nav-btn {
    background: transparent;
    border: 1px solid var(--tec-border-light);
    border-radius: var(--tec-radius-sm);
    color: var(--tec-text);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tec-transition);
}

.tec-nav-btn:hover {
    background: var(--tec-surface-hover);
    border-color: var(--tec-primary);
    color: var(--tec-primary);
    box-shadow: var(--tec-glow-primary);
}

.tec-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--tec-text);
    min-width: 180px;
    text-align: center;
    letter-spacing: -0.02em;
}

.tec-today-btn {
    background: transparent;
    border: 1px solid var(--tec-border-light);
    border-radius: var(--tec-radius-sm);
    color: var(--tec-text-muted);
    cursor: pointer;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--tec-transition);
}

.tec-today-btn:hover {
    background: var(--tec-primary-glow);
    border-color: var(--tec-primary);
    color: var(--tec-primary);
}

/* ─── Controls ─── */

.tec-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tec-search-wrap { position: relative; }

.tec-search {
    background: var(--tec-bg);
    border: 1px solid var(--tec-border-light);
    border-radius: var(--tec-radius-sm);
    color: var(--tec-text);
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    width: 180px;
    transition: all var(--tec-transition);
    font-family: var(--tec-font);
}

.tec-search:focus {
    outline: none;
    border-color: var(--tec-cyan);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.15), var(--tec-glow-cyan);
    width: 220px;
}

.tec-search::placeholder { color: var(--tec-text-dim); }

.tec-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tec-text-dim);
    pointer-events: none;
}

.tec-filter {
    background: var(--tec-bg);
    border: 1px solid var(--tec-border-light);
    border-radius: var(--tec-radius-sm);
    color: var(--tec-text);
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--tec-font);
    transition: border-color var(--tec-transition);
}

.tec-filter:focus { outline: none; border-color: var(--tec-primary); }
.tec-filter option { background: var(--tec-surface); color: var(--tec-text); }

.tec-view-toggle {
    display: flex;
    border: 1px solid var(--tec-border-light);
    border-radius: var(--tec-radius-sm);
    overflow: hidden;
}

.tec-view-btn {
    background: transparent;
    border: none;
    color: var(--tec-text-muted);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--tec-transition);
    font-family: var(--tec-font);
    border-right: 1px solid var(--tec-border-light);
}

.tec-view-btn:last-child { border-right: none; }
.tec-view-btn:hover { background: var(--tec-surface-hover); color: var(--tec-text); }

.tec-view-btn.active {
    background: var(--tec-primary);
    color: #fff;
    box-shadow: var(--tec-glow-primary);
}

/* ─── Calendar Body ─── */

.tec-body { min-height: 400px; }

.tec-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--tec-text-muted);
    font-size: 14px;
}

/* ─── Month View ─── */

.tec-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.tec-month-header {
    display: contents;
}

.tec-day-label {
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tec-text-dim);
    background: var(--tec-surface);
    border-bottom: 1px solid var(--tec-border);
}

.tec-day-cell {
    min-height: 100px;
    border-right: 1px solid var(--tec-border);
    border-bottom: 1px solid var(--tec-border);
    padding: 6px;
    cursor: default;
    transition: background var(--tec-transition);
    position: relative;
}

.tec-day-cell:nth-child(7n) { border-right: none; }
.tec-day-cell.tec-other-month { opacity: 0.25; }

.tec-day-cell.tec-today {
    background: var(--tec-today);
}

.tec-day-cell.tec-today .tec-day-number {
    background: var(--tec-primary);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tec-glow-primary);
}

.tec-day-cell.tec-has-events { cursor: pointer; }
.tec-day-cell.tec-has-events:hover { background: var(--tec-surface-hover); }

.tec-day-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--tec-text-muted);
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
}

.tec-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tec-event-dot {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all var(--tec-transition);
}

.tec-event-dot:hover {
    opacity: 0.85;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.tec-event-dot .dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.tec-more-events {
    font-size: 11px;
    color: var(--tec-cyan);
    padding: 2px 6px;
    cursor: pointer;
    font-weight: 600;
}

.tec-more-events:hover { text-decoration: underline; }

/* ─── Week View ─── */

.tec-week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
}

.tec-week-header-cell {
    padding: 10px 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--tec-text-muted);
    background: var(--tec-surface);
    border-bottom: 1px solid var(--tec-border);
    border-right: 1px solid var(--tec-border);
}

.tec-week-header-cell:last-child { border-right: none; }
.tec-week-header-cell.tec-today-col { color: var(--tec-primary); }

.tec-week-header-cell .day-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.tec-week-header-cell.tec-today-col .day-num {
    background: var(--tec-primary);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--tec-glow-primary);
}

.tec-week-time-label {
    padding: 4px 8px;
    font-size: 11px;
    color: var(--tec-text-dim);
    text-align: right;
    border-right: 1px solid var(--tec-border);
    border-bottom: 1px solid var(--tec-border);
    min-height: 50px;
    background: var(--tec-surface);
}

.tec-week-cell {
    border-right: 1px solid var(--tec-border);
    border-bottom: 1px solid var(--tec-border);
    min-height: 50px;
    padding: 2px;
}

.tec-week-cell:last-child { border-right: none; }
.tec-week-cell.tec-today-col { background: var(--tec-today); }

.tec-week-event {
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--tec-transition);
}

.tec-week-event:hover {
    opacity: 0.85;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* ─── List View ─── */

.tec-list-view { padding: 0; }

.tec-list-date-group { border-bottom: 1px solid var(--tec-border); }

.tec-list-date-header {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tec-cyan);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--tec-surface);
    border-bottom: 1px solid var(--tec-border);
    position: sticky;
    top: 0;
    z-index: 2;
    text-shadow: var(--tec-glow-cyan);
}

.tec-list-event {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--tec-transition);
    border-bottom: 1px solid var(--tec-border);
}

.tec-list-event:last-child { border-bottom: none; }
.tec-list-event:hover { background: var(--tec-surface-hover); }

.tec-list-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--tec-primary);
    min-width: 80px;
    flex-shrink: 0;
}

.tec-list-color-bar {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.tec-list-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--tec-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.tec-list-info { flex: 1; min-width: 0; }

.tec-list-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tec-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tec-list-meta {
    font-size: 12px;
    color: var(--tec-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tec-list-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.tec-list-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--tec-text-dim);
    font-size: 14px;
}

/* ─── Event Detail Modal ─── */

.tec-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 3, 15, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tec-modal {
    background: #12102a;
    border: 1px solid #2a2450;
    border-radius: 14px;
    width: 560px;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), var(--tec-glow-primary);
    animation: tecModalIn 0.25s ease-out;
}

@keyframes tecModalIn {
    from { opacity: 0; transform: translateY(-15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tec-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--tec-surface);
    border: 1px solid var(--tec-border-light);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tec-text-muted);
    transition: all var(--tec-transition);
    z-index: 2;
}

.tec-modal-close:hover {
    background: var(--tec-surface-hover);
    color: var(--tec-text);
    border-color: var(--tec-pink);
}

.tec-modal-content { padding: 0; }

.tec-modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 14px 14px 0 0;
}

.tec-modal-body { padding: 28px; }

.tec-modal-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.tec-modal-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--tec-surface-active);
    color: var(--tec-text-muted);
    margin-bottom: 10px;
    margin-left: 6px;
}

.tec-modal-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--tec-text);
    margin: 0 0 16px 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.tec-modal-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--tec-text-muted);
}

.tec-modal-detail-row svg {
    flex-shrink: 0;
    color: var(--tec-cyan);
    margin-top: 2px;
}

.tec-modal-detail-row strong { color: var(--tec-text); }

.tec-modal-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tec-border);
    font-size: 14px;
    color: var(--tec-text-muted);
    line-height: 1.7;
}

.tec-modal-description p { margin: 0 0 12px 0; }

.tec-modal-map {
    margin-top: 20px;
    border-radius: var(--tec-radius);
    overflow: hidden;
    border: 1px solid var(--tec-border);
}

.tec-modal-map iframe { display: block; width: 100%; height: 200px; border: none; }

.tec-modal-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tec-border);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tec-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--tec-radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tec-font);
    cursor: pointer;
    transition: all var(--tec-transition);
    text-decoration: none;
    border: none;
}

.tec-btn-primary {
    background: var(--tec-primary);
    color: #fff;
}

.tec-btn-primary:hover {
    background: var(--tec-primary-hover);
    color: #fff;
    box-shadow: var(--tec-glow-primary);
}

.tec-btn-outline {
    background: transparent;
    border: 1px solid var(--tec-border-light);
    color: var(--tec-text-muted);
}

.tec-btn-outline:hover {
    border-color: var(--tec-cyan);
    color: var(--tec-cyan);
    box-shadow: var(--tec-glow-cyan);
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .tec-header { flex-direction: column; align-items: stretch; }
    .tec-nav { justify-content: center; }
    .tec-controls { justify-content: center; }
    .tec-search { width: 140px; }
    .tec-search:focus { width: 160px; }

    .tec-day-cell { min-height: 70px; padding: 4px; }

    .tec-event-dot {
        font-size: 0;
        padding: 0;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
    }

    .tec-event-dot .dot-indicator { display: none; }
    .tec-day-events { flex-direction: row; flex-wrap: wrap; gap: 3px; }

    /* Week view mobile: compact everything */
    .tec-week-scroll {
        overflow-x: hidden;
    }

    .tec-week-grid {
        min-width: 0;
        grid-template-columns: 46px repeat(7, 1fr);
    }

    .tec-week-time-label {
        font-size: 10px;
        padding: 2px 4px;
        min-height: 40px;
    }

    .tec-week-cell {
        min-height: 40px;
        padding: 1px;
    }

    .tec-week-header-cell {
        padding: 6px 2px;
        font-size: 10px;
    }

    .tec-week-header-cell .day-num {
        font-size: 14px;
    }

    .tec-week-header-cell.tec-today-col .day-num {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    /* Week events become dots on mobile — !important to override theme */
    .tec-week-event {
        font-size: 0 !important;
        padding: 0 !important;
        width: 12px !important;
        height: 12px !important;
        border-radius: 50% !important;
        margin: 2px auto !important;
        display: block !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-indent: -9999px !important;
    }

    .tec-modal {
        width: 100%;
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
        margin-top: auto;
    }

    .tec-modal-actions {
        flex-direction: column;
    }

    .tec-modal-actions .tec-btn {
        justify-content: center;
        width: 100%;
    }

    .tec-list-event { flex-wrap: wrap; gap: 10px; }
    .tec-list-time { min-width: auto; }
}

@media (max-width: 480px) {
    .tec-day-number { font-size: 11px; }
    .tec-title { font-size: 15px; min-width: 140px; }
    .tec-view-btn { padding: 6px 10px; font-size: 12px; }
}

/* ─── Upcoming Event Widget ─── */

.tec-upcoming-wrap {
    --uw-bg: var(--tec-upcoming-bg, #151229);
    font-family: var(--tec-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    border-radius: 14px;
    color: #e8e0f8;
    line-height: 1.5;
    position: relative;
    cursor: pointer;
    background: var(--uw-bg);
    border: none;
    padding: 2px;
    box-shadow: 0 0 18px rgba(224, 64, 251, 0.2), 0 4px 24px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease;
    z-index: 0;
    overflow: hidden;
}

/* Rotating conic gradient border - cross browser */
.tec-upcoming-wrap::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent 0deg,
        transparent 80deg,
        #e040fb 110deg,
        #00e5ff 180deg,
        #e040fb 250deg,
        transparent 280deg,
        transparent 360deg
    );
    animation: tecChaseRotate 8s linear infinite;
    z-index: -2;
}

/* Inner mask to show only the 2px border */
.tec-upcoming-wrap::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    background: var(--uw-bg);
    z-index: -1;
}

@keyframes tecChaseRotate {
    to { transform: rotate(360deg); }
}

.tec-upcoming-wrap:hover {
    box-shadow: 0 0 28px rgba(224, 64, 251, 0.4), 0 4px 32px rgba(0, 0, 0, 0.5);
}

.tec-upcoming-wrap > *:not(.tec-modal-overlay) {
    position: relative;
    z-index: 1;
}

.tec-upcoming-wrap *,
.tec-upcoming-wrap *::before,
.tec-upcoming-wrap *::after {
    box-sizing: border-box;
}

.tec-upcoming-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
}

/* Stacked label - two lines, words stay intact */
.tec-upcoming-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #00e5ff;
    flex-shrink: 0;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    width: 62px;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    hyphens: none;
}

.tec-upcoming-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg, transparent, rgba(224, 64, 251, 0.4), transparent);
    flex-shrink: 0;
}

.tec-upcoming-event {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

@keyframes tecDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.85); }
}

.tec-upcoming-arrow {
    color: #5c5488;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.tec-upcoming-wrap:hover .tec-upcoming-arrow,
.tec-upcoming-wrap:hover svg:last-child {
    color: #e040fb !important;
    transform: translateX(3px);
}

.tec-upcoming-footer {
    position: relative;
    z-index: 1;
    padding: 0 20px 10px;
    text-align: right;
}

.tec-upcoming-footer a {
    color: #9088b8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
}

.tec-upcoming-footer a:hover {
    color: #e040fb;
}

/* Modal for upcoming widget */
.tec-upcoming-wrap .tec-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 3, 15, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tec-upcoming-wrap .tec-modal {
    background: #12102a;
    border: 1px solid #2a2450;
    border-radius: 14px;
    width: 560px;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 20px rgba(224, 64, 251, 0.3);
    animation: tecModalIn 0.25s ease-out;
}

.tec-upcoming-wrap .tec-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: #151229;
    border: 1px solid #342d5e;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #9088b8;
    transition: all 0.2s;
    z-index: 2;
}

.tec-upcoming-wrap .tec-modal-close:hover {
    background: #1c1836;
    color: #e8e0f8;
}

@media (max-width: 768px) {
    .tec-upcoming-inner {
        gap: 10px;
        padding: 12px 14px;
    }

    .tec-upcoming-label {
        width: 54px;
        font-size: 9px;
    }

    .tec-upcoming-event {
        gap: 8px;
    }

    .tec-upcoming-wrap .tec-modal {
        width: 100%;
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
        margin-top: auto;
    }
}
