* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Telegram-inspired color palette */
    --primary-color: #0088cc;
    --primary-dark: #006699;
    --primary-light: #40a7e3;
    --secondary-color: #25d366;
    --accent-purple: #9c27b0;
    --accent-orange: #ff9800;
    --accent-pink: #e91e63;
    
    /* Background colors - subtle and bright */
    --background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    --card-background: #ffffff;
    --card-hover: #fafbfc;
    --text-primary: #212121;
    --text-secondary: #607d8b;
    --border-color: #e1e8ed;
    
    /* Status colors */
    --success-color: #4caf50;
    --success-light: #c8e6c9;
    --error-color: #f44336;
    --error-light: #ffcdd2;
    --warning-color: #ff9800;
    --warning-light: #ffe0b2;
    --info-color: #2196f3;
    --info-light: #bbdefb;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-hover: 0 6px 20px rgba(0, 136, 204, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* Animated Telegram-style icons */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

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

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.telegram-icon {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    font-size: 1.2em;
}

.telegram-icon-2 {
    animation-delay: 0.5s;
}

.telegram-icon-3 {
    animation-delay: 1s;
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 247, 255, 0.98) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 136, 204, 0.2);
    padding: 1.2rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color), var(--accent-purple), var(--secondary-color)) 1;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: "✈️";
    font-size: 1.3em;
    animation: float 2s ease-in-out infinite;
    display: inline-block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    position: relative;
}

nav a:hover {
    color: var(--primary-color);
    background: rgba(0, 136, 204, 0.1);
    transform: translateY(-2px);
}

nav a.active {
    color: var(--primary-color);
    background: rgba(0, 136, 204, 0.15);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-purple));
    border-radius: 2px;
}

/* Cards */
.card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideIn 0.5s ease-out;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    box-shadow: 0 16px 48px rgba(0, 136, 204, 0.2), 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title::before {
    content: "📋";
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    animation: slideIn 0.6s ease-out;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-background);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--accent-purple) 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    background-size: 200% 200%;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px) scale(1.05);
    animation: gradientShift 1s ease infinite;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #66bb6a 50%, #81c784 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-success:hover {
    background: linear-gradient(135deg, #388e3c 0%, var(--success-color) 50%, #66bb6a 100%);
    background-size: 200% 200%;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px) scale(1.05);
    animation: gradientShift 1s ease infinite;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #ef5350 50%, #e57373 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c62828 0%, var(--error-color) 50%, #ef5350 100%);
    background-size: 200% 200%;
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px) scale(1.05);
    animation: gradientShift 1s ease infinite;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffb74d 50%, #ffcc80 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f57c00 0%, var(--warning-color) 50%, #ffb74d 100%);
    background-size: 200% 200%;
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px) scale(1.05);
    animation: gradientShift 1s ease infinite;
}

.btn-secondary {
    background: linear-gradient(135deg, #607d8b, #78909c);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #455a64, #607d8b);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    padding: 1.2rem 1rem;
    position: relative;
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

tr {
    transition: all 0.2s ease;
}

tr:hover {
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.05) 0%, rgba(156, 39, 176, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.15);
    border-left: 4px solid var(--primary-color);
}

tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-color);
}

.badge-success::before {
    content: "✓";
    animation: pulse 2s ease-in-out infinite;
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.badge-warning::before {
    content: "⏳";
    animation: pulse 2s ease-in-out infinite;
}

.badge-danger {
    background: var(--error-light);
    color: var(--error-color);
}

.badge-danger::before {
    content: "✕";
    animation: pulse 2s ease-in-out infinite;
}

.badge-info {
    background: var(--info-light);
    color: var(--info-color);
}

.badge-info::before {
    content: "ℹ";
    animation: pulse 2s ease-in-out infinite;
}

/* Progress bars */
.progress-container {
    margin: 1.5rem 0;
    animation: slideIn 0.5s ease-out;
}

.progress-bar {
    width: 100%;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-purple));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s linear infinite;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    animation: slideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 136, 204, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    box-shadow: 0 16px 40px rgba(0, 136, 204, 0.25), 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-12px) scale(1.05) rotate(1deg);
    border-color: var(--primary-light);
    background: linear-gradient(145deg, #ffffff 0%, #e8f4ff 100%);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideIn 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid;
}

.alert-success {
    background: var(--success-light);
    color: #2e7d32;
    border-left-color: var(--success-color);
}

.alert-success::before {
    content: "✅";
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

.alert-error {
    background: var(--error-light);
    color: #c62828;
    border-left-color: var(--error-color);
}

.alert-error::before {
    content: "❌";
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

.alert-info {
    background: var(--info-light);
    color: #1565c0;
    border-left-color: var(--info-color);
}

.alert-info::before {
    content: "ℹ️";
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.active {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.inactive {
    background: var(--text-secondary);
}

.status-indicator.processing {
    background: var(--warning-color);
    box-shadow: 0 0 8px var(--warning-color);
    animation: pulse 1s ease-in-out infinite;
}

/* Login/Register pages */
.auth-container {
    max-width: 420px;
    margin: 5rem auto;
    padding: 2.5rem;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.6s ease-out;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
}

.auth-container .form-group:last-child {
    margin-bottom: 0;
}

.auth-container .btn {
    width: 100%;
    margin-top: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Headings */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    animation: slideIn 0.6s ease-out;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}

/* Loading states */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loading {
    animation: bounce 1s ease-in-out infinite;
}

/* Success animations */
@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-animation {
    animation: successPop 0.5s ease-out;
}

/* Pulse glow effect */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 136, 204, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 136, 204, 0.8), 0 0 30px rgba(0, 136, 204, 0.4); }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-light);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}
