/**
 * Disable Admin Notices Individually - Admin Styles
 * 
 * Styles for the hide buttons and notice modifications
 */

/* Hide control wrapper (top-left) */
.unno-hide-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 15px;
    margin: 0 0 12px 0;
    padding: 8px 0;
    background: none;
    border: 0;
    border-radius: 4px;
    backdrop-filter: blur(2px);
}

/* Button group - left column */
.unno-buttons-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Button styling */
.unno-hide-notice.button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 8px;
    min-height: auto;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.unno-hide-notice.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.unno-hide-notice.button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

/* "Hide for me" button styling */
.unno-hide-for-user {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #3c434a;
}

.unno-hide-for-user:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #1d2327;
}

/* "Hide for all" button styling (primary) */
.unno-hide-for-all.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
}

.unno-hide-for-all.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #ffffff;
}

/* Icon styling */
.unno-hide-notice .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 1;
}

/* Plugin info styling - right column */
.unno-plugin-info {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.unno-plugin-info small {
    font-size: 11px;
    line-height: 1.3;
    color: #666;
    font-style: italic;
    white-space: nowrap;
}

.unno-plugin-info a {
    color: #0073aa;
    text-decoration: none;
}

.unno-plugin-info a:hover {
    text-decoration: underline;
}

/* Notice wrapper modifications */
.notice.unno-notice-wrapper,
.notice:has(.unno-hide-button-wrapper) {
    position: relative;
}

/* Loading state for hide button */
.unno-hide-notice.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.unno-hide-notice.loading .dashicons {
    animation: unno-spin 1s linear infinite;
}

/* Animation for hiding notices */
.unno-notice-hiding {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.unno-notice-hidden {
    display: none;
}

/* Spinner animation */
@keyframes unno-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Rotation animation for loading spinner */
@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .unno-hide-button-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .unno-buttons-group {
        justify-content: center;
    }

    .unno-plugin-info {
        justify-content: center;
    }

    .unno-plugin-info small {
        white-space: normal;
        text-align: center;
        font-size: 10px;
    }

    .unno-hide-notice.button {
        font-size: 11px;
        padding: 3px 6px;
    }

    .unno-hide-notice .dashicons {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
}

@media screen and (max-width: 480px) {
    .unno-buttons-group {
        flex-direction: column;
        gap: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .unno-hide-notice.button,
    .unno-notice-hiding {
        transition: none;
    }

    .unno-hide-notice.loading .dashicons {
        animation: none;
    }
}

/* Hidden notices management styles */
.unno-hidden-notices-details {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.unno-hidden-notices-details summary {
    padding: 10px 15px;
    cursor: pointer;
    background: #f0f0f1;
    border-bottom: 1px solid #ddd;
    font-weight: 500;
    user-select: none;
    transition: background-color 0.2s ease;
}

.unno-hidden-notices-details summary:hover {
    background: #e8e8e9;
}

.unno-hidden-notices-details summary:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.unno-hidden-notices-details[open] summary {
    border-bottom: 1px solid #ddd;
}

/* Table wrapper for scrolling */
.unno-hidden-notices-table-wrapper {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}

/* Table styles */
.unno-hidden-notices-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.unno-hidden-notices-table thead {
    background: #f1f1f1;
    color: #23282d;
    border-bottom: 2px solid #ddd;
}

.unno-hidden-notices-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #ddd;
}

.unno-hidden-notices-table th:last-child {
    border-right: none;
}

.unno-hidden-notices-table tbody tr {
    background: #fff;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e5e5e5;
}

.unno-hidden-notices-table tbody tr:hover {
    background: #f9f9f9;
}

.unno-hidden-notices-table td {
    padding: 12px 10px;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.4;
}

/* Column specific styles */
.unno-plugin-column,
.unno-plugin-cell {
    width: 20%;
    min-width: 120px;
}

.unno-content-column,
.unno-content-cell {
    width: 45%;
    min-width: 200px;
}

.unno-user-column,
.unno-user-cell {
    width: 20%;
    min-width: 110px;
}

.unno-actions-column,
.unno-actions-cell {
    width: 15%;
    min-width: 100px;
    text-align: center;
}

/* Plugin cell styling */
.unno-plugin-cell strong {
    color: #2271b1;
    font-weight: 600;
    display: block;
}

/* Content cell styling */
.unno-content-cell {
    position: relative;
}

.unno-notice-excerpt {
    display: block;
    margin-bottom: 4px;
    line-height: 1.3;
    color: #333;
    font-weight: 400;
}

.unno-notice-id {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: #666;
    background: #f1f1f1;
    padding: 2px 4px;
    border-radius: 2px;
    display: inline-block;
}


/* Action cell styling */
.unno-actions-cell .button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 4px 8px;
    min-height: auto;
    line-height: 1.2;
    white-space: nowrap;
}

.unno-actions-cell .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.unno-actions-cell .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty state for hidden notices */
.unno-hidden-notices-table-wrapper:empty::before {
    content: "No hidden notices found.";
    display: block;
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 0;
}

/* Animation for removing table rows */
@keyframes fadeOutRow {
    0% {
        opacity: 1;
        transform: translateX(0);
        max-height: 60px;
    }
    50% {
        opacity: 0;
        transform: translateX(-20px);
        max-height: 60px;
    }
    100% {
        opacity: 0;
        transform: translateX(-20px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom-width: 0;
    }
}

.unno-notice-row.removing,
.wp-list-table.hiddennotices tr.removing {
    animation: fadeOutRow 0.4s ease-out forwards;
}

/* Responsive adjustments for tables */
@media screen and (max-width: 1200px) {
    .unno-content-column,
    .unno-content-cell {
        width: 40%;
    }
    
    .unno-plugin-column,
    .unno-plugin-cell {
        width: 25%;
    }
}

@media screen and (max-width: 782px) {
    .unno-hidden-notices-table-wrapper {
        padding: 10px;
        max-height: 300px;
    }
    
    .unno-hidden-notices-table {
        font-size: 12px;
    }
    
    .unno-hidden-notices-table th,
    .unno-hidden-notices-table td {
        padding: 8px 6px;
    }
    
    .unno-hidden-notices-table th {
        font-size: 11px;
    }
    
    /* Stack table on very small screens */
    .unno-hidden-notices-table,
    .unno-hidden-notices-table thead,
    .unno-hidden-notices-table tbody,
    .unno-hidden-notices-table th,
    .unno-hidden-notices-table td,
    .unno-hidden-notices-table tr {
        display: block;
    }
    
    .unno-hidden-notices-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .unno-hidden-notices-table tr {
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
        background: #fff;
    }
    
    .unno-hidden-notices-table td {
        border: none;
        padding: 5px 0;
        position: relative;
        padding-left: 30%;
    }
    
    .unno-hidden-notices-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        top: 5px;
        font-weight: 600;
        color: #2271b1;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .unno-actions-cell {
        text-align: left;
    }
}

/* RTL support */
.rtl .unno-hide-button-wrapper {
    flex-direction: row-reverse;
}

.rtl .unno-buttons-group {
    flex-direction: row-reverse;
}

.rtl .unno-plugin-info {
    text-align: left;
}

.rtl .unno-notice-item .unno-notice-id {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .unno-notice-item .unno-notice-date {
    margin-right: 0;
    margin-left: 10px;
}

/**
 * Review Notice Component Styles
 * 
 * Beautiful notice encouraging users to rate the plugin
 * and provide feedback.
 * 
 * @since 1.2.5
 */

/**
 * Review Notice Container
 */
.unno-review-notice {
    border-left-color: #2271b1;
    padding: 0 !important;
    margin: 20px 0 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/**
 * Review Notice Content
 */
.unno-review-notice__content {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, #f0f6fc 0%, #ffffff 100%);
}

/**
 * Review Notice Icon
 */
.unno-review-notice__icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.unno-review-notice__icon .dashicons {
    color: #fff;
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 1;
}

/**
 * Review Notice Text Container
 */
.unno-review-notice__text {
    flex: 1;
}

/**
 * Review Notice Title
 */
.unno-review-notice__title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.4;
}

/**
 * Review Notice Message
 */
.unno-review-notice__message {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #50575e;
}

.unno-review-notice__message:last-of-type {
    margin-bottom: 16px;
}

.unno-review-notice__message strong {
    color: #2271b1;
    font-weight: 600;
}

/**
 * Review Notice Actions
 */
.unno-review-notice__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/**
 * Review Notice Buttons
 */
.unno-review-notice__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
    vertical-align: middle;
    height: auto;
    min-height: 32px;
}

.unno-review-notice__button::before {
    display: none;
}

.unno-review-notice__button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0;
    position: static;
    top: auto;
    left: auto;
}

.unno-review-notice__button {
    text-align: center;
}

.unno-review-notice__button.button-primary {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-color: #135e96;
    color: #fff;
}

.unno-review-notice__button.button-primary:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4b78 100%);
    border-color: #0a4b78;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.unno-review-notice__button.button-secondary {
    background: #fff;
    border-color: #c3c4c7;
    color: #2c3338;
}

.unno-review-notice__button.button-secondary:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
    color: #1d2327;
}

/**
 * Review Notice Dismiss Button
 */
.unno-review-notice__dismiss {
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #787c82;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.unno-review-notice__dismiss:hover {
    opacity: 1;
    color: #1d2327;
}

.unno-review-notice__dismiss .screen-reader-text {
    position: absolute;
    left: -9999px;
}

/**
 * Responsive Design
 */
@media screen and (max-width: 782px) {
    .unno-review-notice {
        margin: 15px 0 10px;
    }
    
    .unno-review-notice__content {
        flex-direction: column;
        padding: 15px;
    }
    
    .unno-review-notice__icon {
        margin-right: 0;
        margin-bottom: 15px;
        align-self: center;
    }
    
    .unno-review-notice__actions {
        flex-direction: column;
        width: 100%;
    }
    
    .unno-review-notice__button {
        width: 100%;
        justify-content: center;
    }
    
    .unno-review-notice__dismiss {
        margin-left: 0;
        margin-top: 10px;
        align-self: flex-end;
    }
}

@media screen and (max-width: 480px) {
    .unno-review-notice__title {
        font-size: 16px;
    }
    
    .unno-review-notice__message {
        font-size: 13px;
    }
    
    .unno-review-notice__button {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/**
 * Reduced motion support
 */
@media (prefers-reduced-motion: reduce) {
    .unno-review-notice__button,
    .unno-review-notice__dismiss {
        transition: none;
    }
}

/**
 * Unnotifier Panel Integration in Review Notice
 * 
 * Styles for the Unnotifier hide button panel when displayed
 * inside the Review Notice - adapted to match Review Notice design.
 * 
 * @since 1.2.5
 */

/* Hide button wrapper inside review notice - adapt colors only */
.unno-review-notice .unno-hide-button-wrapper {
    background: rgba(240, 246, 252, 0.6);
    border-bottom: 1px solid rgba(34, 113, 177, 0.15);
    padding: 12px 20px;
    margin-bottom: 0;
}

/* Button group inside review notice - keep structure */
.unno-review-notice .unno-buttons-group {
    /* Keep original structure */
}

/* Hide buttons inside review notice - adapt colors to match Review Notice */
.unno-review-notice .unno-hide-for-user {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(34, 113, 177, 0.3);
    color: #2271b1;
}

.unno-review-notice .unno-hide-for-user:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #2271b1;
    color: #135e96;
}

.unno-review-notice .unno-hide-for-all.button-primary {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-color: #135e96;
    color: #ffffff;
}

.unno-review-notice .unno-hide-for-all.button-primary:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4b78 100%);
    border-color: #0a4b78;
    color: #ffffff;
}

/* Plugin info inside review notice - adapt colors */
.unno-review-notice .unno-plugin-info small {
    color: #50575e;
}

.unno-review-notice .unno-plugin-info strong {
    color: #2271b1;
    font-weight: 600;
}

.unno-review-notice .unno-plugin-info a {
    color: #2271b1;
    font-weight: 500;
}

.unno-review-notice .unno-plugin-info a:hover {
    color: #135e96;
}

/**
 * Settings Tabs Styling
 */
.nav-tab-wrapper {
    margin-bottom: 0;
}

h1.nav-tab-wrapper,
.wrap h2.nav-tab-wrapper,
.nav-tab-wrapper {
    border-bottom: none;
}

.nav-tab-wrapper .nav-tab {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-color: transparent;
    background: #f6f7f7;
    color: #1d2327;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-tab-wrapper .nav-tab:hover {
    background: #e8f1fb;
    border-color: #2271b1;
    color: #135e96;
}

.nav-tab-wrapper .nav-tab-active {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
    border-color: #135e96;
    box-shadow: 0 2px 4px rgba(19, 94, 150, 0.2);
}

.unno-settings-content {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/**
 * Hidden notices table column widths
 */
.wp-list-table.hiddennotices .column-plugin {
    width: 300px;
}

.wp-list-table.hiddennotices .column-hidden_by {
    width: 130px;
}

.wp-list-table.hiddennotices .column-actions {
    width: 100px;
}

/**
 * Elementor Notice Integration
 * 
 * Elementor notices (.e-notice) use display: flex, which causes
 * unno-hide-button-wrapper to appear as a column instead of above the content.
 * Fix: add flex-wrap and make buttons take full width of the first row.
 * Additionally, style the buttons wrapper in Elementor's design language
 * (Roboto font, matching colors via Elementor CSS variables).
 * 
 * @since 1.2.6
 */

/* Force flex-wrap on Elementor notices containing our buttons */
.e-notice:has(> .unno-hide-button-wrapper) {
    flex-wrap: wrap;
}

/* Buttons wrapper inside Elementor notice - full width first row + Elementor styling */
.e-notice > .unno-hide-button-wrapper {
    width: 100%;
    flex-shrink: 0;
    padding: 10px 15px;
    margin: 0;
    box-sizing: border-box !important;
    font-family: Roboto, Arial, Helvetica, sans-serif;
    background: var(--e-notice-context-tint, rgba(240, 246, 252, 0.5));
    border-bottom: 1px solid var(--e-notice-border-color, rgba(34, 113, 177, 0.15));
}

/* Elementor-styled buttons inside e-notice */
.e-notice > .unno-hide-button-wrapper .unno-hide-notice.button {
    font-family: Roboto, Arial, Helvetica, sans-serif;
}

/* Elementor-styled plugin info text inside e-notice */
.e-notice > .unno-hide-button-wrapper .unno-plugin-info small {
    font-family: Roboto, Arial, Helvetica, sans-serif;
}

/* Responsive adjustments for Elementor notices */
@media screen and (max-width: 782px) {
    .e-notice > .unno-hide-button-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .e-notice > .unno-hide-button-wrapper .unno-buttons-group {
        justify-content: center;
    }
}

/**
 * Disable Comments Notice Integration
 * 
 * Disable Comments plugin notices (.disable__comment__alert) use display: flex.
 * Fix: add flex-wrap and make buttons take full width of the first row.
 * 
 * @since 1.2.6
 */

/* Force flex-wrap on Disable Comments notices containing our buttons */
.disable__comment__alert:has(> .unno-hide-button-wrapper) {
    flex-wrap: wrap;
}

/* Buttons wrapper inside Disable Comments notice - full width first row */
.disable__comment__alert > .unno-hide-button-wrapper {
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 10px 15px;
    margin: 0 0 10px 0;
    background: rgba(240, 246, 252, 0.5);
    border-bottom: 1px solid rgba(34, 113, 177, 0.15);
}

/* Responsive adjustments for Disable Comments notices */
@media screen and (max-width: 782px) {
    .disable__comment__alert > .unno-hide-button-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .disable__comment__alert > .unno-hide-button-wrapper .unno-buttons-group {
        justify-content: center;
    }
}
