* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #2a2a2e;
    color: white;
    overflow-x: hidden;
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, #2a2a2e 0%, #3a3a3e 100%);
    text-align: center;
}

.logo-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 60px;
}

.logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffffff;
}

.welcome-subtitle {
    font-size: 16px;
    line-height: 1.4;
    color: #a0a0a0;
    max-width: 300px;
}

.action-container {
    width: 100%;
    max-width: 300px;
}

.continue-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.continue-btn:active {
    transform: translateY(0);
}

.setup-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #2a2a2e 0%, #3a3a3e 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

.setup-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; 
    overflow-y: auto;
}

.setup-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.setup-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    line-height: 1.2;
}

.setup-subtitle {
    font-size: 16px;
    line-height: 1.4;
    color: #a0a0a0;
    max-width: 320px;
    margin: 0 auto;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.step-header {
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    font-size: 16px;
    font-weight: 700;
    color: #007aff;
    min-width: 60px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
    line-height: 1.3;
}

.step-content p {
    font-size: 14px;
    line-height: 1.4;
    color: #a0a0a0;
    margin-bottom: 12px;
}

.bot-username {
    background: #007aff;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s ease;
    user-select: all;
    margin-top: 8px;
}

.bot-username:hover {
    background: #0056cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.bot-username:active {
    transform: translateY(0);
}

.step-image {
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #1e1e22 0%, #2a2a2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 200px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.step-image img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
}

.step-image:empty::before {
    content: attr(data-placeholder);
    color: #007aff;
    font-size: 14px;
    font-weight: 600;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
}

.step-image[data-step="Шаг 1"]:empty::before {
    content: "📱 Скриншот Set1.png\A⚙️ Настройки → Telegram для бизнеса";
    white-space: pre-line;
}

.step-image[data-step="Шаг 2"]:empty::before {
    content: "📱 Скриншот Set2.png\A🤖 Меню бизнес-функций → Чат-боты";
    white-space: pre-line;
}

.step-image[data-step="Шаг 3"]:empty::before {
    content: "📱 Скриншот Set3.png\A🔗 Подключение @Giftpot_Trades_Bot";
    white-space: pre-line;
}

.step-image[data-step="Шаг 4"]:empty::before {
    content: "📱 Скриншот Set4.png\A✅ Разрешения: Управлять подарками";
    white-space: pre-line;
}

.setup-actions-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #2a2a2e 70%, rgba(42, 42, 46, 0.95) 85%, rgba(42, 42, 46, 0.8) 95%, transparent 100%);
    padding: 20px;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.setup-actions-fixed .verify-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 16px 24px;
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.setup-actions-fixed .verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.setup-actions-fixed .verify-btn:active {
    transform: translateY(0);
}

.step-item {
    margin-bottom: 20px;
}

.step-item:last-child {
    margin-bottom: 30px;
}

.loading-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #2a2a2e 0%, #3a3a3e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 40px 20px;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    width: 100%;
}

.loading-spinner {
    margin-bottom: 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.loading-text p {
    font-size: 14px;
    color: #a0a0a0;
    line-height: 1.5;
    max-width: 320px;
}

.loading-text {
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

@media (max-width: 768px) {
    .loading-screen {
        padding: 30px 15px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .loading-text h2 {
        font-size: 20px;
    }
    
    .loading-text p {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
    }
    
    .gifts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .setup-screen {
        padding: 15px;
    }
    
    .setup-title {
        font-size: 20px;
    }
    
    .setup-subtitle {
        font-size: 13px;
    }
    
    .step-item {
        padding: 16px;
    }
    
    .step-content h3 {
        font-size: 15px;
    }
    
    .step-content p {
        font-size: 13px;
    }
    
    .setup-actions-fixed {
        padding: 15px;
    }
    
    .step-image {
        margin-top: 12px;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.tg-viewport {
    height: 100vh !important;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #1a1a1e;
}

::-webkit-scrollbar-thumb {
    background: #007aff;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056cc;
}


.error-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #2a2a2e 0%, #3a3a3e 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

.error-content {
    flex: 1;
    padding: 40px 20px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.error-icon {
    margin-bottom: 30px;
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-header {
    margin-bottom: 40px;
}

.error-title {
    font-size: 24px;
    font-weight: 700;
    color: #ff3b30;
    margin-bottom: 16px;
    line-height: 1.2;
}

.error-subtitle {
    font-size: 14px;
    color: #a0a0a0;
    line-height: 1.5;
    max-width: 300px;
}

.error-checklist {
    width: 100%;
    max-width: 320px;
    margin-bottom: 30px;
}

.checklist-title {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: left;
}

.checklist-items {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    text-align: left;
}

.checklist-item:last-child {
    margin-bottom: 0;
}

.checklist-bullet {
    color: #ff3b30;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
}

.checklist-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.error-footer {
    margin-top: auto;
    max-width: 300px;
}

.error-footer-text {
    font-size: 13px;
    color: #a0a0a0;
    line-height: 1.4;
}


.error-actions-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #2a2a2e 70%, rgba(42, 42, 46, 0.95) 85%, rgba(42, 42, 46, 0.8) 95%, transparent 100%);
    padding: 20px;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.retry-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 16px 24px;
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.retry-btn:active {
    transform: translateY(0);
}


.copied-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 122, 255, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}
