/* Telegram Mini App Design System - Professional Mobile-First */
:root {
    /* Primary colors */
    /* --bg-color: #000000;
    --card-bg: #141414;
    --card-bg-active: #1E1E1E; */

    /* --bg-color: #ebebeb;
    --card-bg: #e2e2e2; */
    /* --card-bg-active: #d9d9d9; */
    --bg-color: #ffffff;
    --card-bg: rgb(247, 248, 250);
    --card-bg-active: rgb(240, 241, 243);

    /* Highlight colors */
    --primary-color: #007f5f;
    --primary-color-light: #007f5f61;
    --primary-color-dark: #007a5c;

    /* --primary-color: #094074;
    --primary-color-light: #09407459;
    --primary-color-dark: #063a6b; */



    /* Text colors */
    /* --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --text-tertiary: #666666; */

    --text-primary: #000000;
    --text-secondary: rgb(112, 117, 121);

    /* Other colors */
    /* --border-color: #2A2A2A;
    --separator-color: #2A2A2A; */

    --border-color: rgb(224, 224, 224);
    --separator-color: rgb(224, 224, 224);
    --coin-color: #cf9e00;
    --coin-color-light: #f0b80056;

    /* Mobile-optimized spacing system */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-xxl: 32px;

    /* Mobile-optimized font sizes */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --font-size-xxxl: 28px;

    /* Touch targets */
    --touch-target-min: 44px;
    --button-height: 48px;
    --button-height-lg: 52px;

    /* Animation */
    --timing-standard: cubic-bezier(0.2, 0.0, 0.2, 1);

    /* Safe areas for mobile */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
    font-weight: 400;
    font-size: var(--font-size-md);
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    :root {
        --space-lg: 16px;
        --space-xl: 20px;
        --space-xxl: 24px;
    }
}

.container {
    padding: var(--space-md) var(--space-md) calc(80px + var(--space-lg) + var(--safe-area-bottom));
    max-width: 100%;
}

#mainContent {
    opacity: 0;
    transition: opacity 0.3s var(--timing-standard);
}

#mainContent.loaded {
    opacity: 1;
}

/* Page Loader */
.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    padding: var(--space-md);
    padding-top: calc(var(--space-md) + var(--safe-area-top));
    padding-bottom: calc(80px + var(--space-lg) + var(--safe-area-bottom));
}

.page-loader .icon i {
    font-size: 100px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Page transition overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 8888;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--timing-standard);
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* Navigation Styles - Mobile Optimized */
.navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(75px + var(--safe-area-bottom));
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 10px 0 calc(10px + var(--safe-area-bottom));
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 4px;
    width: 25%;
    min-height: var(--touch-target-min);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all 0.15s ease;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active i {
    color: var(--primary-color);
}

.nav-item:active {
    opacity: 0.7;
    transform: scale(0.95);
}

/* Modal system - Fixed for mobile */
.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    visibility: hidden;
    transform: translateY(100%);
    transition: all 0.3s var(--timing-standard);
}

.modal.active {
    visibility: visible;
    transform: translateY(0);
}

.modal-container {
    background-color: var(--card-bg);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    max-height: calc(90vh - var(--safe-area-top));
    display: flex;
    flex-direction: column;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--timing-standard);
}

.modal.active~.modal-overlay,
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 60px;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.back-button,
.close-button {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border-radius: 22px;
    background-color: var(--card-bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.back-button i,
.close-button i {
    font-size: 18px;
}

.back-button:active,
.close-button:active {
    opacity: 0.8;
    transform: scale(0.95);
}

.modal-content-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-content-loading i {
    font-size: var(--font-size-xl);
}

.modal-content {
    padding: var(--space-lg);
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 140px - var(--safe-area-top));
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: var(--card-bg);
}

.modal-button {
    width: 100%;
    height: var(--button-height-lg);
    border-radius: 12px;
    font-size: var(--font-size-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s var(--timing-standard);
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
}

.modal-button-secondary {
    width: 100%;
    height: var(--button-height-lg);
    border-radius: 12px;
    font-size: var(--font-size-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s var(--timing-standard);
    background-color: var(--card-bg-active);
    color: var(--text-primary);
    border: none;
}

.modal-button:active,
.modal-button-secondary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Toast notification - Mobile optimized */
.toast {
    position: fixed;
    bottom: calc(85px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg);
    padding: var(--space-md) var(--space-lg);
    border-radius: 12px;
    width: calc(100% - 32px);
    max-width: 320px;
    z-index: 11000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-right: 1px solid var(--border-color);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    font-size: var(--font-size-md);
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}

/* Page Header - Mobile Optimized */
.page-header {
    margin-bottom: var(--space-lg);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

/* Cards - Mobile Optimized */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


/* Button styles - Mobile Touch Optimized */
/* .button,
.invite-button */
.button {
    min-height: var(--touch-target-min);
    padding: 0 var(--space-lg);
    border-radius: 12px;
    font-size: var(--font-size-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s var(--timing-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* .button:active, */
/* .invite-button:active */
.button:active {
    transform: scale(0.98);
}

/* Input styles - Mobile optimized */
.input-group {
    display: flex;
    align-items: center;
    background-color: var(--card-bg-active);
    border-radius: 12px;
    min-height: var(--button-height-lg);
    padding: 0 var(--space-md);
    overflow: hidden;
}

.form-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-md);
    padding: 0;
    height: 100%;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.disabled {
    pointer-events: none !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Table styles */
.responsive-table {
  overflow-x: auto;
  width: 100%;
}

.responsive-table table {
  width: 100%;
  border-collapse: collapse;
}

.responsive-table table th, .responsive-table table td {
  padding: 8px;
  text-align: left;
}

.responsive-table thead th, .responsive-table thead td {
  border-bottom: 2px solid var(--border-color);
}

.responsive-table tbody th, .responsive-table tbody td {
  border-top: 1px solid var(--border-color);
}

/* Select/Dropdown styles */
.dropdown {
    position: relative;
    width: 100%;
    user-select: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.dropdown-trigger {
    background-color: var(--card-bg-active);
    color: var(--text-tertiary);
    /* padding: 10px 14px; */
    /* border-radius: 6px; */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 12px;
    min-height: var(--button-height-lg);
    padding: 0 var(--space-md);
}

.dropdown-trigger i {
    margin-right: var(--space-sm);
    color: var(--primary-color);
    font-weight: 900;
}

.dropdown-trigger::after {
    content: '▾';
    margin-left: 10px;
    color: var(--text-secondary);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.dropdown-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-option:hover {
    background: var(--card-bg-active);
}

.dropdown-option.selected {
    background: var(--card-bg-active);
}

/* Loading animations */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse-animation {
  animation: pulseAnim 1.5s ease-in-out infinite;
}

@keyframes pulseAnim {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(1, 41, 112, 0.0); }
  50%  { transform: scale(1.05); box-shadow: 0 0 10px 3px rgba(1, 41, 112, 0.3); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(1, 41, 112, 0.0); }
}

/* Rotation Animation */
.rotate-animation {
    animation: rotateAnimation 2.05s cubic-bezier(0.6, 0.17, 0.29, 0.99) infinite;
}

i.rotate-animation {
    display: inline-block; /* Prevents flattening - FontAwesome Icon */
    transform-origin: center;
}

@keyframes rotateAnimation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Shake Animation */
.shake-animation {
  animation: shakeAnim 1.5s cubic-bezier(.36,.07,.19,.97) infinite;
}

@keyframes shakeAnim {
  10%, 90% {
    transform: translate(-2px, 0);
  }

  20%, 80% {
    transform: translate(4px, 0);
  }

  30%, 50%, 70% {
    transform: translate(-6px, 0);
  }

  40%, 60% {
    transform: translate(6px, 0);
  }
}


/* User Settings Modal */
.user-setting-section {
    margin-bottom: var(--space-lg);
}

.user-setting-label {
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.telegram-notify-item {
    display: flex;
    align-items: center;
    padding: var(--space-lg);
    background-color: var(--card-bg-active);
    border-radius: 12px;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.telegram-notify-option-toggle {
    flex-shrink: 0;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(20px);
}

.telegram-notify-option-info {
    flex: 1;
}

.telegram-notify-option-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}


.users-online-count-badge {
    /* color: var(--primary-color); */
    color: var(--text-secondary);
    border-radius: 12px;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: fit-content;

    margin-top: 38px;
    margin-bottom: 27px;
}

.users-online-count-badge i {
    margin-right: var(--space-xs);
    font-size: var(--font-size-sm);
}