/* ===== SHADCN/UI INSPIRED DESIGN ===== */

/* CSS Variables */
:root {
    --background: #ffffff;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --popover: #ffffff;
    --popover-foreground: #0f172a;
    --primary: #0f172a;
    --primary-foreground: #f8fafc;
    --secondary: #f1f5f9;
    --secondary-foreground: #0f172a;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #94a3b8;
    --radius: 0.5rem;
    
    /* Event type colors */
    --ruins: rgb(7, 89, 133);
    --ruins-light: #f0f9ff;
    --ruins-border: #7dd3fc;
    
    --darkness: rgb(15, 23, 42);
    --darkness-light: #fafaf9;
    --darkness-border: #a8a29e;
    
    --pass: #be185d;
    --pass-light: #fdf2f8;
    --pass-border: #f9a8d4;
    
    --ziggurat: #4d7c0f;
    --ziggurat-light: #f7fee7;
    --ziggurat-border: #bef264;
}

/* Global Font Family */
* {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.header-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
}

/* Title Section */
.title-section {
    margin-bottom: 2rem;
    text-align: center;
}

.title-section h1 {
    font-size: 2.25rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    line-height: 1.2;
}

.title-section p {
    font-size: 1.25rem;
    font-weight: 400;
    color: #4b5563;
    margin: 0;
}

/* Card Styles */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease-in-out;
}

/* Completed Event Styles */
.event-card.completed {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.event-card.completed .event-countdown {
    background: rgba(156, 163, 175, 0.2);
    border-color: #9ca3af;
    color: #6b7280;
}

.event-card.completed .event-icon {
    background-color: #9ca3af !important;
}

.event-card.completed h3,
.event-card.completed p {
    color: #6b7280;
}

/* Ruins Live Animation */
.event-card.ruins-live .event-countdown {
    animation: ruinsPulse 1.5s ease-in-out infinite;
    background: rgba(189, 4, 4, 0.2);
    border-color: #bd0404;
    color: #bd0404;
    font-weight: 600;
}


@keyframes ruinsPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(189, 4, 4, 0.4);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(189, 4, 4, 0);
    }
}

.event-card.ruins-live .event-icon {
    animation: ruinsIconPulse 2s ease-in-out infinite;
}

@keyframes ruinsIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--card-foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.info-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.info-cards-row .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.timezone-card {
    background: rgb(229, 229, 229);
}

.next-event-card {
    margin-top: 0;
    margin-bottom: 0;
    background: rgb(245, 245, 245);
}

.current-time-card {
    margin-top: 0;
    margin-bottom: 0;
    background: rgb(250, 250, 250);
}

@media (max-width: 768px) {
    .info-cards-row {
        grid-template-columns: 1fr;
    }
}

.next-event-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.current-time-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#next-event-title {
    font-weight: 600;
    color: var(--card-foreground);
}

#next-event-time {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--muted);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 2rem;
    width: fit-content;
}

.view-btn {
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    background: var(--background);
    color: var(--foreground);
}

.view-btn.active {
    background: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--muted);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
}

.tab-button:hover {
    color: var(--accent-foreground);
}

.tab-button.active {
    background: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Filters */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
}

.filter-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1;
}

.filter-btn:hover {
    background: var(--accent);
}

.filter-btn.active {
    background: rgb(41, 37, 36);
    color: white;
    border-color: rgb(41, 37, 36);
}

.filter-btn[data-filter="ruins"].active {
    background: var(--ruins) !important;
    border-color: var(--ruins) !important;
    color: white !important;
}

.filter-btn[data-filter="darkness"].active {
    background: var(--darkness) !important;
    border-color: var(--darkness) !important;
    color: white !important;
}

.filter-btn[data-filter="pass"].active {
    background: var(--pass) !important;
    border-color: var(--pass) !important;
    color: white !important;
}

.filter-btn[data-filter="ziggurat"].active {
    background: var(--ziggurat) !important;
    border-color: var(--ziggurat) !important;
    color: white !important;
}


/* Event Cards Container */
#events-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Responsive Grid Layout */
@media (min-width: 640px) {
    #events-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    #events-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .calendar-button {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
    }
    
    .calendar-button svg {
        width: 14px;
        height: 14px;
    }
}

/* Event Cards */
.event-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.event-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.event-countdown {
    align-self: flex-start;
}

.event-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    shape-rendering: geometricPrecision;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.event-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.event-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--card-foreground);
}

.event-info p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    flex-grow: 1;
}

.event-time {
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.event-day {
    color: var(--card-foreground);
    font-weight: 600;
}

.event-hour {
    color: var(--muted-foreground);
    font-weight: 400;
}

.event-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.event-countdown svg {
    flex-shrink: 0;
}

.event-card.ruins .event-countdown {
    border-color: var(--ruins);
    background: rgba(7, 89, 133, 0.2);
}

.event-card.ruins.ruins-live .event-countdown {
    background: rgba(189, 4, 4, 0.2) !important;
    border-color: #bd0404 !important;
    color: #bd0404 !important;
}

.event-card.darkness .event-countdown {
    border-color: var(--darkness);
    background: rgba(15, 23, 42, 0.2);
}

.event-card.pass .event-countdown {
    border-color: var(--pass);
    background: rgba(190, 24, 93, 0.2);
}

.event-card.ziggurat .event-countdown {
    border-color: var(--ziggurat);
    background: rgba(77, 124, 15, 0.2);
}

/* Event Tooltip */
.event-tooltip {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 250px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    cursor: default;
}

.event-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.event-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.event-tooltip-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-tooltip-icon svg {
    width: 16px;
    height: 16px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.event-tooltip-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
    line-height: 1.2;
}

.event-tooltip-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.event-tooltip-countdown {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.event-tooltip-button {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-tooltip-button:hover {
    background: var(--accent);
}

.event-tooltip-button svg {
    width: 14px;
    height: 14px;
}

/* Calendar event hover effect */
.calendar-event {
    cursor: pointer;
    position: relative;
}

.calendar-event:hover {
    transform: scale(1.05);
    z-index: 10;
}

.add-to-calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
}

.add-to-calendar-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.add-to-calendar-btn svg {
    width: 16px;
    height: 16px;
}

.calendar-button {
    display: -webkit-inline-flex !important;
    display: -moz-inline-flex !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -moz-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    padding: 0.625rem 1rem;
    margin-top: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--foreground);
    cursor: pointer;
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -ms-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
    min-height: 40px;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
}

.calendar-button:hover {
    background: var(--accent);
    border-color: var(--foreground);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-button:active {
    transform: translateY(0);
}

.calendar-button svg {
    width: 16px;
    height: 16px;
}

/* Calendar Styles */
.calendar-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

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

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.nav-button:hover {
    background: var(--accent);
}

.nav-button svg {
    width: 1rem;
    height: 1rem;
}

.month-year {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
}

.calendar-grid {
    display: -webkit-grid;
    display: -moz-grid;
    display: -ms-grid;
    display: grid;
    -webkit-grid-template-columns: repeat(7, 1fr);
    -moz-grid-template-columns: repeat(7, 1fr);
    -ms-grid-template-columns: repeat(7, 1fr);
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    background: var(--muted);
    border-bottom: 1px solid var(--border);
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--background);
    position: relative;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background: var(--muted);
    color: var(--muted-foreground);
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--accent) 0%, var(--background) 100%);
    position: relative;
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary);
    border-radius: 0;
    pointer-events: none;
}

.calendar-day.today .day-number {
    font-weight: 700;
    color: var(--primary);
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--foreground);
}

.calendar-day.other-month .day-number {
    color: var(--muted-foreground);
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.375rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--accent);
    color: var(--accent-foreground);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.calendar-event:hover {
    transform: scale(1.02);
}

.calendar-event .event-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-event .event-icon svg {
    width: 6px;
    height: 6px;
    fill: white;
}

.calendar-event .event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}


/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    #events-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header {
        height: 250px;
        margin-bottom: 1rem;
    }
    
    .header-content {
        bottom: 1rem;
        left: 1rem;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .event-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
    }
    
    .event-icon {
        width: 40px;
        height: 40px;
    }
    
    .event-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .calendar-event {
        font-size: 0.5rem;
        padding: 0.0625rem 0.125rem;
    }
    
    .event-tooltip {
        min-width: 200px;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .filters {
        grid-template-columns: 1fr;
    }
    .tabs {
        width: 100%;
    }
}
