/* ============================================
   Component Styles
   Extracted from inline CSS in templates
   ============================================ */

/* ============================================
   Preloader Styles
   ============================================ */
#preloader {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-black-two);
    z-index: 9999;
    width: 100%;
    height: 100%;
}

.axqa-loader {
    text-align: center;
}

.axqa-text {
    font-family: var(--tg-heading-font-family);
    font-size: 4rem;
    font-weight: 800;
    background: var(--tg-gradient-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
    animation: axqaPulse 1.5s ease-in-out infinite;
    text-transform: uppercase;
}

@keyframes axqaPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@media (max-width: 768px) {
    .axqa-text {
        font-size: 2.5rem;
    }
}

/* ============================================
   Logo Theme Switching
   ============================================ */
.logo img,
.nav-logo img {
    height: auto;
    max-height: 60px;
    width: auto;
    transition: opacity 0.3s ease;
    object-fit: contain;
}

/* Default: Dark mode - show light logo */
.logo-light {
    display: block !important;
}

.logo-dark {
    display: none !important;
}

/* Light mode: show dark logo */
[data-theme="light"] .logo-light {
    display: none !important;
}

[data-theme="light"] .logo-dark {
    display: block !important;
}

/* Fallback if no theme attribute */
body:not([data-theme]) .logo-light {
    display: block !important;
}

body:not([data-theme]) .logo-dark {
    display: none !important;
}

/* ============================================
   Navigation Dropdown Styles
   ============================================ */
.navigation > li.dropdown {
    position: relative;
}

.navigation .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--tg-black-two);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
}

.navigation .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navigation .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--tg-body-font-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.navigation .dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tg-heading-font-color);
}

.navigation .dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--tg-primary-color);
}

/* Mobile menu dropdown support */
@media (max-width: 991px) {
    .navigation .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        padding-left: 1.5rem;
        margin-top: 0.5rem;
    }

    .navigation > li.dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* ============================================
   Avatar Dropdown Styles
   ============================================ */
.nav-left-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-avatar-dropdown {
    position: relative;
}

.avatar-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.avatar-trigger:hover {
    transform: scale(1.05);
}

.avatar-trigger:focus {
    outline: 2px solid var(--tg-primary-color);
    outline-offset: 2px;
    border-radius: 50%;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s ease;
}

.avatar-trigger:hover .avatar-img {
    border-color: var(--tg-primary-color);
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tg-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.avatar-trigger:hover .avatar-placeholder {
    background: var(--tg-secondary-color);
    border-color: var(--tg-primary-color);
}

.avatar-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--tg-black-two);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.avatar-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-avatar {
    flex-shrink: 0;
}

.dropdown-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.avatar-placeholder-small {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--tg-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dropdown-user-details {
    flex: 1;
    min-width: 0;
}

.dropdown-username {
    font-weight: 600;
    color: var(--tg-heading-font-color);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    font-size: 0.85rem;
    color: var(--tg-body-font-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.25rem;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--tg-body-font-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tg-heading-font-color);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--tg-primary-color);
}

.dropdown-item-danger {
    color: #ff6464;
}

.dropdown-item-danger:hover {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6464;
}

.dropdown-item-danger i {
    color: #ff6464;
}

/* ============================================
   Language Switcher Styles
   ============================================ */
.language-switcher-item {
    cursor: pointer;
    position: relative;
}

.language-switcher-item .language-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--tg-body-font-color);
}

.language-switcher-item:hover .language-chevron {
    color: var(--tg-primary-color);
}

.language-switcher-item.active .language-chevron {
    transform: rotate(90deg);
}

.language-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.language-switcher-item.active + .language-submenu {
    max-height: 300px;
}

.language-option {
    padding-left: 2.5rem !important;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.language-option.active {
    background: rgba(103, 33, 255, 0.1);
    color: var(--tg-heading-font-color);
}

.language-flag {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.language-name {
    flex: 1;
}

.language-check {
    margin-left: auto;
    color: var(--tg-primary-color);
    font-size: 0.85rem;
}

.language-form {
    margin: 0;
    padding: 0;
    display: inline;
}

/* Mobile adjustments */
@media (max-width: 991px) {
    .avatar-img,
    .avatar-placeholder {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .avatar-dropdown-menu {
        right: 0;
        min-width: 220px;
    }
}

/* ============================================
   Cookie Consent Banner Styles
   ============================================ */
.cookie-consent-banner {
	    position: fixed;
	    bottom: 0;
	    left: 0;
	    right: 0;
    background: var(--tg-black-two);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    padding: 1.5rem 0;
    transform: translateY(100%);
	    transition: transform 0.3s ease-in-out;
}

body.has-cookie-banner {
    padding-bottom: 120px;
}

.cookie-consent-banner.show {
	    transform: translateY(0);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-consent-text {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.cookie-consent-text i {
    font-size: 2rem;
    color: var(--tg-primary-color);
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.cookie-consent-text h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tg-heading-font-color);
    margin-bottom: 0.5rem;
}

.cookie-consent-text p {
    font-size: 0.9rem;
    color: var(--tg-body-font-color);
    margin: 0;
    line-height: 1.6;
}

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookie-consent-actions .btn {
    padding: 0.75rem 2rem;
    white-space: nowrap;
    font-family: var(--tg-body-font-family);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 768px) {
    body.has-cookie-banner {
        padding-bottom: 290px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1.5rem;
    }

    .cookie-consent-text {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cookie-consent-text i {
        font-size: 1.5rem;
    }

    .cookie-consent-actions {
        justify-content: center;
    }

    .cookie-consent-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Headline Wrapping + Typography Fixes
   ============================================ */
/* Keep SplitText wrappers from forcing one-word-per-line layouts (e.g. under strict CSP). */
.title-animation .line,
.title-animation .word,
.title-animation .char {
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}

.title-animation .line {
    display: inline;
}

.title-animation .word,
.title-animation .char {
    display: inline-block;
}

/* Create a balanced, professional headline width without manual <br> tags. */
.banner-content .title,
.writing-area .section-title .title {
    max-width: min(28ch, 92vw);
    margin-left: auto;
    margin-right: auto;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* Responsive sizing for large headings while preserving the theme defaults elsewhere. */
.banner-content .title {
    font-size: clamp(2.25rem, 4.5vw, 4.25rem);
}

.writing-area .section-title .title {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

@supports not (text-wrap: balance) {
    .banner-content .title,
    .writing-area .section-title .title {
        text-wrap: pretty;
    }
}

/* ============================================
   Toast Notifications (Django Messages)
   ============================================ */
.axqa-toast-container {
    position: fixed;
    top: 90px; /* below header */
    right: 20px;
    z-index: 9999;
    width: min(420px, calc(100vw - 40px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.axqa-toast {
    pointer-events: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 10, 20, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(-8px);
    opacity: 0;
    animation: toastIn 180ms ease-out forwards;
    display: grid;
    grid-template-columns: 6px 1fr;
}

@keyframes toastIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.axqa-toast-hide {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.axqa-toast::before {
    content: "";
    display: block;
    width: 6px;
    border-radius: 14px 0 0 14px;
    background: rgba(102, 126, 234, 0.95);
}

.axqa-toast.toast-success::before {
    background: rgba(46, 204, 113, 0.95);
}

.axqa-toast.toast-error::before,
.axqa-toast.toast-danger::before {
    background: rgba(255, 100, 100, 0.95);
}

.axqa-toast.toast-warning::before {
    background: rgba(255, 193, 7, 0.95);
}

.axqa-toast.toast-info::before {
    background: rgba(102, 126, 234, 0.95);
}

.axqa-toast-body {
    grid-column: 2;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px;
}

.axqa-toast-text {
    color: var(--tg-body-font-color);
    font-size: 0.95rem;
    line-height: 1.35;
    flex: 1;
}

.axqa-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.axqa-toast-close:hover {
    color: rgba(255, 255, 255, 0.95);
}

/* Loading state for language selector submit buttons */
.language-option.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* "Link-like" buttons/anchors used in forms */
.btn-link,
.axqa-link-button {
    color: var(--tg-primary-color);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
}

.btn-link:hover,
.axqa-link-button:hover {
    opacity: 0.85;
}

.axqa-inline-form {
    display: inline;
}

.axqa-center-block {
    text-align: center;
}

/* Reusable panels/alerts (replaces inline CSS in templates) */
.axqa-alert {
    border-radius: 8px;
    padding: 1rem;
    color: var(--tg-body-font-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.axqa-alert-info {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.axqa-panel {
    background: var(--tg-black-two);
    border-radius: 8px;
    padding: 1.5rem;
}

.axqa-panel-danger {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.axqa-panel-danger .axqa-panel-title {
    color: #ff6464;
}

.axqa-panel-title {
    margin-bottom: 1rem;
    color: var(--tg-heading-font-color);
}

.axqa-comparison-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.axqa-comparison-row:last-child {
    border-bottom: none;
}

.axqa-arrow {
    font-size: 2rem;
    color: var(--tg-primary-color);
}

.axqa-list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
}

.axqa-loss-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.axqa-loss-list li:last-child {
    border-bottom: none;
}

.u-mb-1rem {
    margin-bottom: 1rem;
}

/* Profile subscription actions layout */
.subscription-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 576px) {
    .axqa-toast-container {
        top: 80px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}
