/**
 * Jai Bhole - Unified Sidebar Actions & Modals Styling
 * Responsive, accessible for senior devotees, matching saffron devotional identity.
 */

/* Sidebar Container */
.jb-content-sidebar {
    background: #fffdf9;
    border: 1px solid #ead8bb;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(91, 48, 18, .08);
    box-sizing: border-box;
    padding: 16px;
    position: sticky;
    top: 76px;
    text-align: left;
    width: 100%;
}

.jb-sidebar-header {
    border-bottom: 2px solid #fef3c7;
    margin-bottom: 14px;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jb-sidebar-title {
    color: #8e4119;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sidebar Action Buttons List */
.jb-sidebar-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.jb-sidebar-item {
    margin: 0;
    padding: 0;
}

/* Action Button Base */
.jb-sidebar-action-btn {
    align-items: flex-start;
    background: #ffffff;
    border: 1.5px solid #fed7aa;
    border-radius: 10px;
    box-sizing: border-box;
    color: #431407;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    text-align: left;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.jb-sidebar-action-btn:hover {
    background: #fffaf0;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
    transform: translateY(-1px);
}

.jb-sidebar-action-btn:active {
    transform: translateY(0);
}

/* Action Icon */
.jb-action-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1.2;
    margin-top: 1px;
}

/* Action Content */
.jb-action-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.jb-action-label {
    color: #78350f;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.jb-action-subtext {
    color: #6b7280;
    font-size: 0.76rem;
    line-height: 1.3;
}

/* 1. Favourite Button States */
.jb-sidebar-fav-btn.jb-is-favorite {
    background: #fff1f2;
    border-color: #fca5a5;
}
.jb-sidebar-fav-btn.jb-is-favorite .jb-action-label {
    color: #b91c1c;
}
.jb-sidebar-fav-btn.jb-is-favorite .jb-action-subtext {
    color: #991b1b;
}

/* 2. Daily Task Active State */
.jb-sidebar-task-btn.jb-task-active {
    background: #f0fdf4;
    border-color: #86efac;
}
.jb-sidebar-task-btn.jb-task-active .jb-action-label {
    color: #166534;
}
.jb-sidebar-task-btn.jb-task-active .jb-action-subtext {
    color: #15803d;
}

/* 3. Google Preferred Source */
.jb-sidebar-google-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}
.jb-sidebar-google-btn:hover .jb-action-label {
    color: #1d4ed8;
}

/* 4. WhatsApp Button */
.jb-sidebar-whatsapp-btn {
    border-color: #bbf7d0;
}
.jb-sidebar-whatsapp-btn:hover {
    background: #f0fdf4;
    border-color: #22c55e;
}
.jb-sidebar-whatsapp-btn:hover .jb-action-label {
    color: #15803d;
}

/* 5. YouTube Button */
.jb-sidebar-youtube-btn {
    border-color: #fecaca;
}
.jb-sidebar-youtube-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}
.jb-sidebar-youtube-btn:hover .jb-action-label {
    color: #b91c1c;
}

/* Modals */
.jb-sidebar-modal-backdrop {
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    padding: 16px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 99999;
}

.jb-sidebar-modal-dialog {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
    border-top: 5px solid #d97706;
    max-width: 460px;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.jb-sidebar-modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.jb-sidebar-modal-header h3 {
    color: #92400e;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.jb-sidebar-modal-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 2px 6px;
}

.jb-sidebar-modal-close:hover {
    color: #111827;
}

.jb-modal-form-group {
    margin-bottom: 14px;
}

.jb-modal-form-group label {
    color: #374151;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.jb-modal-input, .jb-modal-select {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.92rem;
    padding: 9px 12px;
    width: 100%;
}

.jb-modal-input:focus, .jb-modal-select:focus {
    border-color: #d97706;
    outline: none;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.jb-modal-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.jb-days-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.jb-day-chip {
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 4px;
    padding: 4px 8px;
}

.jb-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.jb-btn-modal-submit {
    background: #d97706;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    flex: 1;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 11px;
    text-align: center;
}

.jb-btn-modal-submit:hover {
    background: #b45309;
}

.jb-btn-modal-cancel {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #4b5563;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 16px;
}

.jb-btn-modal-cancel:hover {
    background: #e5e7eb;
}

/* Toast */
.jb-sidebar-toast {
    animation: jbToastIn 0.25s ease-out;
    background: #166534;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    left: 50%;
    max-width: 90%;
    padding: 12px 22px;
    position: fixed;
    bottom: 24px;
    text-align: center;
    transform: translateX(-50%);
    z-index: 999999;
}

@keyframes jbToastIn {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Responsive Adaptations */
@media screen and (max-width: 850px) {
    .jb-content-sidebar {
        margin-bottom: 20px;
        position: static;
        width: 100%;
    }
    .jb-sidebar-actions-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media screen and (max-width: 560px) {
    .jb-sidebar-actions-list {
        grid-template-columns: 1fr;
    }
    .jb-sidebar-action-btn {
        min-height: 48px;
        padding: 11px 12px;
    }
    .jb-modal-row {
        grid-template-columns: 1fr;
    }
}
