/* Custom Styles for Tennis Club Management System */

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* 캘린더 스타일 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f9fafb;
    color: #374151;
    position: relative;
}

.calendar-day:hover {
    background-color: #e5e7eb;
    transform: scale(1.05);
}

.calendar-day.today {
    border: 2px solid #3b82f6;
    font-weight: bold;
}

.calendar-day.selected {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
}

.calendar-day.other-month {
    color: #d1d5db;
}

.calendar-day.weekend {
    color: #ef4444;
}

.calendar-day.weekend.saturday {
    color: #3b82f6;
}

/* 경기 표시 스타일 */
.calendar-day.has-match {
    background-color: #fef3c7;
}

.calendar-day.has-match.selected {
    background-color: #3b82f6;
}

.calendar-day .match-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 12px;
    line-height: 1;
}

.calendar-day .date-number {
    display: inline-block;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-header-day {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 0;
    color: #6b7280;
}

/* 회원 선택 체크박스 스타일 */
.member-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.member-checkbox:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.member-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.member-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #3b82f6;
}

.member-checkbox.checked {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

/* 출석 태그 스타일 */
.attendance-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #dcfce7;
    color: #166534;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
}

.attendance-tag i {
    margin-right: 4px;
}

/* 경기 카드 스타일 */
.match-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background-color: #fafafa;
    transition: all 0.2s;
}

.match-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.match-card.completed {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.team-section {
    padding: 12px;
    border-radius: 8px;
    background-color: white;
}

.team-a {
    border-left: 4px solid #3b82f6;
}

.team-b {
    border-left: 4px solid #ef4444;
}

.player-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.player-select:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px;
    ring-color: #bfdbfe;
}

.player-display {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9fafb;
    color: #374151;
    font-weight: 500;
}

.score-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s;
}

.score-input:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px;
    ring-color: #bfdbfe;
}

/* 통계 테이블 스타일 */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {
    position: sticky;
    top: 0;
    background-color: #f3f4f6;
    z-index: 10;
}

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover {
    background-color: #f9fafb;
}

table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

table td, table th {
    border-bottom: 1px solid #e5e7eb;
}

/* 순위 뱃지 */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #854d0e;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #1f2937;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e4a853);
    color: #431407;
}

.rank-other {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* 성별 뱃지 */
.gender-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.gender-male {
    background-color: #dbeafe;
    color: #1e40af;
}

.gender-female {
    background-color: #fce7f3;
    color: #be185d;
}

/* 토스트 알림 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

.toast.info {
    background-color: #3b82f6;
}

.toast.warning {
    background-color: #f59e0b;
}

/* 모바일 반응형 */
@media (max-width: 640px) {
    .calendar-day {
        font-size: 12px;
    }
    
    .calendar-header-day {
        font-size: 10px;
    }
    
    .score-input {
        width: 60px;
        font-size: 16px;
    }
    
    table {
        font-size: 12px;
    }
    
    table td, table th {
        padding: 8px 6px;
    }
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 빈 상태 메시지 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 로딩 스피너 */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 버튼 호버 효과 강화 */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* 스와이프 힌트 */
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: #fef3c7;
    color: #92400e;
    font-size: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.swipe-hint i {
    margin-right: 6px;
}
