/* 
 * SetiAI Unified Styles
 * Единый стиль для всех страниц платформы
 * Version: 1.0.0
 */

/* ==================== VARIABLES ==================== */
:root {
    /* Colors */
    --primary-bg: #0F172A; /* Slate 900 */
    --secondary-bg: rgba(15, 23, 42, 0.75);
    --accent-bg: #1E293B; /* Slate 800 */
    --primary-text: #F8FAFC; /* Slate 50 */
    --secondary-text: #94A3B8; /* Slate 400 */
    --accent-text: #38BDF8; /* Sky 400 */
    
    /* Gradients */
    --ai-gradient: linear-gradient(135deg, #2563EB 0%, #0EA5E9 100%); /* Clean modern blue/sky */
    --hero-gradient: linear-gradient(180deg, rgba(37, 99, 235, 0.1) 0%, rgba(15, 23, 42, 0) 100%);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 1rem;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    isolation: isolate !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Chrome GPU Compositing & Parallax Anti-Flicker Hardware Locking */
.overlay-photo-image-bg,
.overlay-photo-image-bg.parallax,
#testimonials-img-bg {
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    will-change: transform !important;
    background-attachment: scroll !important;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--accent-text);
}

/* ==================== UTILITY CLASSES ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-lg);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* ==================== GLASS EFFECT ==================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
}

/* ==================== AI GRADIENT ==================== */
.ai-gradient {
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-gradient-bg {
    background: var(--ai-gradient);
}

/* ==================== NAVIGATION ==================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--spacing-md) 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo {
    width: 40px;
    height: 40px;
    background: var(--ai-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: var(--spacing-xl);
    list-style: none;
}

.nav-link {
    position: relative;
    padding: var(--spacing-sm) 0;
    transition: color var(--transition-normal);
}

.nav-link:hover {
    color: var(--accent-text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ai-gradient);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--ai-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--accent-bg);
    border-color: var(--accent-text);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid var(--glass-border);
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--accent-text);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--secondary-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
}

.card-body {
    color: var(--secondary-text);
}

.card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    font-size: 14px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-text);
    background: rgba(255, 255, 255, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--secondary-text);
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

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

.modal-content {
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

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

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

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-normal);
}

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

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-primary {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    z-index: 3000;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sm);
    animation: notificationSlideIn 0.3s ease;
}

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

.notification-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

.notification-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.notification-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #f59e0b;
}

.notification-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #3b82f6;
}

/* ==================== LOADING ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

/* ==================== GRID ==================== */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ==================== FLEX ==================== */
.flex {
    display: flex;
}

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

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

.flex-col {
    flex-direction: column;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* ==================== CHAT WIDGET ==================== */
.chat-widget {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1500;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--ai-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-normal);
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .nav-links {
        display: none;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: var(--spacing-lg);
    }
    
    .chat-bubble {
        width: 50px;
        height: 50px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideInUp 0.5s ease;
}

.animate-slide-down {
    animation: slideInDown 0.5s ease;
}

.animate-slide-left {
    animation: slideInLeft 0.5s ease;
}

.animate-slide-right {
    animation: slideInRight 0.5s ease;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border);
}

/* ==================== SELECTION ==================== */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* =========================================
   IntroJS Theme Overrides (Glassmorphism) 
   ========================================= */
.introjs-tooltip {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(8, 15, 32, 0.94) 100%) !important;
    backdrop-filter: blur(28px) saturate(165%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(165%) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 1.35rem !important;
    color: #f8fafc !important;
    box-shadow: 0 26px 64px rgba(2, 6, 23, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    font-family: 'Inter', sans-serif !important;
    max-width: 380px !important;
}

.introjs-tooltiptext {
    color: #dbe7f3 !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
}

.introjs-tooltipbuttons {
    border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
}

.introjs-button {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    color: #e2e8f0 !important;
    text-shadow: none !important;
    border-radius: 0.95rem !important;
    padding: 0.7rem 1rem !important;
    transition: all 0.2s ease !important;
}

.introjs-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.22) !important;
    transform: translateY(-1px) !important;
}

.introjs-nextbutton {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
    border: none !important;
    font-weight: 600 !important;
    color: white !important;
}

.introjs-nextbutton:hover {
    background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26) !important;
}

.introjs-bullets ul li a {
    background: rgba(255, 255, 255, 0.2) !important;
}

.introjs-bullets ul li a.active {
    background: #38bdf8 !important;
}

.introjs-arrow.top {
    border-bottom-color: rgba(15, 23, 42, 0.96) !important;
}
.introjs-arrow.bottom {
    border-top-color: rgba(15, 23, 42, 0.96) !important;
}
.introjs-arrow.left {
    border-right-color: rgba(15, 23, 42, 0.96) !important;
}
.introjs-arrow.right {
    border-left-color: rgba(15, 23, 42, 0.96) !important;
}
