/* calculator-template.css */

/* ===== ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ ===== */
.calculator-template-page {
    padding: 40px 0;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    min-height: 100vh;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    margin-bottom: 30px;
    font-size: 0.95rem;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.breadcrumbs a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: #6366f1;
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 12px;
    color: #9ca3af;
    font-weight: 300;
}

.breadcrumbs span:last-child {
    color: #1f2937;
    font-weight: 500;
}

/* ===== ШАПКА ШАБЛОНА ===== */
.template-header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 40px;
    padding: 35px;
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.template-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.template-icon {
    font-size: 3rem;
    line-height: 1;
    min-width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.template-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.template-info h1 {
    margin: 0 0 12px 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.template-description {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 800px;
}

.template-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.template-category {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== КАРТОЧКА КАЛЬКУЛЯТОРА ===== */
.template-calculator-container {
    margin-bottom: 50px;
}

.calculator-card {
    background: white;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(79, 70, 229, 0.3);
}

.calculator-header {
    padding: 25px 35px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
}

.calculator-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculator-header h2::before {
    content: '🧮';
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.calculator-body {
    padding: 40px 35px;
    background: white;
}

/* ===== ФОРМА КАЛЬКУЛЯТОРА ===== */
.calculator-form {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    position: relative;
}

/* Сетка полей */
.visualizer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    width: 100%;
}

.visualizer-field {
    padding: 0 10px;
    box-sizing: border-box;
    transition: all 0.3s;
    animation: fadeIn 0.5s ease-out;
}

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

/* Поля ввода */
.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
}

.form-control:hover {
    border-color: #94a3b8;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: scale(1.02);
}

/* Метки полей */
.visualizer-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Чекбокс */
.form-checkbox {
    width: 22px;
    height: 22px;
    margin-right: 10px;
    accent-color: #4f46e5;
    cursor: pointer;
    transition: transform 0.2s;
}

.form-checkbox:hover {
    transform: scale(1.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 12px 18px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
}

/* Селект */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234f46e5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

/* Поле результата */
.visualizer-result {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #38bdf8;
    border-radius: 20px;
    padding: 20px 25px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
    transition: all 0.3s;
}

.visualizer-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0284c7;
    background: rgba(255,255,255,0.5);
    padding: 5px 20px;
    border-radius: 40px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Кнопка расчета */
.calculate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calculate-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;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.6);
}

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

.calculate-btn:active {
    transform: translateY(-1px);
}

/* ===== КОНТЕНТ С ИНФОРМАЦИЕЙ ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-bottom: 60px;
}

.content-main {
    background: white;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.content-main h2 {
    color: #1e293b;
    font-size: 2rem;
    margin: 0 0 25px 0;
    position: relative;
    padding-bottom: 15px;
}

.content-main h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: 2px;
}

.content-main h3 {
    color: #334155;
    font-size: 1.5rem;
    margin: 35px 0 20px 0;
}

.template-full-description {
    line-height: 1.8;
    color: #475569;
    font-size: 1.1rem;
}

.how-to-use {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 30px;
    border-radius: 20px;
    border-left: 6px solid #4f46e5;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.how-to-use p {
    margin: 0 0 15px 0;
    line-height: 1.7;
    color: #334155;
}

.how-to-use ul, .how-to-use ol {
    margin: 15px 0 0 20px;
    padding: 0;
}

.how-to-use li {
    margin-bottom: 10px;
    color: #475569;
}

/* Сайдбар */
.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.features-box,
.share-box {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s;
}

.features-box:hover,
.share-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.1);
}

.features-box h3,
.share-box h3 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-box h3::before {
    content: '✨';
    font-size: 1.5rem;
}

.share-box h3::before {
    content: '📢';
    font-size: 1.5rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 10px 0;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 7px;
    align-items: flex-start;
    line-height: 1.1;
}

.features-list li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

.features-list li:last-child {
    border-bottom: none;
}

.share-btn {
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
}

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

/* ===== ПОХОЖИЕ КАЛЬКУЛЯТОРЫ ===== */
.similar-templates {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px dashed #e2e8f0;
}

.similar-templates h2 {
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.similar-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 25px;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

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

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

.similar-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
    border-color: #4f46e5;
}

.similar-icon {
    font-size: 2.5rem;
    min-width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(56, 189, 248, 0.2);
}

.similar-info {
    flex: 1;
}

.similar-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
}

.similar-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .template-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 30px 20px;
    }
    
    .template-icon {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }
    
    .template-info h1 {
        font-size: 2rem;
    }
    
    .template-description {
        font-size: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-header h2 {
        font-size: 1.5rem;
    }
    
    .calculator-header h2::before {
        font-size: 1.5rem;
    }
    
    .visualizer-result {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .similar-grid {
        grid-template-columns: 1fr;
    }
    
    .content-main {
        padding: 25px;
    }
    
    .content-main h2 {
        font-size: 1.8rem;
    }
    
    .content-main h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .template-info h1 {
        font-size: 1.6rem;
    }
    
    .calculator-header {
        padding: 20px;
    }
    
    .calculator-body {
        padding: 25px 20px;
    }
    
    .form-control {
        padding: 12px 15px;
    }
    
    .calculate-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .features-box,
    .share-box {
        padding: 20px;
    }
}

/* ===== УТИЛИТЫ ===== */
.text-muted {
    color: #64748b;
    font-size: 0.95rem;
}

/* Анимации */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Стили для скролла */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    border-radius: 6px;
    border: 3px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4338ca, #6366f1);
}