/* ============================================
   FONT IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');
/* ============================================
   GLOBAL VARIABLES
   ============================================ */
:root {
    --bg: #0b0b0b;
    --bg-soft: #101010;
    --bg-card: #131313;
    --bg-modal: #151515;
    --text: #ffffff;
    --text-soft: #bfbfbf;
    --orange: #ff9900;
    --orange-soft: #ffb84d;
    --radius: 20px;
    --radius-sm: 14px;
    --transition: 0.25s ease;
    --blur: 18px;
}
/* ============================================
   GLOBAL PAGE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    font-family: 'Manrope', sans-serif;
}
html, body {
    background: var(--bg);
    color: var(--text);
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#app {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 100px;
}
/* ============================================
   SCREENS
   ============================================ */
.screen {
    width: 100%;
    min-height: calc(100dvh - 100px);
    padding: 20px 18px 40px;
    display: none;
    animation: fadeIn 0.25s ease forwards;
}
.screen.active {
    display: block;
}
.screen.hidden {
    display: none !important;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ============================================
   TITLES
   ============================================ */
h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 12px 0 6px;
}
.subtitle {
    font-size: 15px;
    color: var(--text-soft);
    margin-bottom: 18px;
}
h2 {
    font-size: 22px;
    font-weight: 700;
}
h3 {
    font-size: 18px;
    margin: 16px 0 8px;
}
/* ============================================
   TOP ICON (звёздочка)
   ============================================ */
.top-icon {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 10px;
}
.top-icon img {
    width: 80px;
    height: 80px;
    opacity: 1;
    filter: drop-shadow(0 4px 12px rgba(255,153,0,0.3));
}
/* ============================================
   UPLOAD, HISTORY, PRESETS
   ============================================ */
.preview-box img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.upload-box {
    border: 2px dashed var(--orange);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    background: rgba(255,153,0,0.08);
    margin-bottom: 30px;
}
.upload-icon {
    width: 45px;
    opacity: 0.9;
}
.upload-label {
    font-size: 18px;
    font-weight: 700;
    margin-top: 18px;
}
.upload-sub {
    font-size: 14px;
    color: var(--text-soft);
    margin-top: 6px;
}
.tips-box {
    background: var(--bg-soft);
    padding: 18px;
    border-radius: var(--radius);
}
.tips-box ul {
    margin-top: 8px;
    padding-left: 18px;
}
.tips-box li {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-soft);
}
/* ============================================
   HISTORY EMPTY
   ============================================ */
.history-container {
    margin-top: 35px;
}
.history-empty {
    text-align: center;
    margin-top: 80px;
    opacity: 0.4;
}
.history-empty img {
    width: 85px;
    margin-bottom: 12px;
}
/* ============================================
   GRID FOR PRESETS
   ============================================ */
.presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 22px;
}
.presets-grid .preset-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: var(--transition);
}
.presets-grid .preset-card.active {
    border-color: var(--orange);
}
.presets-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.duration-box {
    margin-top: 15px;
    margin-bottom: 12px;
    font-size: 15px;
}
#range-duration {
    width: 100%;
    margin-top: 10px;
}
/* ============================================
   REFERRAL BLOCK
   ============================================ */
.ref-block {
    background: var(--bg-card);
    padding: 18px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}
.ref-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.ref-link-box {
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 10px;
}
.ref-link-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
}
.copy-btn {
    width: 26px;
    height: 26px;
    background: url('../assets/icons/copy.svg') center/20px no-repeat;
    border: none;
}
/* ============================================
   SETTINGS
   ============================================ */
.settings-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    transition: var(--transition);
}
.settings-item:hover {
    border: 1.5px solid var(--orange);
}
.left-block {
    display: flex;
    align-items: center;
    gap: 12px;
}
.left-block img {
    width: 28px;
}
/* ============================================
   BOTS LIST
   ============================================ */
.bots-container {
    margin-top: 12px;
}
.bot-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
    display: block;
}
.bot-card:hover {
    border-color: var(--orange);
}
.bot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ff9900;
}
.bot-info p {
    font-size: 14px;
    color: var(--text-soft);
}
.bot-percent {
    background: var(--orange);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}
/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 95px;
    background: #0a0a0a;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0 20px 20px 20px;
    z-index: 100;
}

.bottom-nav button {
    background: transparent;
    border: none;
    color: var(--text-soft);
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.bottom-nav button:hover {
    color: var(--text);
}

.bottom-nav img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.bottom-nav button:hover img {
    opacity: 1;
}

.bottom-nav button.active {
    color: #bfbfbf;
}

.bottom-nav button.active img {
    opacity: 0.9;
}

/* Side buttons (История и Профиль) */
.nav-side {
    flex: 0.5;
}

.nav-side img {
    width: 20px;
    height: 20px;
}

/* Home button (center) */
.home-btn {
    background: linear-gradient(135deg, #ff9900, #ffb84d);
    padding: 14px;
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(255,153,0,0.5);
    position: relative;
    z-index: 110;
    transition: all 0.3s ease;
    flex: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.home-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 30px rgba(255,153,0,0.7);
}

.home-btn:active {
    transform: scale(0.95);
}

.home-btn img {
    width: 30px;
    height: 30px;
    opacity: 1;
    margin: 0;
}

/* ============================================
   MODALS SHARED
   ============================================ */
#modal-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(var(--blur));
    background: rgba(0,0,0,0.45);
    z-index: 120;
}
.hidden {
    display: none !important;
}
.modal {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--bg-modal);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: 130px;
    animation: slideUp 0.28s ease;
    max-height: 75dvh;
    overflow-y: auto;
    z-index: 130;
}
@keyframes slideUp {
    from { transform: translateX(-50%) translateY(40px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.modal.large {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    max-height: 85dvh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-soft);
    margin-bottom: 16px;
    font-weight: 500;
}

.modal-select-list {
    margin-top: 16px;
    padding-bottom: 20px;
}

.modal-close {
    background: var(--bg-soft);
    border: none;
    font-size: 24px;
    padding: 4px 10px;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255,153,0,0.2);
}
/* ============================================
   BUTTONS
   ============================================ */
.btn-red {
    background: linear-gradient(135deg, var(--orange), var(--orange-soft));
    color: #fff;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,153,0,0.3);
}
.btn-red:hover {
    background: linear-gradient(135deg, var(--orange-hover), var(--orange));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,153,0,0.4);
}
.btn-red:active {
    transform: translateY(0);
}
.btn-red.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-switch {
    background: var(--orange);
    padding: 12px 16px;
    color: #fff;
    border-radius: 12px;
    border: 1px solid transparent;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    width: auto;
    margin-top: 10px;
}

.btn-switch:hover {
    background: var(--orange-soft);
}
/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 540px) {
    .screen {
        padding: 30px 40px 60px;
    }
}