/**
 * Schedule Event Widget - Frontend Styles
 * 프론트엔드 스타일 - 리스트, 주간, 월간 뷰
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    --sew-primary: #22c55e;
    --sew-primary-light: #dcfce7;
    --sew-text-dark: #1f2937;
    --sew-text-muted: #6b7280;
    --sew-text-light: #9ca3af;
    --sew-bg-white: #ffffff;
    --sew-bg-light: #f9fafb;
    --sew-border: #e5e7eb;
    --sew-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --sew-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --sew-radius: 12px;
    --sew-radius-sm: 8px;
    --sew-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
}

/* ===================================
   Container
   =================================== */
.sew-container {
    font-family: var(--sew-font-family);
    max-width: 100%;
    margin: 0 auto;
    border: none !important;
    outline: none !important;
    box-shadow: none;
}

/* ===================================
   Tabs - Pill Style
   =================================== */
.sew-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 5px;
    background: #f3f4f6;
    border-radius: 50px;
    border: none;
    outline: none;
    box-shadow: none;
}

.sew-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sew-tab svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    transition: all 0.2s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

.sew-tab:hover {
    color: #6b7280;
}

.sew-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.sew-tab.active svg {
    color: #fff;
}

.sew-tab span {
    font-weight: 500;
    line-height: 1;
    vertical-align: middle;
}

/* ===================================
   List View (이미지 참고 디자인)
   =================================== */
.sew-list-view {
    background: var(--sew-bg-white);
    border-radius: var(--sew-radius);
    overflow: hidden;
    box-shadow: var(--sew-shadow);
}

.sew-event-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--sew-border);
    transition: background 0.2s ease;
    cursor: pointer;
}

.sew-event-item:last-child {
    border-bottom: none;
}

.sew-event-item:hover {
    background: var(--sew-bg-light);
}

.sew-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    text-align: center;
}

.sew-month {
    font-size: 12px;
    font-weight: 600;
    color: var(--sew-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sew-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--sew-text-dark);
    line-height: 1.2;
}

.sew-event-content {
    flex: 1;
    min-width: 0;
}

.sew-event-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.sew-category-tag {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sew-time {
    font-size: 13px;
    color: var(--sew-text-muted);
}

.sew-event-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sew-text-dark);
    line-height: 1.4;
}

.sew-event-title a {
    color: inherit;
    text-decoration: none;
}

.sew-event-title a:hover {
    color: var(--sew-primary);
}

.sew-event-excerpt {
    margin: 0;
    font-size: 14px;
    color: var(--sew-text-muted);
    line-height: 1.5;
}

.sew-date-range,
.sew-time-range {
    font-size: 13px;
    color: var(--sew-text-light);
}

.sew-event-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--sew-text-light);
    transition: transform 0.2s ease;
}

.sew-event-item:hover .sew-event-arrow {
    transform: translateX(4px);
    color: var(--sew-primary);
}

.sew-no-events {
    padding: 48px 24px;
    text-align: center;
    color: var(--sew-text-muted);
}

/* ===================================
   Calendar Navigation
   =================================== */
.sew-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: var(--sew-bg-white);
    border-radius: var(--sew-radius) var(--sew-radius) 0 0;
    border-bottom: 1px solid var(--sew-border);
}

.sew-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--sew-border);
    background: var(--sew-bg-white);
    border-radius: 50%;
    color: var(--sew-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sew-nav-btn:hover {
    border-color: var(--sew-primary);
    color: var(--sew-primary);
}

.sew-nav-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--sew-text-dark);
    min-width: 120px;
    text-align: center;
}

/* ===================================
   Weekly View
   =================================== */
.sew-weekly-view {
    background: var(--sew-bg-white);
    border-radius: var(--sew-radius);
    overflow: hidden;
    box-shadow: var(--sew-shadow);
}

.sew-weekly-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.sew-weekly-day {
    min-height: 150px;
    border-right: 1px solid var(--sew-border);
    border-bottom: 1px solid var(--sew-border);
}

.sew-weekly-day:last-child {
    border-right: none;
}

.sew-weekly-day.sew-today .sew-day-header {
    background: var(--sew-primary);
    color: #fff;
}

.sew-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--sew-bg-light);
    border-bottom: 1px solid var(--sew-border);
}

.sew-day-name {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    opacity: 0.8;
}

.sew-day-date {
    font-size: 20px;
    font-weight: 700;
}

.sew-day-events {
    padding: 8px;
}

.sew-weekly-event {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: var(--sew-bg-light);
    border-radius: 6px;
    border-left: 3px solid var(--sew-primary);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sew-weekly-event:hover {
    background: #e5e7eb;
    transform: translateX(2px);
}

.sew-weekly-event-time {
    color: var(--sew-text-muted);
    font-weight: 500;
}

.sew-weekly-event-title {
    color: var(--sew-text-dark);
    font-weight: 500;
    line-height: 1.3;
}

/* ===================================
   Monthly View
   =================================== */
.sew-monthly-view {
    background: var(--sew-bg-white);
    border-radius: var(--sew-radius);
    overflow: hidden;
    box-shadow: var(--sew-shadow);
}

.sew-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--sew-bg-light);
    border-bottom: 1px solid var(--sew-border);
}

.sew-calendar-day-name {
    padding: 14px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--sew-text-muted);
}

.sew-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.sew-calendar-cell {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--sew-border);
    border-bottom: 1px solid var(--sew-border);
    position: relative;
}

.sew-calendar-cell:nth-child(7n) {
    border-right: none;
}

.sew-calendar-cell.sew-empty {
    background: var(--sew-bg-light);
}

.sew-calendar-cell.sew-today {
    background: var(--sew-primary-light);
}

.sew-calendar-cell.sew-today .sew-cell-date {
    background: var(--sew-primary);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sew-cell-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--sew-text-dark);
    margin-bottom: 6px;
}

.sew-cell-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sew-cell-event {
    display: block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sew-cell-event:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.sew-more-events {
    font-size: 11px;
    color: var(--sew-text-muted);
    font-weight: 500;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .sew-weekly-grid {
        grid-template-columns: 1fr;
    }

    .sew-weekly-day {
        min-height: auto;
        border-right: none;
    }

    .sew-day-header {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }

    .sew-calendar-cell {
        min-height: 80px;
    }

    .sew-event-item {
        padding: 16px;
        gap: 14px;
    }

    .sew-day {
        font-size: 22px;
    }

    .sew-event-title {
        font-size: 14px;
    }

    .sew-tabs {
        width: 100%;
        justify-content: center;
    }

    .sew-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ===================================
   Loading State
   =================================== */
.sew-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.sew-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--sew-border);
    border-top-color: var(--sew-primary);
    border-radius: 50%;
    animation: sew-spin 0.8s linear infinite;
}

@keyframes sew-spin {
    to {
        transform: rotate(360deg);
    }
}