// ==========================================================================
// Comments Press Zone - Base Styles
// ==========================================================================
// Core layout, sidebar, loading states, and buttons.
// Converted from main.css lines 286-600.
// ==========================================================================
// Note: variables and mixins are already imported globally in main.scss
// ==========================================================================


// ==========================================================================
// WP Admin Overrides - Canvas Mode Isolation
// ==========================================================================

#wpcontent,
#wpbody-content,
#wpfooter,
#wpwrap {
    background: $presszone-comments-bg !important;

    @include dark-mode-class {
        background: $presszone-comments-surface-dark !important;
    }
}

html.presszone-comments-dark,
body.presszone-comments-dark {
    background: $presszone-comments-bg-dark;
}

// ==========================================================================
// Layout
// ==========================================================================

.presszone-comments-admin {
    display: flex;
    min-height: calc(100vh - 46px);
    background: $presszone-comments-bg;
    color: $presszone-comments-text;
    font-family: $presszone-comments-font;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    @include dark-mode-class {
        background: $presszone-comments-bg-dark;
        color: $presszone-comments-text-dark;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-weight: 600;
    }

    @include respond-to(md) {
        flex-direction: column;
        min-height: auto;
        overflow-x: hidden;
        max-width: 100vw;
    }
}

.presszone-comments-admin-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;

    @include respond-to(md) {
        margin: 5px;
        padding: 0;
        padding-top: 60px;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
}

// ==========================================================================
// Sidebar
// ==========================================================================

.presszone-comments-sidebar {
    width: 220px;
    background: $presszone-comments-glass-bg;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-inline-end: 1px solid $presszone-comments-border;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;

    @include dark-mode-class {
        background: $presszone-comments-glass-bg-dark;
        border-inline-end-color: $presszone-comments-border-dark;
    }

    @include respond-to(md) {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform $presszone-comments-duration-normal $presszone-comments-ease-smooth;
        z-index: 100000;
        border-inline-end: 1px solid $presszone-comments-border;
        border-bottom: none;

        @include dark-mode-class {
            border-inline-end-color: $presszone-comments-border-dark;
        }
    }

    &__header {
        padding: 20px 16px;
        border-bottom: 1px solid $presszone-comments-border;

        @include dark-mode-class {
            border-bottom-color: $presszone-comments-border-dark;
        }

        @include respond-to(md) {
            display: block;
        }
    }

    &__title {
        font-size: 18px;
        font-weight: 600;
        margin: 0;
        color: $presszone-comments-primary;

        @include dark-mode-class {
            color: $presszone-comments-primary-dark;
        }
    }

    &__version {
        font-size: 11px;
        color: $presszone-comments-text-muted;

        @include dark-mode-class {
            color: $presszone-comments-text-muted-dark;
        }
    }

    &__nav {
        padding: 12px 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;

        @include respond-to(md) {
            flex-direction: column;
            padding: 12px 8px;
            gap: 4px;
            overflow-x: visible;
        }
    }

    &__link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: $presszone-comments-radius;
        color: $presszone-comments-text-muted;
        text-decoration: none;
        transition: all $presszone-comments-duration-fast $presszone-comments-ease-smooth;

        @include dark-mode-class {
            color: $presszone-comments-text-muted-dark;
        }

        &:hover {
            background: $presszone-comments-surface-2;
            color: $presszone-comments-text;

            @include dark-mode-class {
                background: $presszone-comments-surface-2-dark;
                color: $presszone-comments-text-dark;
            }
        }

        &--active {
            background: $presszone-comments-primary-dim;
            color: $presszone-comments-primary;
            border-inline-start: 3px solid $presszone-comments-primary;
            border-start-start-radius: 0;
            border-end-start-radius: 0;
            padding-inline-start: 9px;

            @include dark-mode-class {
                background: $presszone-comments-primary-dim-dark;
                color: $presszone-comments-primary-dark;
                border-inline-start-color: $presszone-comments-primary-dark;
            }
        }

        @include respond-to(md) {
            padding: 12px 16px;
            border-radius: 8px;
            background: transparent;
            white-space: normal;
            font-size: 14px;

            &:hover {
                background: $presszone-comments-surface-2;

                @include dark-mode-class {
                    background: $presszone-comments-surface-2-dark;
                }
            }

            &--active {
                background: $presszone-comments-primary;
                color: $presszone-comments-text-on-primary;

                @include dark-mode-class {
                    background: $presszone-comments-primary-dark;
                    color: $presszone-comments-text-on-primary-dark;
                }

                .presszone-comments-sidebar__icon {
                    color: $presszone-comments-text-on-primary;

                    @include dark-mode-class {
                        color: $presszone-comments-text-on-primary-dark;
                    }
                }
            }
        }
    }

    &__icon {
        font-size: 16px;
    }
}

// Sidebar open state (mobile)
.presszone-comments-sidebar-open {
    .presszone-comments-sidebar {
        transform: translateX(0);
    }

    .presszone-comments-sidebar-overlay {
        @include respond-to(md) {
            display: block;
        }
    }

    .presszone-comments-hamburger__bar {
        &:nth-child(1) {
            @include respond-to(md) {
                transform: rotate(45deg) translate(4px, 4px);
            }
        }

        &:nth-child(2) {
            @include respond-to(md) {
                opacity: 0;
            }
        }

        &:nth-child(3) {
            @include respond-to(md) {
                transform: rotate(-45deg) translate(4px, -4px);
            }
        }
    }
}

// ==========================================================================
// Mobile Hamburger Menu
// ==========================================================================

.presszone-comments-hamburger {
    display: none;
    position: fixed;
    top: 50px;
    left: 5px;
    z-index: 100001;
    background: $presszone-comments-surface;
    border: 1px solid $presszone-comments-border;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

    @include dark-mode-class {
        background: $presszone-comments-surface-dark;
        border-color: $presszone-comments-border-dark;
    }

    @include respond-to(md) {
        display: flex;
    }

    &__bar {
        width: 20px;
        height: 2px;
        background: $presszone-comments-text;
        transition: transform $presszone-comments-duration-normal $presszone-comments-ease-smooth,
            opacity $presszone-comments-duration-normal $presszone-comments-ease-smooth;

        @include dark-mode-class {
            background: $presszone-comments-text-dark;
        }
    }
}

.presszone-comments-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;

    @include respond-to(md) {
        display: none;
    }
}

// ==========================================================================
// Loading & Spinner
// ==========================================================================

.presszone-comments-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
}

.presszone-comments-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid $presszone-comments-border;
    border-top-color: $presszone-comments-primary;
    border-radius: 50%;
    animation: presszone-comments-spin $presszone-comments-spinner-duration linear infinite;

    @include dark-mode-class {
        border-color: $presszone-comments-border-dark;
        border-top-color: $presszone-comments-primary-dark;
    }
}

@keyframes presszone-comments-spin {
    to {
        transform: rotate(360deg);
    }
}

// ==========================================================================
// Buttons
// ==========================================================================

.presszone-comments-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: $presszone-comments-radius;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all $presszone-comments-duration-fast $presszone-comments-ease-smooth;

    &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    &--primary {
        background: linear-gradient(135deg, $presszone-comments-primary, $presszone-comments-primary-hover);
        color: $presszone-comments-text-on-primary;

        @include dark-mode-class {
            background: linear-gradient(135deg, $presszone-comments-primary-dark, $presszone-comments-primary-hover-dark);
            color: $presszone-comments-text-on-primary-dark;
        }

        &:hover:not(:disabled) {
            background: $presszone-comments-primary-hover;

            @include dark-mode-class {
                background: $presszone-comments-primary-hover-dark;
            }
        }
    }

    &--secondary {
        background: $presszone-comments-surface-2;
        color: $presszone-comments-text;

        @include dark-mode-class {
            background: $presszone-comments-surface-2-dark;
            color: $presszone-comments-text-dark;
        }

        &:hover:not(:disabled) {
            background: $presszone-comments-border;

            @include dark-mode-class {
                background: $presszone-comments-border-dark;
            }
        }
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px $presszone-comments-primary-dim, $presszone-comments-shadow;

        @include dark-mode-class {
            box-shadow: 0 0 0 3px $presszone-comments-primary-dim-dark, $presszone-comments-shadow-dark;
        }
    }
}

// ==========================================================================
// Admin Footer
// ==========================================================================

.presszone-comments-admin-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    font-size: 13px;
    color: $presszone-comments-text-secondary;

    @include dark-mode-class {
        color: $presszone-comments-text-secondary-dark;
    }

    a {
        color: $presszone-comments-primary;
        text-decoration: none;
        font-weight: 600;

        @include dark-mode-class {
            color: $presszone-comments-primary-dark;
        }

        &:hover {
            text-decoration: underline;
        }
    }
}