:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--tg-theme-bg-color, var(--bg-color));
    color: var(--tg-theme-text-color, var(--text-color));
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* Background animated orbs */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #0f172a;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-accent);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary-accent);
    bottom: 10%;
    right: -50px;
    animation-delay: -3s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #ec4899;
    top: 40%;
    left: 30%;
    animation-delay: -6s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-30px) scale(1.1);
    }
}

.app-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 300;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
}

.profile-section {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(20px);
}

.settings-section {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
    transform: translateY(20px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-details h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.setting-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.setting-text p {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Inputs */
.input-group {
    margin-top: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.glass-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.glass-input:focus {
    border-color: var(--primary-accent);
}

.glass-input option {
    background: #1e293b;
    color: white;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.06);
}
.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.history-author {
    font-weight: 600;
    color: var(--primary-accent);
}

.history-date {
    font-size: 0.75rem;
}

.history-body {
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.history-type {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 8px;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 560px;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    margin-bottom: 0;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.nav-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}
.nav-btn.active {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;

    opacity: 1;
    color: var(--primary-accent);
}

.nav-icon {
    font-size: 1.4rem;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    border-radius: 15px;
    border: none;
    background: var(--tg-theme-button-color, linear-gradient(135deg, var(--primary-accent), var(--secondary-accent)));
    color: var(--tg-theme-button-text-color, #fff);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    margin-bottom: 20px;
}

.primary-btn:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}
.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    transition: background 0.2s;
}
.secondary-btn:hover {
    background: rgba(255,255,255,0.2) !important;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    width: 320px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #f8fafc;
}

.modal-text {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-text a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 600;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; color: var(--primary-accent); }
}
