/* Custom styles for Telegram Mini App */

/* Telegram WebApp Theme Variables */
:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f1f1f1;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    :root {
        --tg-theme-bg-color: #17212b;
        --tg-theme-text-color: #ffffff;
        --tg-theme-hint-color: #708499;
        --tg-theme-secondary-bg-color: #2b2b2b;
    }
}

/* Base styles */
body {
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Loading animations */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2481cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Pulse animation for loading states */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Slide up animation */
.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-created {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-active {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.status-not-lead {
    background-color: #ffebee;
    color: #c62828;
}

/* Table styles */
.table-row {
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: var(--tg-theme-secondary-bg-color);
}

.table-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Modal styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

/* Toast notifications */
.success-toast {
    background: linear-gradient(135deg, #4caf50, #45a049);
    animation: slideInRight 0.3s ease-out;
}

.error-toast {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Phone input formatting */
.phone-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Auth Container Opacity Transition */
.auth-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-container.show {
    opacity: 1;
}
