/* Modern BuddyPress/BuddyBoss compatible styling */
form#bppfa-whats-new-form {
    position: relative;
    margin: 0 0 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Form content wrapper */
#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-content {
    overflow: hidden;
    clear: both;
}

form#bppfa-whats-new-form:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Theme compatibility */
.bp-nouveau form#bppfa-whats-new-form,
.buddyboss-theme form#bppfa-whats-new-form {
    background: var(--bb-content-background-color, #fff);
    border-color: var(--bb-content-border-color, #e5e5e5);
}

#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-avatar {
    float: left;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-avatar a {
    display: block;
    position: relative;
}

#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-avatar a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    transition: border-color 0.2s;
}

#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-avatar a:hover::after {
    border-color: var(--bb-primary-color, #007cba);
}

#bppfa-buddypress-widget form#wbppfa-whats-new-form #bppfa-whats-new-avatar{
    text-align: center;
}

#bppfa-buddypress form#bppfa-whats-new-form p.activity-greeting {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    margin-left: 65px;
    color: #333;
    font-weight: 500;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.bp-nouveau #bppfa-buddypress form#bppfa-whats-new-form p.activity-greeting,
.buddyboss-theme #bppfa-buddypress form#bppfa-whats-new-form p.activity-greeting {
    color: var(--bb-headings-color, #333);
}

#bppfa-buddypress-widget form#wbppfa-whats-new-form p.activity-greeting {
    line-height: 1.4;
    text-align: center;
}

#bppfa-buddypress-widget form#wbppfa-whats-new-form textarea,
#bppfa-buddypress form#bppfa-whats-new-form textarea {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    box-sizing: border-box;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    padding: 12px 16px;
    width: 100%;
    min-height: 90px;
    height: 90px;
    resize: vertical;
    transition: all 0.2s ease;
    outline: none;
    clear: both;
    display: block;
    margin-top: 10px;
}

#bppfa-buddypress form#bppfa-whats-new-form textarea:focus {
    background: #fff;
    border-color: var(--bb-primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#bppfa-buddypress form#bppfa-whats-new-form textarea:placeholder {
    color: #999;
}

/* Textarea active state */
#bppfa-buddypress form#bppfa-whats-new-form textarea.active {
    min-height: 90px;
    height: 90px;
}

#bppfa-buddypress-widget #wbppfa-whats-new-options::after,
#bppfa-buddypress #bppfa-whats-new-options::after {
    clear: both;
    content: "";
    display: table;
}

#bppfa-buddypress-widget form#wbppfa-whats-new-form #bppfa-whats-new-submit {
    margin-top: 12px;
    text-align: center;
}

#bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-submit {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
    visibility: visible !important;
    opacity: 1 !important;
    order: 2;
    margin-left: auto;
}

/* Inline feedback message */
.bppfa-feedback-message {
    display: none;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    margin-bottom: 15px;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.bppfa-feedback-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bppfa-feedback-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bppfa-feedback-message svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

div#bppfa-whats-new-options {
    margin: 12px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex !important;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
    overflow: visible;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Group selector modern styling */
#bppfa-whats-new-post-in-box {
    margin: 0;
    flex: 0 0 auto;
    order: 1;
}

#bppfa-whats-new-post-in-box select {
    width: 100%;
    min-width: 180px;
    max-width: 250px;
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2714%27%20height%3D%278%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M1%201l6%206%206-6%27%20stroke%3D%27%23333%27%20stroke-width%3D%272%27%20fill%3D%27none%27%20fill-rule%3D%27evenodd%27%2F%3E%3C%2Fsvg%3E') no-repeat right 12px center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s;
    text-align: left;
}

#bppfa-whats-new-post-in-box select:hover {
    border-color: #bbb;
}

#bppfa-whats-new-post-in-box select:focus {
    outline: none;
    border-color: var(--bb-primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#bppfa-buddypress-widget input[type="submit"],
#bppfa-buddypress-widget input[type="button"],
#bppfa-buddypress input[type="submit"],
#bppfa-buddypress input[type="button"] {
    background: var(--bb-primary-button-background-regular, #007cba);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    text-align: center;
    text-decoration: none;
    padding: 10px 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

#bppfa-buddypress input[type="submit"]:hover,
#bppfa-buddypress input[type="button"]:hover {
    background: var(--bb-primary-button-background-hover, #005a87);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#bppfa-buddypress input[type="submit"]:active,
#bppfa-buddypress input[type="button"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

#bppfa-buddypress input[type="submit"]:disabled,
#bppfa-buddypress input[type="button"]:disabled {
    background: #d1d1d1;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

#bppfa-buddypress input[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: button-loading-spinner 0.8s linear infinite;
}

#bppfa-buddypress input[type="submit"].loading {
    color: transparent;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}


#bppfa-whats-new-avatar img.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    vertical-align: middle;
    transition: transform 0.2s ease;
    display: block;
}

#bppfa-whats-new-avatar a:hover img.avatar {
    transform: scale(1.05);
}

.bppfa-spinner,
.wbppfa-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--bb-primary-color, #007cba);
    border-radius: 50%;
    animation: bppfa-spin 0.8s linear infinite;
    margin-left: 0;
}

.wbppfa-spinner {
    vertical-align: middle;
}

@keyframes bppfa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



#bppfa-whats-new-options .post-elements-buttons-item {
    margin-right: 10px;
    margin-top: 10px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    line-height: 1;
}

/* BuddyPress Checkin */
body .bpchk-marker-container {
    margin-left: 0;
}

body .bp-checkins.bp-checkin-panel {
    width: 100%;
    margin-left: 0;
}

/* BuddyPress Quote */
body .quote-btn {
    margin-left: 0;    
}

body.bp-nouveau .bpquotes-bg-selection-div {
    margin: 0;
}

/* BuddyPress Polls */
body.bp-nouveau .bpolls-polls-option-html {
    width: 100%;
    margin-left: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    form#bppfa-whats-new-form {
        padding: 15px;
    }
    
    #bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-avatar {
        float: none;
        margin-bottom: 15px;
        text-align: center;
    }
    
    #bppfa-buddypress form#bppfa-whats-new-form p.activity-greeting {
        margin-left: 0;
        text-align: center;
        font-size: 15px;
        min-height: auto;
    }
    
    #bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-submit {
        width: 100%;
    }
    
    div#bppfa-whats-new-options[style*="display: block"] {
        flex-direction: column !important;
        gap: 12px;
    }
    
    #bppfa-whats-new-post-in-box {
        max-width: 100%;
        order: 1;
    }
    
    #bppfa-buddypress form#bppfa-whats-new-form #bppfa-whats-new-submit {
        order: 2;
        justify-content: center;
    }
    
    #bppfa-buddypress input[type="submit"] {
        width: 100%;
    }
    
    .bppfa-feedback-message {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    #bppfa-whats-new-post-in-box select {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .buddyboss-theme-dark form#bppfa-whats-new-form,
    .bp-dark-mode form#bppfa-whats-new-form {
        background: var(--bb-block-bg-color-dark, #1a1a1a);
        border-color: var(--bb-block-border-color-dark, #333);
    }
    
    .buddyboss-theme-dark #bppfa-buddypress form#bppfa-whats-new-form textarea,
    .bp-dark-mode #bppfa-buddypress form#bppfa-whats-new-form textarea {
        background: var(--bb-input-bg-color-dark, #2a2a2a);
        color: var(--bb-body-text-color-dark, #ccc);
        border-color: var(--bb-input-border-color-dark, #444);
    }
    
    .buddyboss-theme-dark #bppfa-buddypress form#bppfa-whats-new-form textarea:focus,
    .bp-dark-mode #bppfa-buddypress form#bppfa-whats-new-form textarea:focus {
        background: var(--bb-input-bg-color-dark-focus, #333);
    }
}