/**
 * SG Calendar Styles
 */

.sg-calendar-container {
    max-width: 100%;
    margin: 2rem 0;
    font-family: Lato, -apple-system, sans-serif;
}

.sg-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.sg-calendar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.sg-calendar-header button {
    background: #B89D4F;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.sg-calendar-header button:hover {
    background: #a08840;
}

/* Calendar Grid */
.sg-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
    border: 1px solid #ddd;
}

.sg-calendar-day-header {
    background: #333;
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.sg-calendar-day {
    background: white;
    min-height: 100px;
    padding: 0.5rem;
    position: relative;
}

.sg-calendar-day-number {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #666;
}

.sg-calendar-day.other-month .sg-calendar-day-number {
    color: #ccc;
}

.sg-calendar-day.today {
    background: #fffbe6;
}

.sg-calendar-day.has-events {
    cursor: pointer;
}

/* Events in Calendar */
.sg-calendar-event {
    background: #B89D4F;
    color: white;
    padding: 2px 4px;
    margin: 2px 0;
    font-size: 0.75rem;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sg-calendar-event:hover {
    background: #a08840;
}

/* List View */
.sg-calendar-list {
    background: white;
    border: 1px solid #ddd;
}

.sg-calendar-list-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 1rem;
}

.sg-calendar-list-item:last-child {
    border-bottom: none;
}

.sg-calendar-list-date {
    min-width: 100px;
    font-weight: bold;
    color: #B89D4F;
}

.sg-calendar-list-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.sg-calendar-list-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Monthly Calendar Template */
.sg-calendar-wrapper {
    max-width: 1980px !important;
    margin: 0 auto;
    background: #fff;
    font-family: Lato, -apple-system, sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sg-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.sg-calendar-filter select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 1rem;
}

.sg-advanced-search {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.sg-nav-btn {
    background: #666;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.sg-nav-btn:hover {
    background: #333;
    color: white;
}

.sg-calendar-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.sg-calendar-view-switches {
    display: flex;
    gap: 5px;
}

.sg-view-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.sg-view-btn.active,
.sg-view-btn:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.sg-monthly-calendar {
    background: white;
}

.sg-calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #333;
    color: white;
}

.sg-day-header {
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.sg-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-left: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
}

.sg-calendar-day {
    min-height: 120px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px;
    position: relative;
    background: white;
    vertical-align: top;
}

.sg-calendar-day.sg-other-month {
    background: #f9f9f9;
    color: #ccc;
}

.sg-calendar-day.sg-today {
    background: #fff3cd;
}

.sg-calendar-day.sg-has-events {
    cursor: pointer;
}

.sg-day-number {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.sg-other-month .sg-day-number {
    color: #ccc;
}

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

.sg-event-block {
    background: #f8f9ff;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #4A90E2;
}

.sg-event-block:hover {
    background: #e8f0fe;
    transform: translateY(-1px);
}

.sg-event-time {
    font-weight: bold;
    color: #666;
    font-size: 10px;
}

.sg-event-title {
    font-weight: 500;
    color: #333;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sg-event-title a {
    color: inherit;
    text-decoration: none;
}

.sg-event-title a:hover {
    text-decoration: underline;
}

/* Different event colors (matching the reference image style) */
.sg-event-block[style*="#4A90E2"] { background: #e8f0fe; }
.sg-event-block[style*="#7B68EE"] { background: #f0e8ff; }
.sg-event-block[style*="#32CD32"] { background: #e8ffe8; }
.sg-event-block[style*="#FF6347"] { background: #ffe8e8; }
.sg-event-block[style*="#20B2AA"] { background: #e8ffff; }
.sg-event-block[style*="#FF69B4"] { background: #ffe8f4; }
.sg-event-block[style*="#DDA0DD"] { background: #f8e8ff; }

/* Responsive Design */
@media (max-width: 768px) {
    .sg-calendar-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sg-calendar-filter,
    .sg-calendar-navigation,
    .sg-calendar-view-switches {
        width: 100%;
        justify-content: center;
    }
    
    .sg-calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .sg-day-number {
        font-size: 14px;
    }
    
    .sg-event-block {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .sg-event-time {
        font-size: 9px;
    }
    
    .sg-calendar-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .sg-calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .sg-event-block {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    .sg-event-time {
        display: none; /* Hide time on very small screens */
    }
}

/* Events for Date Display */
.sg-events-for-date {
    margin: 1rem 0;
    font-family: Lato, -apple-system, sans-serif;
}

.sg-events-date-title {
    color: #B89D4F;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: bold;
    border-bottom: 2px solid #B89D4F;
    padding-bottom: 0.5rem;
}

.sg-no-events {
    color: #666;
    font-style: italic;
    padding: 1rem;
    background: #f9f9f9;
    border-left: 4px solid #ddd;
}

/* List Format (default) */
.sg-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sg-events-list .sg-event-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.sg-events-list .sg-event-item:last-child {
    border-bottom: none;
}

.sg-events-list .sg-event-title a {
    color: #B89D4F;
    text-decoration: none;
    font-weight: bold;
}

.sg-events-list .sg-event-title a:hover {
    text-decoration: underline;
    color: #a08840;
}

.sg-events-list .sg-event-excerpt {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    display: block;
}

/* Grid Format */
.sg-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.sg-events-grid .sg-event-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.sg-events-grid .sg-event-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sg-events-grid .sg-event-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.sg-events-grid .sg-event-title a {
    color: #B89D4F;
    text-decoration: none;
}

.sg-events-grid .sg-event-title a:hover {
    text-decoration: underline;
    color: #a08840;
}

.sg-events-grid .sg-event-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Simple Format (inline) */
.sg-events-simple {
    font-size: 1rem;
    line-height: 1.5;
}

.sg-events-simple .sg-event-title a {
    color: #B89D4F;
    text-decoration: none;
    font-weight: bold;
}

.sg-events-simple .sg-event-title a:hover {
    text-decoration: underline;
    color: #a08840;
}

/* Responsive */
@media (max-width: 768px) {
    .sg-calendar {
        font-size: 0.85rem;
    }
    
    .sg-calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }
    
    .sg-calendar-event {
        font-size: 0.65rem;
    }
    
    .sg-calendar-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .sg-events-grid {
        grid-template-columns: 1fr;
    }
    
    .sg-events-date-title {
        font-size: 1.1rem;
    }
}

/* Events List Container */
.sg-events-list-container {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
}

.sg-events-list-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}

.sg-events-list-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.sg-event-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.sg-events-date-range {
    color: #666;
    font-size: 0.95rem;
}

/* Event Categories */
.sg-event-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

.sg-category-item {
    display: inline-block;
    padding: 4px 12px;
    color: white;
    font-size: 0.85rem;
    border-radius: 3px;
    font-weight: 500;
}

/* Events List Items */
.sg-events-list-items {
    background: white;
    border-radius: 4px;
    padding: 1rem;
}

.sg-event-list-item {
    display: flex;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.sg-event-list-item:hover {
    background-color: #f8f9fa;
}

.sg-event-list-item:last-child {
    border-bottom: none;
}

/* Date Block */
.sg-event-date-block {
    min-width: 60px;
    margin-right: 1.5rem;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    background: white;
    height: fit-content;
}

.sg-event-month {
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.sg-event-day {
    font-size: 1.75rem;
    font-weight: bold;
    color: #333;
    line-height: 1;
    margin-top: 4px;
}

/* Event Details */
.sg-event-details {
    flex: 1;
}

.sg-event-list-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.sg-event-list-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.sg-event-list-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

.sg-event-meta {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.sg-event-datetime {
    font-weight: 500;
}

.sg-event-location {
    display: inline-block;
    margin-top: 0.25rem;
}

.sg-event-description {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0.75rem 0 0 0;
}

/* No Events Message */
.sg-no-events-message {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
    background: white;
    border-radius: 4px;
}

/* Event Category Legend */
.sg-event-categories-legend {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.sg-event-categories-legend > div {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.sg-event-categories-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sg-event-categories-legend .category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sg-event-categories-legend .category-label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sg-events-list-container {
        padding: 1rem;
    }
    
    .sg-event-categories-legend {
        padding: 10px;
    }
    
    .sg-event-categories-legend > div {
        gap: 10px;
    }
    
    .sg-event-categories-legend .category-label {
        font-size: 12px;
    }
    
    .sg-event-categories-legend .category-dot {
        width: 10px;
        height: 10px;
    }
    
    .sg-event-categories {
        padding: 0.75rem;
    }
    
    .sg-category-item {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .sg-event-list-item {
        padding: 1rem;
        flex-direction: column;
    }
    
    .sg-event-date-block {
        margin-right: 0;
        margin-bottom: 1rem;
        width: 80px;
    }
    
    .sg-event-list-title {
        font-size: 1.1rem;
    }
    
    .sg-event-meta,
    .sg-event-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sg-events-list-header h3 {
        font-size: 1.2rem;
    }
    
    .sg-event-categories {
        gap: 4px;
    }
    
    .sg-category-item {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}