// ==========================================================================
// PressZone Theme - Auth Modal Styles
// ==========================================================================
// Entry point - compiles to auth-modal.css
// Uses Sass variables with body.dark-mode & nesting pattern.
// ==========================================================================

@import 'abstracts/variables';
@import 'abstracts/mixins';

// --------------------------------------------------------------------------
// Auth Modal Container
// --------------------------------------------------------------------------
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;

    &.is-open {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;

        .auth-modal-container {
            transform: scale(1) translateY(0);
        }
    }
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.auth-modal-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal-content {
    background: $light-bg-card;
    border: 1px solid $light-border-color;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    body.dark-mode & {
        background: $dark-bg-primary;
        border-color: $dark-border-color;
    }
}

// Close Button
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: $light-text-muted;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all $transition-base;
    z-index: 10;

    &:hover {
        background: $light-bg-tertiary;
        color: $light-text-primary;
    }

    body.dark-mode & {
        color: $dark-text-muted;

        &:hover {
            background: $dark-bg-tertiary;
            color: $dark-text-primary;
        }
    }

    @include rtl {
        right: auto;
        left: 1rem;
    }
}

// --------------------------------------------------------------------------
// Header & Logo
// --------------------------------------------------------------------------
.auth-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-logo-text {
    color: $light-text-primary;

    body.dark-mode & {
        color: #fff;
    }
}

.auth-logo-zone {
    color: $color-primary;
}

.auth-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: $light-bg-tertiary;
    border: 1px solid $light-border-color;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: $color-primary;

    body.dark-mode & {
        background: linear-gradient(135deg, $dark-bg-tertiary 0%, $dark-bg-primary 100%);
        border-color: $dark-border-color;
    }
}

// --------------------------------------------------------------------------
// Tabs
// --------------------------------------------------------------------------
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid $light-border-color;

    body.dark-mode & {
        border-bottom-color: $dark-border-color;
    }
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: $light-text-muted;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all $transition-base;
    position: relative;

    &::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 2px;
        background: transparent;
        transition: background $transition-base;
    }

    &:hover {
        color: $light-text-secondary;
    }

    &.active {
        color: $color-primary;

        &::after {
            background: $color-primary;
        }
    }

    body.dark-mode & {
        color: $dark-text-muted;

        &:hover {
            color: $dark-text-secondary;
        }

        &.active {
            color: $color-primary;
        }
    }
}

// --------------------------------------------------------------------------
// Forms
// --------------------------------------------------------------------------
.auth-form {
    display: none;

    &.active {
        display: block;
    }
}

.auth-field {
    margin-bottom: 1rem;

    label {
        display: block;
        font-size: 0.8125rem;
        font-weight: 500;
        color: $light-text-secondary;
        margin-bottom: 0.5rem;

        body.dark-mode & {
            color: $dark-text-secondary;
        }
    }
}

.auth-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;

    label {
        margin-bottom: 0;
    }

    @include rtl {
        flex-direction: row-reverse;
    }
}

.auth-forgot {
    font-size: 0.75rem;
    color: $color-primary;
    text-decoration: none;
    transition: color $transition-base;

    &:hover {
        color: $color-primary-hover;
        text-decoration: underline;
    }
}

.auth-input-wrap {
    position: relative;

    input {
        width: 100%;
        padding: 0.75rem 1rem;
        padding-left: 2.75rem;
        background: $light-bg-secondary;
        border: 1px solid $light-border-color;
        border-radius: 0.5rem;
        color: $light-text-primary;
        font-size: 0.9375rem;
        transition: all $transition-base;

        &::placeholder {
            color: $light-text-muted;
        }

        &:focus {
            outline: none;
            border-color: $color-primary;
            box-shadow: 0 0 0 3px rgba($color-primary, 0.15);
        }

        @include rtl {
            padding-left: 1rem;
            padding-right: 2.75rem;
            text-align: right;
        }

        body.dark-mode & {
            background: $dark-bg-tertiary;
            border-color: $dark-border-color;
            color: $dark-text-primary;

            &::placeholder {
                color: $dark-text-muted;
            }
        }
    }

    i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: $light-text-muted;
        font-size: 1rem;

        @include rtl {
            left: auto;
            right: 1rem;
        }

        body.dark-mode & {
            color: $dark-text-muted;
        }
    }
}

// Error Message
.auth-error {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba($color-danger, 0.1);
    border: 1px solid rgba($color-danger, 0.3);
    border-radius: 0.5rem;
    color: #f87171;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

// Submit Button
.auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: $color-primary;
    border: none;
    border-radius: 0.5rem;
    color: $dark-bg-primary;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all $transition-base;
    margin-top: 0.5rem;

    &:hover {
        background: $color-primary-hover;
        transform: translateY(-1px);
    }

    &:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

    .spin {
        animation: spin 1s linear infinite;
    }

    @include rtl {
        flex-direction: row-reverse;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

// --------------------------------------------------------------------------
// Divider
// --------------------------------------------------------------------------
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: $light-text-muted;
    font-size: 0.8125rem;

    &::before,
    &::after {
        content: '';
        flex: 1;
        height: 1px;
        background: $light-border-color;
    }

    body.dark-mode & {
        color: $dark-text-muted;

        &::before,
        &::after {
            background: $dark-border-color;
        }
    }
}

// --------------------------------------------------------------------------
// Social Login
// --------------------------------------------------------------------------
.auth-social {
    display: flex;
    gap: 0.75rem;
}

.auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: $light-bg-secondary;
    border: 1px solid $light-border-color;
    border-radius: 0.5rem;
    color: $light-text-primary;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all $transition-base;

    &:hover {
        background: $light-bg-tertiary;
        border-color: $light-border-light;
    }

    i {
        font-size: 1.125rem;
    }

    body.dark-mode & {
        background: $dark-bg-tertiary;
        border-color: $dark-border-color;
        color: #fff;

        &:hover {
            background: $dark-bg-secondary;
            border-color: $dark-border-light;
        }
    }

    @include rtl {
        flex-direction: row-reverse;
    }
}

// --------------------------------------------------------------------------
// Footer
// --------------------------------------------------------------------------
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-secure {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: $light-text-muted;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    i {
        color: $color-primary;
    }

    body.dark-mode & {
        color: $dark-text-muted;
    }

    @include rtl {
        flex-direction: row-reverse;
    }
}
