/* Components - Bot cards, payment cards, status indicators, etc. */

/* Bot Card - Mobile Optimized */
.bot-card {
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    min-height: 120px;
    touch-action: manipulation;
}

.bot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.bot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.bot-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.bot-username {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
}

.bot-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-status.active {
    background: rgba(48, 209, 88, 0.1);
    color: var(--color-success);
}

.bot-status.inactive {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-error);
}

.bot-status.pending {
    background: rgba(255, 159, 10, 0.1);
    color: var(--color-warning);
}

.bot-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.bot-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.bot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.bot-tariff {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.bot-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Payment Card */
.payment-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.payment-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.payment-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-status.success {
    background: rgba(48, 209, 88, 0.1);
    color: var(--color-success);
}

.payment-status.pending {
    background: rgba(255, 159, 10, 0.1);
    color: var(--color-warning);
}

.payment-status.failed {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-error);
}

.payment-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.payment-date {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Tariff Card - Mobile Optimized */
.tariff-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    min-height: 160px;
    touch-action: manipulation;
}

.tariff-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.tariff-card.selected {
    border-color: var(--color-primary);
    background: rgba(0, 122, 255, 0.05);
}

.tariff-card.popular {
    border-color: var(--color-primary);
}

.tariff-card.popular::before {
    content: 'Популярный';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--text-white);
    padding: 4px 12px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
}

.tariff-card.admin-option {
    border: 2px solid #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.tariff-card.admin-option.selected {
    border: 2px solid #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

.tariff-badge.admin-badge {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    font-weight: bold;
}

.admin-fields {
    margin-top: 20px;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.admin-fields .form-group {
    margin-bottom: 15px;
}

.admin-fields .form-group:last-child {
    margin-bottom: 0;
}

.admin-fields .form-label {
    color: #4caf50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-fields .form-input {
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.admin-fields .form-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.admin-fields .form-help {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.tariff-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.tariff-price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.tariff-price-current {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.tariff-price-old {
    font-size: 16px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.tariff-description {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px 12px;
    border-radius: var(--border-radius-large);
    font-size: 14px;
    font-weight: 600;
}

.status-badge.success {
    background: var(--color-success);
    color: var(--text-white);
}

.status-badge.warning {
    background: var(--color-warning);
    color: var(--text-white);
}

.status-badge.error {
    background: var(--color-error);
    color: var(--text-white);
}

.status-badge.info {
    background: var(--color-primary);
    color: var(--text-white);
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 120px;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.long {
    width: 100%;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal - Mobile Optimized */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    /* padding: var(--spacing-md); */
    padding-bottom: 50px;
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    padding: var(--spacing-xl);
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    min-width: 300px;
    box-shadow: var(--shadow-medium);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast.info {
    border-left: 4px solid var(--color-primary);
}

/* Icon styles */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* Telegram WebApp dark theme support */
body.tg-dark-theme .bot-card,
body.tg-dark-theme .payment-card,
body.tg-dark-theme .tariff-card {
    background: rgba(29, 39, 51, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.tg-dark-theme .bot-card:hover,
body.tg-dark-theme .tariff-card:hover {
    border-color: #0a84ff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

body.tg-dark-theme .bot-info h3,
body.tg-dark-theme .payment-amount,
body.tg-dark-theme .tariff-name,
body.tg-dark-theme .tariff-price-current,
body.tg-dark-theme .empty-state-title,
body.tg-dark-theme .modal-title {
    color: #ffffff;
}

body.tg-dark-theme .bot-username,
body.tg-dark-theme .bot-description,
body.tg-dark-theme .payment-description,
body.tg-dark-theme .tariff-description,
body.tg-dark-theme .empty-state-description {
    color: #98989d;
}

body.tg-dark-theme .bot-tariff {
    color: #0a84ff;
}

body.tg-dark-theme .payment-date,
body.tg-dark-theme .tariff-price-old {
    color: #636366;
}

body.tg-dark-theme .tariff-card.selected {
    background: rgba(10, 132, 255, 0.1);
    border-color: #0a84ff;
}

body.tg-dark-theme .tariff-card.admin-option {
    border: 2px solid #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

body.tg-dark-theme .tariff-card.admin-option.selected {
    border: 2px solid #4caf50;
    background: rgba(76, 175, 80, 0.3);
}

body.tg-dark-theme .admin-fields {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

body.tg-dark-theme .admin-fields .form-label {
    color: #81c784;
}

body.tg-dark-theme .admin-fields .form-input {
    background: var(--bg-tertiary);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: var(--text-primary);
}

body.tg-dark-theme .admin-fields .form-input:focus {
    border-color: #81c784;
    box-shadow: 0 0 0 2px rgba(129, 199, 132, 0.2);
}

body.tg-dark-theme .admin-fields .form-help {
    color: var(--text-secondary);
}

body.tg-dark-theme .modal {
    background: var(--bg-secondary);
}

body.tg-dark-theme .modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.tg-dark-theme .toast {
    background: var(--bg-glass);
    border-color: var(--border-color);
}

body.tg-dark-theme .loading-skeleton {
    background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%);
}

/* Mobile-first styles are already applied above */
