/* ===================================
   WEEKLY VIEW & NOTES - v3.5.1
   =================================== */

/* Weekly View Modal - Centered */
#weekly-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#weekly-view-modal.active {
    display: flex;
}

.weekly-modal-content {
    background: var(--bg-color, #1a1a1a);
    border-radius: 16px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.weekly-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color, #333);
    position: sticky;
    top: 0;
    background: var(--bg-color, #1a1a1a);
    z-index: 10;
}

.weekly-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color, #4a9eff);
}

.weekly-close-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-color, #fff);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.weekly-close-btn:hover {
    background: var(--secondary-bg, #2a2a2a);
    transform: rotate(90deg);
}

/* Weekly View Container */
#weekly-view-container {
    padding: 0;
}

.weekly-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: 8px;
    margin-bottom: 16px;
    gap: 12px;
}

.weekly-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
    text-align: center;
}

/* Weekly Grid - Single Row with Horizontal Scroll */
.weekly-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-behavior: smooth;
}

.weekly-day {
    flex: 0 0 auto;
    min-width: 200px;
    width: 200px;
    background: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.weekly-day:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.weekly-day.today {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.weekly-day.weekend {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, rgba(255, 152, 0, 0.1) 100%);
}

.weekly-day-header {
    padding: 12px;
    background: var(--tertiary-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weekly-day-name {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.weekly-day-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.weekly-day.today .weekly-day-number {
    color: var(--primary-color);
}

.btn-icon-small {
    padding: 4px 8px;
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.weekly-day-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* Weekly Activities */
.weekly-activity,
.weekly-todo {
    padding: 10px;
    background: var(--tertiary-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--accent-color);
}

.weekly-activity:hover,
.weekly-todo:hover {
    background: var(--accent-color);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.weekly-activity.completed,
.weekly-todo.completed {
    opacity: 0.6;
}

.weekly-activity-header,
.weekly-todo-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.activity-checkbox,
.todo-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.activity-index {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 18px;
}

.tag-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-weight: 600;
}

.priority-badge {
    font-size: 14px;
}

.weekly-activity-text,
.weekly-todo-title {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.4;
    word-break: break-word;
}

.weekly-activity.completed .weekly-activity-text,
.weekly-todo.completed .weekly-todo-title {
    text-decoration: line-through;
}

.weekly-activity-time,
.weekly-todo-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.weekly-todo-label {
    font-size: 9px;
    background: var(--success-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Attachments Panel */
#attachments-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#attachments-panel.active {
    display: flex;
}

.attachments-selector {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: 8px;
    margin-bottom: 20px;
}

.attachments-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.attachments-selector input[type="date"] {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.activities-notes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-note-item {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--border-color);
}

.activity-note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.activity-index {
    color: var(--primary-color);
    font-weight: 700;
}

.activity-text {
    color: var(--text-color);
}

.notes-section h4,
.attachments-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Button Styles */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-color-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Notes System */
.notes-section {
    margin-top: 16px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.notes-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.note-item {
    padding: 12px;
    background: var(--tertiary-bg);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
    margin-bottom: 8px;
}

.note-content {
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 13px;
    word-break: break-word;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-date {
    font-size: 11px;
    color: var(--text-muted);
}

.note-actions {
    display: flex;
    gap: 6px;
}

.btn-danger {
    background: var(--error-color) !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
}

.no-notes {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .weekly-day {
        min-width: 160px;
        width: 160px;
    }
    
    .weekly-title {
        font-size: 14px;
    }
    
    .weekly-day-content {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .weekly-day {
        min-width: 140px;
        width: 140px;
    }
    
    .weekly-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .weekly-title {
        font-size: 13px;
        width: 100%;
    }
}
