/* ==========================================================================
   Auth Page Styles
   Extracted from style.css and base.css - Authentication section
   ========================================================================== */

/* ==========================================================================
   Auth Layout
   ========================================================================== */

.auth-welcome {
    display: none;
    background-color: var(--third-color);
    color: white;
    padding: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 15px 0 0 15px;

    .darkmode & {
        filter: brightness(0.8);
    }


    .welcome-content {
        max-width: 80%;

        h2 {
            font-size: 2.5rem;
            margin-bottom: 20px;
            color: white;
        }

        p {
            font-size: 1.1rem;
            opacity: 0.8;
            line-height: 1.6;
        }
    }

    @media (min-width: 992px) {
        display: flex;
        border-radius: 15px 0 0 15px;
        background-color: var(--third-color);
        overflow: hidden;
        max-width: 100%;
        margin: 0;
    }
}

.auth-wrap {
    .auth-col {
        width: 100%;

        float: none;
        display: flex;
        flex-direction: column;
        align-items: center;

        &:nth-child(2n) {
            margin-right: 0;
        }

        div {
            width: 100%;
        }

        a {
            transition: border-bottom 0.2s;

            &:hover {
                border-bottom: 1px solid rgba(18, 145, 238, 0.8);
            }
        }

    }

    .auth-submit {
        /* ==========================================================================
            Checkbox Styles
        ========================================================================== */

        input[type=checkbox] {
            display: none;

            &+label {
                padding: 4px 0 0 25px;
                display: inline-block;
                position: relative;
                cursor: pointer;
                transition: color 0.2s;

                &:hover, &:active {
                    color: var(--third-color);
                }

                &:after {
                    content: "\f00c";
                    width: 14px;
                    height: 14px;
                    display: block;
                    position: absolute;
                    top: 50%;
                    margin: -7px 0 0;
                    left: 0;
                    border: 2px solid var(--third-color);
                    border-radius: 4px;
                    background-color: var(--secondary-color);
                    color: var(--secondary-color);
                    font-size: 10px;
                    padding: 0 0 0 1px;
                    text-align: center;
                    font-family: FontAwesome, serif;
                    line-height: 13px;
                }
            }

            &:checked+label:after {
                border-color: var(--third-color);
                background-color: var(--third-color);
            }
        }
    }

    .terms-conditions-container {
        display: flex;
        margin: 1.5rem 0;
        gap: .5rem;

        .conditions-text {
            width: fit-content;
        }
    }
}

.page-cont.account-page {
    padding: 30px 20px;
}

/* ==========================================================================
   Auth Header
   ========================================================================== */

.auth-header {
    text-align: center;
    grid-column: 1 / span 2;

    h2 {
        margin-bottom: 1rem;
    }

    p {
        color: var(--secondary-text-color);
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Form Spacing
   ========================================================================== */

.auth-col form.login,
.auth-col form.signup {
    div.mb-3 {
        margin: 1rem 0 2rem !important;
    }
}

/* ==========================================================================
   Divider
   ========================================================================== */

.divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;

    &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        width: 100%;
        height: 1px;
        background: var(--border-color);
    }

    span {
        background: var(--secondary-color);
        padding: 0 15px;
        color: var(--base-text-color);
        position: relative;
        z-index: 1;
    }

    @media screen and (min-width: 576px) and (max-width: 768px) {
        margin: 3rem 0;
    }
}

/* ==========================================================================
   Email Wrapper
   ========================================================================== */

.email-wrapper {
    position: relative;

    span {
        position: absolute;
        bottom: 25%;
        left: 8%;
        font-size: 15px;
        color: var(--secondary-text-color);
        pointer-events: none;
        transition: all 0.2s ease-in-out;
    }

    input {
        &:focus~span,
        &:not(:placeholder-shown)~span {
            font-size: 12px;
            color: var(--third-color);
            transform: translate(-10px, -25px);
            backdrop-filter: blur(4px);
        }

        &:focus {
            &:valid {
                box-shadow: 0 0 0 .25rem rgba(40, 167, 69, .25);
            }
            &:not(:placeholder-shown):invalid {
                box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25);
            }
        }
        &:valid~span {
            color: var(--success-color);
        }
        &:not(:placeholder-shown):invalid~span {
            color: var(--danger-color);
        }
    }
}

/* ==========================================================================
   Password Wrapper
   ========================================================================== */

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;

    input {
        padding-right: 40px !important;
        width: 100%;

        &:focus~span,
        &:not(:placeholder-shown)~span {
            font-size: 12px;
            color: var(--third-color);
            transform: translate(-10px, -25px);
            backdrop-filter: blur(4px);
        }

        &:focus {
            &:valid {
                box-shadow: 0 0 0 .25rem rgba(40, 167, 69, .25);
            }
            &:not(:placeholder-shown):invalid {
                box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25);
            }
        }
        &:valid~span {
            color: var(--success-color);
        }
        &:not(:placeholder-shown):invalid~span {
            color: var(--danger-color);
        }
    }

    span {
        position: absolute;
        bottom: 25%;
        left: 8%;
        font-size: 15px;
        color: var(--secondary-text-color);
        pointer-events: none;
        transition: all 0.2s ease-in-out;
    }
}

/* ==========================================================================
   Password Toggle Icon
   ========================================================================== */

.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--secondary-text-color);
    transition: color 0.2s;
    user-select: none;

    &:hover {
        color: var(--base-text-color);
    }
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

ul.text-muted {
    font-weight: bold;

    p {
        color: var(--danger-color);
    }

    li {
        color: var(--danger-color);
        margin: 0;
        font-size: .875em;
        margin-left: 10px;
    }
}

label[for="alert-danger"] {
    color: var(--danger-color);
    font-size: 1.2rem;
    font-weight: bold;
}

/* ==========================================================================
   Register Form
   ========================================================================== */

form.register {
    ul.errorlist {
        margin-bottom: 0;
    }

    &.update-account-details {
        display: grid;
        align-items: center;
        width: 100%;
        gap: 20px;

        .auth-submit input[type=submit] {
            margin-top: 10px;
            color: white;
        }

        * {
            width: 100%;
        }

        @media screen and (min-width: 992px) {
            grid-template-columns: 1fr 1fr;
            align-items: start;
        }
    }
}

/* ==========================================================================
   Logout Button
   ========================================================================== */

.logout-account-container {
    width: 100%;
    margin: 0;

    * {
        width: 100%;
    }

    input.logout-account {
        border-radius: 10px;
        background-color: transparent;
        border: 2px solid var(--danger-color);
        color: var(--danger-color);

        &:hover,
        &:active {
            background-color: var(--danger-color);
            color: white;
            box-shadow: 0 10px 25px rgba(229, 62, 62, 0.3);
            transform: translateY(-2px);
        }
    }
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

#id_sex,
#id_birth {
    color: var(--base-text-color) !important;
    background-color: var(--base-color) !important;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (min-width: 768px) {
    .auth-wrap .auth-col {
        align-items: flex-start;
    }

    .auth-header p {
        font-size: 1.3rem;
    }
}

@media (min-width: 992px) {
    .page-cont:not(.account-page) {
        display: grid;
        grid-template-columns: .8fr 1fr;
        padding: 0;
    }

    .auth-wrap .auth-col {
        width: 100%;
        margin: 0;
        padding: 20px 30px;
        float: left;
        max-width: none;
        display: block;

        h2 {
            margin-bottom: 2rem !important;
        }

        .auth-submit input[type="checkbox"] + label,
        .terms-conditions-container {
            margin-left: 5px;
        }
    }
}

/* ==========================================================================
   New Account Page Layout (Cards)
   ========================================================================== */

.account-details-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;

    @media (min-width: 992px) {
        display: grid;
        grid-template-columns: 1fr .25fr;
        gap: 20px;
        align-items: start;
    }
}

.account-card {
    color: #fff;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(18, 145, 238, 0.2);
    transition: box-shadow 0.2s;

    .row {
        margin: 0;

        >* {
            padding: 0;
        }
    }

    h3 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 2rem;
    }

    label {
        color: #a0aec0;
    }

    input:not(.logout-account),
    select,
    textarea {
        &:focus {
            border-color: var(--third-color) !important;
            box-shadow: 0 0 0 0.2rem rgba(18, 145, 238, 0.25) !important;
        }
    }

    &:hover, &:active {
        box-shadow: 0 5px 25px -5px rgba(18, 145, 238, 0.3);
    }

    .darkmode & {
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    @media (min-width: 992px) {
        #div_id_sex, #div_id_birth {
            input, select {
                font-size: 1.2rem;
            }
        }
    }

    &.no-orders {
        i.bi-cart-x {
            color: var(--secondary-text-color) !important;
        }

        p.text-muted {
            color: var(--secondary-text-color) !important;
        }

        .btn-primary {
            color: white;
            font-size: 1.3rem;
        }
    }
}

.update-btn {
    border-radius: 5px !important;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    will-change: background-color, transform, box-shadow;

    &:hover, &:active {
        background-color: #0b76c6;
        transform: translateY(-2px);
        box-shadow:  0 10px 25px rgba(102, 234, 144, 0.4);
    }
}

.logout-account {
    border-radius: 5px !important;
}

@media (min-width: 992px) {
    .page-cont.account-page {
        box-shadow: none;
        padding: 0;
    }
}

/* ==========================================================================
   Account Tabs
   ========================================================================== */

.nav-tabs {
    border-bottom: 2px solid rgba(18, 145, 238, 0.2);
    margin-bottom: 2rem !important;

    .nav-link {
        color: var(--secondary-text-color);
        border: none;
        border-bottom: 3px solid transparent;
        font-weight: 600;
        padding: 0.8rem 1.5rem;
        transition: all 0.2s ease;
        margin-bottom: -2px;
        background: transparent;

        &:hover {
            color: var(--base-text-color);
            border-color: rgba(18, 145, 238, 0.5);
        }

        &.active {
            color: var(--third-color);
            background: transparent;
            border-bottom: 3px solid var(--third-color);
        }
    }
}

/* ==========================================================================
   Orders Styles
   ========================================================================== */

.orders-container {
    width: 100%;

    .orders-list {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;

        @media (min-width: 768px) {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }

        @media (min-width: 1200px) {
            gap: 2rem;
        }
    }

    .text-center {
        i {
            color: var(--secondary-text-color);
            opacity: 0.5;
            font-size: 5rem;
            margin-bottom: 1rem;
            display: block;
        }

        h3 {
            color: var(--base-text-color);
            margin-bottom: 0.5rem;
        }

        p {
            color: var(--secondary-text-color);
        }
    }
}

.order-card {
    border: 1px solid rgba(18, 145, 238, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(18, 145, 238, 0.2);
        /* border-color: rgba(18, 145, 238, 0.5); */
    }

    .order-header {
        .order-number {
            color: var(--base-text-color);
            font-size: 1.3rem;
            margin-bottom: 0.25rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            border: 0;
            transition: color 0.2s;
            width: fit-content;
            cursor: pointer;

            i {
                color: var(--third-color);
                font-size: 1.5rem;
            }

            &:hover, &:active {
                color: var(--third-color);
                border: 0;
            }
        }

        small {
            font-size: 0.9rem;
            color: var(--secondary-text-color) !important;
            font-weight: 500;
        }

        .order-status {
            display: inline-flex;
            align-self: flex-start;
            text-align: end;
            width: fit-content;

            .badge {
                font-size: 1rem;
                padding: 0.5em 1em;
                font-weight: 600;
                border-radius: 20px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
                color: white;
            }
        }
    }

    .order-details {
        background: var(--base-color);
        border-radius: 10px;
        padding: .5rem .5rem;
        margin: 1rem 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

        .order-item {
            font-size: 1rem;
            color: var(--base-text-color);
            border-bottom: 1px solid var(--border-color);
            padding: 0.75rem 0.7rem;
            margin-bottom: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background 0.2s ease;

            &:hover {
                background: rgba(18, 145, 238, 0.05);
                border-radius: 5px;
            }

            &:last-child {
                border-bottom: none;
            }

            span:first-child {
                font-weight: 500;
            }

            span:last-child {
                color: var(--third-color);
                font-weight: 700;
            }

            span {
                font-size: 1.2rem;
            }

            .order-item-title {
                color: var(--base-text-color);
                transition: color 0.2s;
                border-bottom: 0;

                .quantity {
                    margin-left: 5px;
                    color: var(--secondary-text-color) !important;
                }

                &:hover, &:active {
                    color: var(--third-color);
                }
            }
        }
    }

    .order-footer {
        border-top: 2px solid var(--border-color);
        margin-top: auto;
        padding: 1.5rem 15px 0;

        .order-total-label {
            color: var(--base-text-color);
            font-size: 1.1rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .order-total-amount {
            color: var(--third-color);
            font-weight: 800;
            font-size: 1.8rem !important;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
    }

    /* Dark mode adjustments */
    .darkmode & {
        border-color: rgba(18, 145, 238, 0.4);

        &:hover {
            box-shadow: 0 8px 30px rgba(18, 145, 238, 0.3);
        }

        .order-details {
            background: rgba(0, 0, 0, 0.3);
            border-color: rgba(255, 255, 255, 0.1);
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);

            .order-item {
                border-bottom-color: rgba(255, 255, 255, 0.1);

                &:hover {
                    background: rgba(18, 145, 238, 0.1);
                }
            }
        }

        .order-footer {
            border-top-color: rgba(255, 255, 255, 0.15);
            /* background: linear-gradient(to bottom, transparent, rgba(18, 145, 238, 0.08)); */
        }
    }
}

/* Empty state styling */
.orders-container {
    .text-center {
        i.bi-cart-x {
            color: var(--secondary-text-color);
            opacity: 0.4;
        }

        h3 {
            color: var(--base-text-color);
            font-weight: 600;
        }
    }
}
