/* === HairAide Style Board v1.0 === */

/* === Inline + Button on H2 === */
.hasb-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid #ccc;
    border-radius: 50%;
    background: transparent;
    color: #999;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 8px;
    padding: 0;
    opacity: 0.6;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.hasb-add-btn:hover {
    opacity: 1;
    border-color: #D4919A;
    color: #D4919A;
}

.hasb-add-btn:active {
    transform: scale(0.9);
}

.hasb-add-btn.hasb-saved {
    opacity: 1;
    background: #E8B4B8;
    border-color: #E8B4B8;
    color: #fff;
    font-size: 12px;
}

/* === Floating Indicator === */
#hasb-indicator {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9990;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e8d8da;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    cursor: pointer;
    animation: hasb-slide-up 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

#hasb-indicator.hasb-visible {
    display: flex;
}

.hasb-indicator-icon {
    width: 20px;
    height: 20px;
    background: #E8B4B8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    flex-shrink: 0;
}

.hasb-indicator-text {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

/* === Toast === */
.hasb-toast {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    z-index: 10001;
    padding: 8px 18px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
}

.hasb-toast.hasb-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === Panel Overlay === */
.hasb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9991;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hasb-overlay.hasb-active {
    opacity: 1;
}

/* === Slide-in Panel === */
.hasb-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #fff;
    z-index: 9992;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.hasb-panel.hasb-active {
    transform: translateX(0);
}

/* Panel Header */
.hasb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0e8e9;
    flex-shrink: 0;
}

.hasb-panel-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0;
}

.hasb-panel-count {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-left: 8px;
}

.hasb-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.hasb-panel-close:hover {
    background: #f5f0f1;
    color: #666;
}

/* Panel Body (scrollable) */
.hasb-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Empty State */
.hasb-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.hasb-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.hasb-empty-text {
    font-size: 14px;
    line-height: 1.5;
}

/* Style Card */
.hasb-card {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f0f1;
    position: relative;
}

.hasb-card:last-child {
    border-bottom: none;
}

.hasb-card-img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f0f1;
}

.hasb-card-info {
    flex: 1;
    min-width: 0;
}

.hasb-card-name {
    font-weight: 700;
    font-size: 14px;
    color: #2c2c2c;
    margin-bottom: 3px;
}

.hasb-card-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.hasb-card-source {
    font-size: 11px;
    color: #D4919A;
    text-decoration: none;
}

.hasb-card-source:hover {
    text-decoration: underline;
}

.hasb-card-remove {
    position: absolute;
    top: 12px;
    right: 0;
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.hasb-card-remove:hover {
    color: #e74c3c;
    background: #fdf0f0;
}

/* Panel Footer */
.hasb-panel-footer {
    border-top: 1px solid #f0e8e9;
    padding: 16px 20px;
    flex-shrink: 0;
}

/* Clear All */
.hasb-clear-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid #e0d8da;
    border-radius: 8px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.hasb-clear-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fdf0f0;
}

/* Email Capture */
.hasb-email-section {
    margin-bottom: 12px;
}

.hasb-email-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.hasb-email-row {
    display: flex;
    gap: 8px;
}

.hasb-email-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #e0d8da;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.hasb-email-input:focus {
    border-color: #D4919A;
}

.hasb-email-input::placeholder {
    color: #bbb;
}

.hasb-email-send {
    padding: 10px 18px;
    background: #D4919A;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    font-family: inherit;
}

.hasb-email-send:hover {
    background: #c07e88;
}

.hasb-email-send:disabled {
    background: #ddd;
    cursor: default;
}

.hasb-email-status {
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

.hasb-email-status.hasb-success {
    color: #27ae60;
}

.hasb-email-status.hasb-error {
    color: #e74c3c;
}

/* Share Link */
.hasb-share-row {
    display: flex;
    gap: 8px;
}

.hasb-share-btn {
    flex: 1;
    padding: 8px;
    background: #FDF8F5;
    border: 1px solid #e8d8da;
    border-radius: 8px;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: center;
}

.hasb-share-btn:hover {
    background: #f5eded;
    border-color: #D4919A;
}

/* === Animations === */
@keyframes hasb-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Mobile === */
@media (max-width: 600px) {
    .hasb-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 85vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .hasb-panel.hasb-active {
        transform: translateY(0);
    }

    #hasb-indicator {
        left: 16px;
        right: 16px;
        bottom: 80px;
        justify-content: center;
        border-radius: 12px;
    }

    .hasb-toast {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(12px);
        text-align: center;
        white-space: normal;
    }

    .hasb-toast.hasb-toast-show {
        transform: translateX(0) translateY(0);
    }

    .hasb-add-btn {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .hasb-add-btn.hasb-saved {
        font-size: 13px;
    }
}
