:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1b1e;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --accent-color: #0088CC;
    --error-color: #dc3545;
    --success-color: #28a745;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1b1e;
    --bg-secondary: #2c2e33;
    --text-primary: #ffffff;
    --text-secondary: #ced4da;
    --border-color: #373a40;
    --accent-color: #3498db;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Стили для фонового контейнера */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg-primary);
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/img/bg1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    pointer-events: none;
}

/* Добавляем класс для плавного перехода при переключении темы */
body.theme-transitioning * {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.form-group {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    margin-bottom: 2rem;
    transform: translateY(20px);
    opacity: 0;
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--accent-color);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.progress-container {
    display: none;
    opacity: 0;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: opacity 0.3s ease;
    transform: translateY(20px);
    animation: slideIn 0.5s ease forwards;
}

.progress-container.visible {
    opacity: 1;
}

.progress-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background-color: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-message {
    color: var(--error-color);
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--error-color);
}

#result {
    margin-top: 2rem;
    position: relative;
}

.map-container {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.map-container.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border-radius: 24px;
    cursor: default;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
}

.map-container.expanded iframe {
    pointer-events: auto;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.map-container.expanded .map-overlay {
    display: none;
}

.close-button {
    position: absolute;
    top: -27px;
    right: -40px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.close-button:hover {
    transform: rotate(90deg);
    background-color: var(--error-color);
}

.map-container.expanded .close-button {
    display: flex;
    opacity: 1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

.legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--bg-primary);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid var(--border-color);
}

.map-container .legend {
    opacity: 1;
}

.legend h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid var(--border-color);
}

.legend-color.start {
    background: #2ecc71;
}

.legend-color.jetton-master {
    background: #ff6b6b;
}

.legend-color.jetton-wallet {
    background: #4ecdc4;
}

.legend-color.wallet {
    background: #45b7d1;
}

.legend-color.stonfi {
    background: #9b59b6;
}

.legend-color.dedust {
    background: #f1c40f;
}

.legend-color.unknown {
    background: #95a5a6;
}

.filter-buttons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.filter-button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-button:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-button.active {
    background: var(--accent-color);
    color: white;
}

/* Медиа-запросы для мобильной адаптации */
@media screen and (max-width: 1024px) {
    .page-wrapper {
        padding: 1.5rem;
    }

    .form-group {
        padding: 1.5rem;
    }

    .input-group {
        gap: 0.75rem;
    }

    .map-container {
        height: 500px;
    }

    .legend {
        padding: 12px;
    }

    .legend h3 {
        font-size: 13px;
    }

    .legend-item {
        font-size: 11px;
    }

    .filter-button {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
    }

    .form-group {
        padding: 1.25rem;
    }

    .input-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    input[type="text"] {
        width: 100%;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 400px;
    }

    .legend {
        top: auto;
        bottom: 20px;
        right: 20px;
        max-width: 200px;
        max-height: 200px;
        overflow-y: auto;
    }

    .filter-buttons {
        top: auto;
        bottom: 20px;
        left: 20px;
        flex-direction: column;
        gap: 5px;
    }

    .filter-button {
        padding: 5px 10px;
        font-size: 12px;
    }

    .close-button {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    .page-wrapper {
        padding: 0.75rem;
    }

    .form-group {
        padding: 1rem;
    }

    .progress-container {
        padding: 1rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .map-container {
        height: 350px;
    }

    .legend {
        padding: 10px;
        max-width: 180px;
        max-height: 180px;
    }

    .legend h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .legend-item {
        font-size: 10px;
        margin: 3px 0;
    }

    .legend-color {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }

    .filter-button {
        padding: 4px 8px;
        font-size: 11px;
    }

    .close-button {
        width: 25px;
        height: 25px;
        font-size: 16px;
    }
}

@media screen and (max-width: 360px) {
    .page-wrapper {
        padding: 0.5rem;
    }

    .form-group {
        padding: 0.75rem;
    }

    .progress-container {
        padding: 0.75rem;
    }

    .stat-item {
        padding: 0.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .map-container {
        height: 300px;
    }

    .legend {
        padding: 8px;
        max-width: 160px;
        max-height: 160px;
    }

    .legend h3 {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .legend-item {
        font-size: 9px;
        margin: 2px 0;
    }

    .legend-color {
        width: 12px;
        height: 12px;
        margin-right: 5px;
    }

    .filter-button {
        padding: 3px 6px;
        font-size: 10px;
    }

    .close-button {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }
}

.info-block {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    margin-bottom: 2rem;
    transform: translateY(20px);
    opacity: 0;
    animation: slideIn 0.5s ease forwards;
}

.info-block h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.info-block p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-expandable {
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.info-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0;
}

.toggle-info {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.info-expandable.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.info-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.info-expandable.collapsed .info-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    margin-top: 0;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.info-card ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 1rem;
}

.info-card li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-card li:before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

.info-tips {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-top: 2rem;
}

.info-tips ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 1rem;
}

.info-tips li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-tips li:before {
    content: "→";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

@media screen and (max-width: 768px) {
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .info-block {
        padding: 1.5rem;
    }
    
    .info-block h2 {
        font-size: 1.5rem;
    }
    
    .info-block h3 {
        font-size: 1.25rem;
    }
    
    .info-block h4 {
        font-size: 1.1rem;
    }
}

/* Стили для модального окна подписки */
.subscription-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    transform: translateY(-3px);
}

.subscription-modal.active {
    display: flex;
}

.subscription-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.subscription-step h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.subscription-step p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.subscribe-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.subscribe-btn:hover {
    transform: translateY(-3px);
}

.subscription-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.yes-btn, .no-btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.yes-btn {
    background-color: var(--accent-color);
    color: white;
}

.no-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.yes-btn:hover, .no-btn:hover {
    transform: translateY(-3px);
}

/* Стили для блока предупреждения */
.warning-block {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

[data-theme="dark"] .warning-block {
    background-color: #5e5220;
    color: #ffda6a;
    border-color: #8a763d;
}

/* Стили для информационного модального окна */
.info-modal {
    display: none; /* Скрываем по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Полупрозрачный фон */
    z-index: 1000; /* Поверх остальных элементов */
    justify-content: center;
    align-items: center;
}

.info-modal.active {
    display: flex; /* Отображаем при добавлении класса active */
}

.info-modal .info-content {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease;
}

.info-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}