/**
 * Birthday Block for BuddyPress Frontend Styles
 *
 * Styles for the birthday block on the frontend
 * Designed to match BuddyPress default styling
 *
 * @package buddypress-birthday
 */

.bp-birthday-block {
    margin: 0 0 20px;
    clear: both;

    .bp-birthday-title {
        margin: 0 0 15px;
        font-size: 1.3em;
        font-weight: 600;
        color: #333;
        line-height: 1.4;
    }

    .bp-birthday-list {
        list-style: none;
        margin: 0;
        padding: 0;

        &.item-list {
            // Match BuddyPress item-list styles
            border-top: 0;
        }
    }

    .bp-birthday-item {
        margin: 0 0 15px;
        padding: 15px;
        background: #fff;
        border: 1px solid #e6e6e6;
        border-radius: 4px;
        display: flex;
        align-items: flex-start;
        transition: all 0.2s ease;

        &:last-child {
            margin-bottom: 0;
        }

        &:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-color: #d5d5d5;
        }

        .item-avatar {
            margin-right: 15px;
            flex-shrink: 0;

            a {
                display: block;
                line-height: 1;
            }

            img.avatar {
                border-radius: 50%;
                width: 50px;
                height: 50px;
                display: block;
                border: 2px solid #f5f5f5;
            }
        }

        .item {
            flex: 1;
            min-width: 0;
        }

        .item-title {
            margin: 0 0 8px;
            font-size: 1.1em;
            line-height: 1.3;

            a {
                color: #333;
                text-decoration: none;
                font-weight: 600;
                transition: color 0.2s ease;

                &:hover {
                    color: #0073aa;
                }
            }
        }

        .item-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 0.9em;
            color: #666;
            margin-bottom: 10px;
            line-height: 1.5;

            span {
                display: inline-block;

                &:not(:last-child):after {
                    content: '·';
                    margin-left: 12px;
                    color: #999;
                }
            }

            .bp-birthday-date {
                font-weight: 500;
                color: #555;
            }

            .bp-birthday-today {
                color: #46b450;
                font-weight: 600;
            }

            .bp-birthday-soon {
                color: #00a0d2;
                font-weight: 600;
            }

            .bp-birthday-days {
                color: #666;
            }

            .bp-birthday-age {
                color: #777;
            }
        }

        .action {
            margin-top: 10px;

            .button {
                font-size: 0.85em;
                padding: 6px 14px;
                background: #f7f7f7;
                border: 1px solid #ccc;
                border-radius: 3px;
                color: #555;
                text-decoration: none;
                display: inline-block;
                transition: all 0.2s ease;
                cursor: pointer;

                &:hover {
                    background: #0073aa;
                    border-color: #0073aa;
                    color: #fff;
                }

                &:focus {
                    outline: 2px solid #0073aa;
                    outline-offset: 2px;
                }
            }
        }
    }

    .bp-birthday-empty {
        padding: 30px 20px;
        text-align: center;
        color: #666;
        font-style: italic;
        background: #f9f9f9;
        border: 1px dashed #ddd;
        border-radius: 4px;
        margin: 0;
    }

    .bp-birthday-block-error {
        padding: 15px 20px;
        background: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 4px;
        color: #856404;
        margin: 0 0 20px;

        p {
            margin: 0;
            line-height: 1.6;
        }

        a {
            color: #856404;
            text-decoration: underline;
            font-weight: 600;

            &:hover {
                color: #533f03;
            }
        }
    }
}

// Responsive adjustments
@media screen and (max-width: 600px) {
    .bp-birthday-block {
        .bp-birthday-title {
            font-size: 1.2em;
        }

        .bp-birthday-item {
            flex-direction: column;
            padding: 12px;

            .item-avatar {
                margin: 0 0 12px;

                img.avatar {
                    width: 60px;
                    height: 60px;
                }
            }

            .item-meta {
                flex-direction: column;
                gap: 6px !important;

                span:not(:last-child):after {
                    display: none;
                }
            }
        }
    }
}

// Dark mode support (if theme supports it)
@media (prefers-color-scheme: dark) {
    .bp-birthday-block {
        
        .bp-birthday-item {
            border-color: #333;

            &:hover {
                border-color: #444;
            }

            .item-title a {
                // color: #f0f0f0;

                &:hover {
                    color: #4a9eff;
                }
            }

            .item-meta {
                color: #ccc;
            }

            .action .button {
                background: #2a2a2a;
                border-color: #444;
                color: #ddd;

                &:hover {
                    background: #4a9eff;
                    border-color: #4a9eff;
                    color: #fff;
                }
            }
        }

        .bp-birthday-empty {
            background: #1e1e1e;
            border-color: #444;
            color: #ccc;
        }
    }
}
