/* Кастомные стили для сайта */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #4b5563;
    --background-light: #f8fafc;
    --border-color: #e2e8f0;
}

/* Анимации */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

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

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

/* Custom alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Кастомные кнопки */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Кастомные инпуты */
.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Страница калькулятора */
.calculator-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.number-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-core {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.badge-master {
    background-color: #ede9fe;
    color: #5b21b6;
    border: 1px solid #a78bfa;
}

/* Страница результатов */
.magic-square {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.square-cell {
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    background-color: #f1f5f9;
}

.weak-block {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.strong-block {
    background-color: #dcfce7;
    border-color: #86efac;
}

/* Админка */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.admin-table th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-table tr:hover {
    background-color: #f8fafc;
}

/* Мобильная навигация */
@media (max-width: 768px) {
    .mobile-menu-button {
        display: block;
    }

    .desktop-menu {
        display: none;
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        z-index: 50;
        padding: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .mobile-menu.open {
        transform: translateX(0);
    }

    .calculator-card {
        padding: 1.5rem;
    }
}

/* Плавные переходы */
.transition-all {
    transition: all 0.3s ease;
}

/* Кастомные тени */
.shadow-md-custom {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.shadow-lg-custom {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Стили для PDF viewer */
.pdf-container {
    width: 100%;
    height: 80vh;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: auto;
}

/* Стили для формы админки */
.json-editor {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    tab-size: 4;
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background-color: #f8fafc;
}

.json-key {
    color: #1e40af;
    font-weight: bold;
}

.json-string {
    color: #047857;
}

.json-number {
    color: #b45309;
}

.json-boolean {
    color: #7e22ce;
}

/* Стили для блоков анкеты */
.block-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.block-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.question-item {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.question-item:hover {
    border-color: #4f46e5;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.scale-container {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.scale-item {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    width: 60px;
}

.scale-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e2e8f0;
    border-radius: 9999px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.scale-fill {
    height: 100%;
    background-color: #4f46e5;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Стили для результатов анкеты */
.level-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.level-high {
    background-color: #dcfce7;
    color: #166534;
}

.level-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.level-low {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Стили для печати */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .page-break {
        page-break-before: always;
    }

    .result-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .calculator-card, .header, .footer {
        display: none !important;
    }
}

/* Кастомные стили для Tailwind нестандартных классов */
.hover\:scale-\[1\.02\]:hover {
    transform: scale(1.02);
}

/* Адаптивные стили */
@media (max-width: 640px) {
    .calculator-card {
        padding: 1.25rem;
    }

    .block-section {
        padding: 1rem;
    }

    .question-item {
        padding: 1rem;
    }
}