/**
 * Grantha Storefront — Notification & Purchased Reviews Styles
 */

/* Header Notification Bell */
.header-notification-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-notification-wrapper[hidden], .header-actions [hidden] {
    display: none !important;
}

.header-notification-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--color-text-main, #1e293b);
    padding: 8px;
    border-radius: 50%;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-notification-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-primary, #6366f1);
}

.notification-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 10px;
    border: 2px solid var(--color-bg-body, #ffffff);
}

/* Flyout Dropdown Panel */
.notification-flyout-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-flyout-dropdown[hidden] {
    display: none !important;
}

.notification-flyout-dropdown.active {
    display: flex !important;
}

.notification-flyout-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg-subtle, #f8fafc);
}

.flyout-title {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-main, #0f172a);
}

.flyout-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mark-all-read-btn, .notif-settings-link {
    background: transparent;
    border: none;
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
    text-decoration: none;
    display: inline-flex;
}

.mark-all-read-btn:hover, .notif-settings-link:hover {
    color: var(--color-primary, #6366f1);
    background: rgba(99, 102, 241, 0.1);
}

.notification-flyout-body {
    max-height: 380px;
    overflow-y: auto;
}

.notif-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-muted, #64748b);
}

.notif-empty-state i {
    font-size: 36px;
    margin-bottom: 8px;
}

.notification-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: var(--color-bg-hover, #f8fafc);
}

.notification-item.unread {
    background-color: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--color-primary, #6366f1);
}

.notif-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.notif-item-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text-main, #0f172a);
}

.notif-item-time {
    font-size: 11px;
    color: var(--color-text-muted, #94a3b8);
}

.notif-item-msg {
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-body, #334155);
    margin: 0;
}

.notification-flyout-footer {
    padding: 12px 16px;
    background: var(--color-bg-subtle, #f8fafc);
    border-top: 1px solid var(--color-border-subtle, #e2e8f0);
    text-align: center;
}

.notification-flyout-footer a {
    color: var(--color-primary, #6366f1);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Switch Toggle Component */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Notification Settings Page */
.notification-settings-container {
    background: var(--color-bg-card, #ffffff);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle, #e2e8f0);
}

.notification-pref-card {
    margin-top: 20px;
}

.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.pref-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
}

.pref-info p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted, #64748b);
}

.pref-divider {
    height: 1px;
    background: var(--color-border-subtle, #e2e8f0);
}

.pref-status-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

/* Purchased Books & Reviews Dashboard */
.purchased-reviews-container {
    background: var(--color-bg-card, #ffffff);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle, #e2e8f0);
}

.purchased-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-border-subtle, #e2e8f0);
    padding-bottom: 8px;
}

.purchased-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.purchased-tab-btn.active, .purchased-tab-btn:hover {
    color: var(--color-primary, #6366f1);
    background: rgba(99, 102, 241, 0.1);
}

.purchased-books-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.purchased-book-card {
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    padding: 18px;
    background: var(--color-bg-card, #ffffff);
    transition: box-shadow 0.2s ease;
}

.purchased-book-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.book-card-header {
    display: flex;
    gap: 16px;
}

.book-cover img {
    width: 80px;
    height: 114px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.book-details {
    flex: 1;
}

.book-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
}

.book-title a {
    color: var(--color-text-main, #0f172a);
    text-decoration: none;
}

.book-author, .order-meta {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--color-text-muted, #64748b);
}

.review-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-reviewed {
    background: #dcfce7;
    color: #166534;
}

.status-unreviewed {
    background: #fef3c7;
    color: #92400e;
}

.book-review-content {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--color-border-subtle, #e2e8f0);
}

.review-stars-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.star-filled {
    color: #f59e0b;
}

.star-empty {
    color: #cbd5e1;
}

.review-approval-badge {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #475569;
}

.inline-review-form-drawer {
    margin-top: 16px;
    padding: 20px;
    background: var(--color-bg-subtle, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--color-border-subtle, #cbd5e1);
}

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-field input, .form-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.star-rating-inputs {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
}

.star-rating-inputs input {
    display: none;
}

.star-rating-inputs label {
    font-size: 24px;
    color: #cbd5e1;
    cursor: pointer;
}

.star-rating-inputs input:checked ~ label,
.star-rating-inputs label:hover,
.star-rating-inputs label:hover ~ label {
    color: #f59e0b;
}
