/* css/calendar.css */

/* --- Calendar Modal --- */
.calendar-modal {
    max-width: 750px;
}

.calendar-nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calendar-nav-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    font-weight: bold;
}
.calendar-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.current-month {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    min-width: 220px;
    text-align: center;
}

.calendar-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-month-detail {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-month-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
    padding: 0.8rem;
    background: white;
    border-radius: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: #f8f9fa;
    padding: 0.4rem;
}
.calendar-day:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}
.calendar-day.other-month {
    color: #ccc;
    background: #fafafa;
    opacity: 0.5;
    pointer-events: none;
}
.calendar-day.today {
    border-color: #FF9800;
    border-width: 3px;
    font-weight: bold;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

.calendar-day.low-activity { background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 100%); color: #2E7D32; border-color: #81C784; }
.calendar-day.medium-activity { background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%); color: white; border-color: #4CAF50; }
.calendar-day.high-activity { background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%); color: white; border-color: #2E7D32; font-weight: bold; }

.calendar-day-number { font-weight: bold; font-size: 1rem; }
.calendar-day-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 2px 5px;
    border-radius: 5px;
    margin-top: 3px;
    font-weight: 600;
}
.calendar-day.medium-activity .calendar-day-count,
.calendar-day.high-activity .calendar-day-count {
    background: rgba(255, 255, 255, 0.95);
    color: #2E7D32;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: #666; font-weight: 500; }
.legend-dot { width: 16px; height: 16px; border-radius: 4px; border: 2px solid transparent; }
.legend-dot.no-activity { background: #f8f9fa; border-color: #e0e0e0; }
.legend-dot.low-activity { background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 100%); border-color: #81C784; }
.legend-dot.medium-activity { background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%); border-color: #4CAF50; }
.legend-dot.high-activity { background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%); border-color: #2E7D32; }
.legend-dot.today { background: #FF9800; border-color: #FF9800; }


/* --- Date & Month Detail Modals --- */
.date-detail-modal, .month-detail-modal {
    max-width: 800px;
}

.date-detail-content, .month-detail-content {
    max-height: 65vh;
    overflow-y: auto;
}

.no-data { text-align: center; padding: 3rem; color: #999; font-size: 1.1rem; }

.detail-search-container {
    margin-bottom: 1.5rem;
    position: sticky;
    top: -2rem; /* Adjust based on modal-body padding */
    background: white;
    z-index: 10;
    padding: 1rem 0;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-search-container .detail-search-input {
    flex: 1;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.detail-action-btn {
    padding: 8px 12px;
    background: #f0f2f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-action-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.detail-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f8f9fa;
}
.detail-search-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.round-section { margin-bottom: 2rem; }
.round-title {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: white;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.round-title:hover { opacity: 0.9; }
.toggle-icon { font-size: 0.9em; }

.round-title.round1 { background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%); }
.round-title.round2 { background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%); }
.round-title.round3 { background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%); }
.round-title.round4 { background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%); }
.round-title.round5 { background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%); }
.round-title.round6 { background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%); }
.round-title.round7 { background: linear-gradient(135deg, #8BC34A 0%, #689F38 100%); }

.category-section { margin-bottom: 1rem; padding-left: 0.5rem; }
.category-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    background-color: #f0f2f5;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    border-left: 3px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.category-title:hover { background-color: #e9ecef; }

.problems-list { display: grid; gap: 0.8rem; }

.problem-detail-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.2s;
    position: relative;
}
.problem-detail-item:hover { background: #e3f2fd; transform: translateX(3px); }

.problem-title-detail { flex: 1; color: #333; font-weight: 500; font-size: 0.95rem; line-height: 1.3; }
.problem-difficulty { padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; }
.problem-difficulty.easy { background: #C8E6C9; color: #2E7D32; }
.problem-difficulty.medium { background: #FFE082; color: #F57C00; }
.problem-difficulty.hard { background: #FFCDD2; color: #C62828; }

.problem-dates { font-size: 0.8rem; color: #888; background: #f0f0f0; padding: 4px 8px; border-radius: 5px; white-space: nowrap; }

.copy-problem-btn, .link-problem-btn {
    background: white;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.copy-problem-btn { border: 2px solid #667eea; }
.copy-problem-btn:hover { background: #667eea; transform: scale(1.1); }
.copy-problem-btn.copied { background: #4caf50; border-color: #4caf50; color: white; }

.link-problem-btn { border: 2px solid #FF9800; margin-left: 0.5rem; }
.link-problem-btn:hover { background: #FF9800; transform: scale(1.1); }

/* --- Share Card Styles --- */
.btn-share-month {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-share-month:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.date-detail-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f2f5;
}

.btn-share-date {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

.btn-share-date:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.share-card-modal {
    max-width: 480px;
}

.share-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#shareCanvas {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
}

.share-card-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-download-card {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}
