/* =========================================================
   AiEric - GLOBAL CSS
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Poppins, sans-serif;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    color: white;
}

/* =========================================================
   GLOBAL ANIMATED BACKGROUND
   Domyślne ustawienie - NIE ZMIENIAĆ
   ========================================================= */

body.aieric-background {
    min-height: 100vh;
    overflow-x: hidden;

    background: linear-gradient(
        90deg,
        #ff004c,
        #ffcc00,
        #00ff88,
        #00c3ff,
        #7a00ff,
        #ff00d4,
        #ff004c
    );

    background-size: 400% 400%;
    animation: bg 12s linear infinite;
}

@keyframes bg {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 400% 50%;
    }
}

/* =========================================================
   LINKS
   ========================================================= */

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   AUTH PAGES
   Login / Register / Forgot Password
   ========================================================= */

.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-box {
    width: 380px;
    max-width: 100%;
    padding: 40px;

    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border-radius: 20px;
    color: white;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25);
}

.form-box h2 {
    text-align: center;
    margin-bottom: 25px;
}

/* =========================================================
   INPUTS
   ========================================================= */

.inputbox {
    position: relative;
    margin: 20px 0;

    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
}

.inputbox input {
    width: 100%;

    padding: 10px 35px 10px 5px;

    background: transparent;
    border: none;
    outline: none;

    color: white;
    font-size: 15px;
}

.inputbox input::placeholder {
    color: transparent;
}

.inputbox label {
    position: absolute;

    left: 5px;
    top: 50%;

    transform: translateY(-50%);

    color: rgba(255, 255, 255, 0.7);

    pointer-events: none;

    transition:
        top 0.25s ease,
        font-size 0.25s ease,
        color 0.25s ease;
}

.inputbox input:focus ~ label,
.inputbox input:valid ~ label,
.inputbox input:not(:placeholder-shown) ~ label {
    top: -10px;

    font-size: 12px;

    color: white;
}

.inputbox ion-icon {
    position: absolute;

    right: 5px;
    top: 10px;

    color: white;
    font-size: 18px;

    pointer-events: none;
}

/* =========================================================
   FORGOT / REMEMBER
   ========================================================= */

.forget {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 10px;

    margin: 10px 0 20px;

    font-size: 0.9em;
}

.remember {
    display: flex;
    align-items: center;
    gap: 6px;
}

.remember input {
    accent-color: white;
}

.forget a,
.form-box a {
    text-decoration: underline;
}

.forget a:hover,
.form-box a:hover {
    opacity: 0.8;
}

/* =========================================================
   BUTTONS
   ========================================================= */

button,
.button {
    width: 100%;

    padding: 12px;

    border: none;
    border-radius: 12px;

    background: white;
    color: black;

    font-weight: bold;
    font-size: 14px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

button:hover,
.button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.25);
}

button:active,
.button:active {
    transform: translateY(0);
}

/* =========================================================
   REGISTER TEXT
   ========================================================= */

.register {
    text-align: center;
    margin-top: 15px;
}

.register a {
    color: white;
}

/* =========================================================
   DASHBOARD / APP LAYOUT
   ========================================================= */

.app {
    min-height: 100vh;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 25px;

    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    z-index: 1000;
}

.logo {
    font-size: 22px;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-button {
    width: auto;

    padding: 9px 16px;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.15);
    color: white;

    backdrop-filter: blur(10px);
}

.topbar-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   MAIN DASHBOARD
   ========================================================= */

.layout {
    display: flex;

    min-height: 100vh;

    padding-top: 70px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    top: 70px;
    left: 0;
    bottom: 0;

    width: 230px;

    padding: 25px 15px;

    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border-right: 1px solid rgba(255, 255, 255, 0.1);

    overflow-y: auto;
}

.sidebar-title {
    padding: 0 12px 15px;

    font-size: 12px;
    text-transform: uppercase;

    opacity: 0.55;
}

.sidebar a {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px;

    margin-bottom: 6px;

    border-radius: 10px;

    color: rgba(255, 255, 255, 0.8);

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.sidebar a ion-icon {
    font-size: 20px;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;

    transform: translateX(3px);
}

.sidebar a.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

/* =========================================================
   CONTENT
   ========================================================= */

.content {
    width: 100%;

    margin-left: 230px;

    padding: 35px;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.content-header p {
    opacity: 0.75;
}

/* =========================================================
   CARDS
   ========================================================= */

.cards {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 20px;
}

.card {
    padding: 25px;

    background: rgba(0, 0, 0, 0.3);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 18px;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);

    background: rgba(0, 0, 0, 0.4);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    margin-bottom: 15px;

    border-radius: 14px;

    background: rgba(255, 255, 255, 0.15);
}

.card-icon ion-icon {
    font-size: 25px;
}

.card h3 {
    margin-bottom: 8px;
}

.card p {
    opacity: 0.7;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================================
   SETTINGS
   ========================================================= */

.settings-box {
    max-width: 850px;
}

.setting {
    padding: 20px;

    margin-bottom: 15px;

    background: rgba(0, 0, 0, 0.3);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 16px;
}

.setting h3 {
    margin-bottom: 6px;
}

.setting p {
    opacity: 0.7;
    font-size: 14px;
}

/* =========================================================
   COMFYUI / EMBEDDED APP
   ========================================================= */

.app-frame {
    width: 100%;
    height: calc(100vh - 70px);

    border: none;

    display: block;
}

/* =========================================================
   SOCIAL WIDGET
   ========================================================= */

.social-widget {
    position: fixed;

    right: max(15px, env(safe-area-inset-right));
    bottom: max(15px, env(safe-area-inset-bottom));

    width: 120px;
    height: 120px;

    z-index: 99999;

    pointer-events: none;
}

.social-widget button,
.social-widget a {
    pointer-events: auto;
}

/* Główny przycisk */

.social-toggle {
    position: absolute;

    right: 0;
    bottom: 0;

    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(0, 0, 0, 0.55);

    border: 1px solid rgba(255, 255, 255, 0.2);

    color: white;

    font-size: 20px;

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.social-toggle:hover {
    transform: scale(1.05);

    background: rgba(0, 0, 0, 0.7);
}

/* =========================================================
   SOCIAL TILES
   ========================================================= */

.social-tile {
    position: absolute;

    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(0, 0, 0, 0.55);

    border: 1px solid rgba(255, 255, 255, 0.2);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    opacity: 0;
    transform: scale(0.5);

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        background 0.25s ease;
}

.social-tile:hover {
    background: rgba(0, 0, 0, 0.75);

    transform: scale(1.05);
}

.social-tile img {
    width: 30px;
    height: 30px;

    object-fit: contain;

    display: block;
}

.social-x {
    color: white;

    font-size: 32px;
    font-weight: 300;

    line-height: 1;

    padding: 0;
}

/* =========================================================
   ROZWINIĘTY UKŁAD 2x2

   ┌─────┬─────┐
   │  YT │  SP │
   ├─────┼─────┤
   │  DC │  X  │
   └─────┴─────┘
   ========================================================= */

/* YouTube - lewy górny */

.social-widget.open .social-youtube {
    left: 0;
    top: 0;

    opacity: 1;
    transform: scale(1);

    pointer-events: auto;
}

/* Spotify - prawy górny */

.social-widget.open .social-spotify {
    right: 0;
    top: 0;

    opacity: 1;
    transform: scale(1);

    pointer-events: auto;
}

/* Discord - lewy dolny */

.social-widget.open .social-discord {
    left: 0;
    bottom: 0;

    opacity: 1;
    transform: scale(1);

    pointer-events: auto;
}

/* X - prawy dolny */

.social-widget.open .social-x {
    right: 0;
    bottom: 0;

    opacity: 1;
    transform: scale(1);

    pointer-events: auto;
}

/* Gdy otwarte, główny przycisk znika */

.social-widget.open .social-toggle {
    opacity: 0;
    pointer-events: none;

    transform: scale(0.5);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .topbar {
        padding: 0 15px;
    }

    .logo {
        font-size: 19px;
    }

    .sidebar {
        width: 70px;
        padding: 15px 8px;
    }

    .sidebar-title,
    .sidebar a span {
        display: none;
    }

    .sidebar a {
        justify-content: center;
        padding: 13px;
    }

    .sidebar a ion-icon {
        font-size: 22px;
    }

    .content {
        margin-left: 70px;
        padding: 25px 15px;
    }

    .content-header h1 {
        font-size: 24px;
    }

    .form-box {
        padding: 30px 25px;
    }

    .social-widget {
        width: 108px;
        height: 108px;

        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .social-tile,
    .social-toggle {
        width: 50px;
        height: 50px;
    }

    .social-tile img {
        width: 27px;
        height: 27px;
    }
}

/* =========================================================
   AUTH - ADDITIONAL LOGIN METHODS
   ========================================================= */

.login-methods {
    margin-top: 20px;
}

.login-methods-toggle {
    width: 100%;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(255, 255, 255, 0.08);
    color: white;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.login-methods-toggle:hover {
    transform: none;
    box-shadow: none;

    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.login-methods-toggle ion-icon {
    font-size: 18px;

    transition: transform 0.25s ease;
}

.login-methods.open .login-methods-toggle ion-icon {
    transform: rotate(180deg);
}

/* =========================================================
   AUTH METHODS ANIMATION
   ========================================================= */

.login-methods-content {
    display: grid;
    grid-template-rows: 0fr;

    opacity: 0;

    transition:
        grid-template-rows 0.3s ease,
        opacity 0.25s ease;

    overflow: hidden;
}

.login-methods.open .login-methods-content {
    grid-template-rows: 1fr;
    opacity: 1;
}

.login-methods-inner {
    min-height: 0;
    overflow: hidden;
    padding-top: 0;

    transition: padding-top 0.3s ease;
}

.login-methods.open .login-methods-inner {
    padding-top: 12px;
}

/* =========================================================
   AUTH SEPARATOR
   ========================================================= */

.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 20px 0;

    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.auth-separator::before,
.auth-separator::after {
    content: "";

    flex: 1;
    height: 1px;

    background: rgba(255, 255, 255, 0.15);
}

/* =========================================================
   GOOGLE LOGIN BUTTON
   ========================================================= */

.google-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 11px 14px;

    background: rgba(255, 255, 255, 0.95);
    color: #111;

    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 11px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.google-button:hover {
    transform: translateY(-2px);

    background: white;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.25);
}

.google-button:active {
    transform: translateY(0);
}

.google-button img {
    width: 20px;
    height: 20px;

    object-fit: contain;
}

/* =========================================================
   AUTH DESCRIPTION
   ========================================================= */

.auth-subtitle {
    margin-top: -15px;
    margin-bottom: 25px;

    text-align: center;

    color: rgba(255, 255, 255, 0.7);

    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   AUTH LEGAL TEXT
   ========================================================= */

.auth-legal {
    margin-top: 18px;

    text-align: center;

    color: rgba(255, 255, 255, 0.5);

    font-size: 11px;
    line-height: 1.5;
}

.auth-legal a {
    color: rgba(255, 255, 255, 0.85);
}

/* =========================================================
   PASSWORD VALIDATION
   ========================================================= */

.password-status {
    margin-top: -12px;
    margin-bottom: 10px;

    font-size: 12px;

    opacity: 0;
    transition: opacity 0.2s ease;
}

.password-status.visible {
    opacity: 1;
}

.password-status.success {
    color: #8affc1;
}

.password-status.error {
    color: #ff9b9b;
}

/* =========================================================
   AUTH MOBILE
   ========================================================= */

@media (max-width: 450px) {

    .auth-page {
        padding: 15px;
    }

    .form-box {
        width: 100%;
        padding: 30px 22px;
        border-radius: 18px;
    }

    .form-box h2 {
        font-size: 23px;
    }

    .auth-subtitle {
        font-size: 12px;
    }

    .login-methods-toggle {
        font-size: 12px;
    }

    .google-button {
        font-size: 13px;
    }
}