/* Custom styles for Ideal Week Planner v2 */
/* Preserves Sketchy Bootstrap theme aesthetic */

/* Remove navbar border and border-radius */
.navbar {
    border: none !important;
    border-radius: 0 !important;
}

/* Planner Selector - Large clickable name with separate dropdown */
.planner-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.planner-name-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.planner-name-link:hover {
    color: #007bff;
    text-decoration: none;
}

.dropdown-toggle-icon {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: none;
    background: transparent;
}

.dropdown-toggle-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dropdown-toggle-icon::after {
    display: none; /* Remove Bootstrap's default caret */
}

.dropdown-caret {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Disabled button styling */
.btn.disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Profile Dropdown Link with Icon */
.profile-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.profile-dropdown-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #007bff;
    text-decoration: none;
}

.profile-dropdown-link::after {
    display: none; /* Hide Bootstrap's default dropdown caret */
}

.profile-username {
    font-weight: 500;
    font-size: 0.938rem;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1000;
}

.fab:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* Week Grid Styling */
#weekGrid {
    background-color: #fff;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    min-height: 600px;
}

.time-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    z-index: 10;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.time-column {
    min-width: 80px;
    border-right: 1px solid #dee2e6;
}

.time-slot {
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #f1f3f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.day-column {
    min-width: 140px;
    flex: 1;
    border-right: 1px solid #dee2e6;
    position: relative;
}

/* Weekend columns - light grey background */
.day-column.weekend-column {
    background-color: #f8f9fa;
}

.day-column.weekend-column .day-header {
    background-color: #f1f3f5;
}

.day-column.weekend-column .day-content {
    background-color: #f8f9fa;
}

.day-header {
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 9;
    font-size: 0.938rem;
}

.day-content {
    position: relative;
    background: linear-gradient(to bottom, transparent 0%, transparent calc(100% - 1px), #f1f3f5 calc(100% - 1px), #f1f3f5 100%);
}

/* Activity Block Styling */
.activity-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: move;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s, transform 0.1s;
    min-height: 40px;
    user-select: none;
    overflow: hidden;
}

.activity-block:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    z-index: 100;
}

.activity-block.dragging {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    z-index: 200;
}

.activity-block .block-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.125rem;
}

.activity-block .block-time {
    font-size: 0.75rem;
    opacity: 0.85;
    line-height: 1;
    font-weight: 500;
}

/* Edit Icon on Activity Blocks */
.edit-icon {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    font-size: 0.75rem;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.activity-block:hover .edit-icon {
    opacity: 1;
}

.edit-icon:hover {
    background-color: white;
}

/* Resize handles */
.activity-block .resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 5;
}

.activity-block .resize-handle.top {
    top: 0;
}

.activity-block .resize-handle.bottom {
    bottom: 0;
}

.activity-block:hover .resize-handle {
    background: rgba(255, 255, 255, 0.3);
}

/* Color picker styles */
#colorPicker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    display: inline-block;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.15);
}

/* Vibrant activity block colors that pop */
.color-lavender { background-color: #A78BFA; }    /* Vibrant purple */
.color-peach { background-color: #FB923C; }       /* Bright orange */
.color-mint { background-color: #4ADE80; }        /* Bright green */
.color-sky { background-color: #38BDF8; }         /* Bright blue */
.color-rose { background-color: #F472B6; }        /* Hot pink */
.color-lemon { background-color: #FBBF24; }       /* Bright yellow */
.color-coral { background-color: #F87171; }       /* Bright red/coral */
.color-sage { background-color: #86EFAC; }        /* Bright mint */
.color-periwinkle { background-color: #818CF8; }  /* Bright indigo */
.color-cream { background-color: #FDE047; }       /* Bright gold */

/* Day Checkboxes for Multi-Day Selection */
.day-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-notification {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    min-width: 300px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-notification.toast-success {
    border-left-color: #28a745;
}

.toast-notification.toast-error {
    border-left-color: #dc3545;
}

.toast-notification.toast-warning {
    border-left-color: #ffc107;
}

.toast-notification.toast-info {
    border-left-color: #17a2b8;
}

.toast-notification.animate-in {
    animation: slideInRight 0.3s ease-out;
}

.toast-notification.animate-out {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    font-weight: bold;
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    color: #495057;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* Auto-save status */
#autoSaveStatus {
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.3s;
}

#autoSaveStatus.saving {
    color: #ffc107;
}

#autoSaveStatus.saved {
    color: #28a745;
}

#autoSaveStatus.error {
    color: #dc3545;
}

/* Weekend hiding */
.weekend-hidden {
    display: none !important;
}

/* Mobile styles */
@media (max-width: 767.98px) {
    .day-column {
        min-width: calc(100vw - 100px);
        flex: none;
    }

    #weekGrid {
        overflow-x: hidden;
    }

    .activity-block .block-name {
        font-size: 0.938rem;
    }

    .activity-block .block-time {
        font-size: 0.813rem;
    }

    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast-notification {
        min-width: auto;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .fab,
    .edit-icon,
    .resize-handle,
    .modal,
    .toast-container {
        display: none !important;
    }

    #weekGrid {
        box-shadow: none;
    }

    .activity-block {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
