/* calc/assets/css/calculators/gift-wrapping.css */

/* --- Gift Theme --- */
:root {
    --gift-bg: #FDF4FF;
    --gift-primary: #86198F; /* Purple 800 */
    --gift-accent: #A21CAF;  /* Fuchsia 700 */
    --gift-light: #E879F9;
    
    --paper-color: #F5D0FE; 
    --box-border: #A21CAF;
    --dim-line: #4B5563;
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Grid Layout */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

/* Inputs */
.calc-inputs { padding: 24px; }

.input-section-title { 
    font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; 
    color: var(--text-secondary); 
    margin-bottom: 24px; 
    font-weight: 800;
    border-bottom: 1px solid #F3F4F6; 
    padding-bottom: 8px;
    margin-top: 12px;
}
.input-section-title.second-title { margin-top: 40px; } 

.input-group { margin-bottom: 24px; }
.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input, .input-wrapper select {
    width: 100%; padding: 14px; padding-right: 40px;
    font-size: 16px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s, box-shadow 0.2s;
    font-family: var(--font-main); appearance: none; background: #fff;
}
.input-wrapper input:focus, .input-wrapper select:focus { 
    border-color: var(--gift-accent); 
    box-shadow: 0 0 0 3px rgba(162, 28, 175, 0.1); 
}
.suffix { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; font-size: 14px; }
.select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-secondary); display: flex; }

/* Range Slider */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%;
    background: var(--gift-accent); cursor: pointer; margin-top: -8px;
    border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px; cursor: pointer; background: #E5E7EB; border-radius: 2px;
}
.range-val-center { text-align: center; margin-top: 8px; font-weight: 700; color: var(--gift-accent); }

.soft-divider-small { border: 0; height: 1px; background: #E5E7EB; margin: 32px 0; }

/* --- VISUALIZER --- */
.pattern-visualizer {
    background: #fff; border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px; padding: 24px; margin-bottom: 24px;
    overflow: hidden;
}

.visualizer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.badge-pattern { background: #FDF4FF; color: var(--gift-accent); padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.roll-info { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.pattern-canvas {
    height: 340px; 
    background: #F8FAFC; 
    background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 20px 20px; 
    border-radius: 12px;
    position: relative; display: flex; align-items: center; justify-content: center;
    border: 1px solid #E2E8F0; overflow: hidden;
}

/* Лист бумаги */
.paper-sheet {
    background: var(--paper-color);
    box-shadow: 0 8px 24px rgba(162, 28, 175, 0.15);
    position: relative; display: flex; align-items: center; justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(162, 28, 175, 0.2);
}

.box-outline {
    border: 2px dashed var(--gift-primary);
    background: rgba(255, 255, 255, 0.7);
    position: relative; transition: all 0.4s ease;
    display: flex; align-items: center; justify-content: center;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.box-label {
    font-size: 10px; font-weight: 800; color: var(--gift-primary);
    text-transform: uppercase; text-align: center; line-height: 1.2;
    padding: 4px;
}

/* --- РАЗМЕРЫ (ВЫНОСКИ) --- */
.dim-label {
    position: absolute; font-size: 10px; font-weight: 700; color: var(--text-primary);
    background: rgba(255, 255, 255, 0.95); 
    padding: 2px 6px; border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); white-space: nowrap;
    z-index: 30;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Снизу */
.dim-w { 
    bottom: -30px; left: 50%; transform: translateX(-50%); 
    display: flex; gap: 6px; align-items: center;
}
.dim-w::before, .dim-w::after { content: ''; width: 15px; height: 1px; background: var(--dim-line); opacity: 0.4; }

/* Справа */
.dim-l { 
    right: -30px; top: 50%; transform: translateY(-50%) rotate(90deg);
    display: flex; gap: 6px; align-items: center;
}
.dim-l::before, .dim-l::after { content: ''; width: 15px; height: 1px; background: var(--dim-line); opacity: 0.4; }


.alert-box {
    margin-top: 16px; padding: 12px; border-radius: 8px;
    background: #FEF2F2; color: #DC2626; font-size: 13px; font-weight: 500;
    display: flex; gap: 8px; align-items: flex-start;
}
.hidden { display: none; }

/* Result Card */
.result-card.card--purple {
    background: linear-gradient(135deg, #FDF4FF 0%, #FAE8FF 100%);
    border: 1px solid rgba(162, 28, 175, 0.1); padding: 24px; border-radius: 20px;
}
.result-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.res-group { flex: 1; text-align: center; }
.res-divider { width: 1px; height: 40px; background: rgba(162, 28, 175, 0.1); margin: 0 16px; }
.res-label { display: block; font-size: 12px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; font-weight: 700; }
.res-value { font-size: 24px; font-weight: 800; color: var(--gift-primary); }
.res-footer { text-align: center; font-size: 14px; color: var(--text-secondary); background: rgba(255,255,255,0.5); padding: 8px; border-radius: 8px; }

/* --- INFO & FAQ --- */
.info-wrapper { padding: 60px 0 60px 0; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.06); width: 100%; }
.info-wrapper .container { max-width: 800px; margin: 0 auto; }

.icon-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.3; }
.header-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04); flex-shrink: 0; margin-top: -4px; }
.purple-icon svg { color: #A21CAF; }
.pink-icon svg { color: #DB2777; }
.gold-icon svg { color: #D97706; }

.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; }
.formula-card { background: #fff; border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-soft); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; }
.formula-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.formula-header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.badge-purple { background: #A21CAF; color: #fff; padding: 4px 10px; border-radius: 99px; font-size: 10px; text-transform: uppercase; font-weight: 700; align-self: flex-start; }
.badge-pink { background: #DB2777; color: #fff; padding: 4px 10px; border-radius: 99px; font-size: 10px; text-transform: uppercase; font-weight: 700; align-self: flex-start; }
.math-expression { background: #F9FAFB; border: 1px solid #E5E7EB; padding: 10px; border-radius: 8px; font-weight: 700; color: var(--gift-accent); margin-bottom: 8px; text-align: center; }
.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

.calc-description p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description strong { color: var(--text-primary); }
.calc-description ul { padding-left: 20px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description li { margin-bottom: 8px; }

/* FAQ */
.faq-fuel-style .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-fuel-style .faq-item[open] { border-color: var(--gift-accent); box-shadow: 0 4px 20px rgba(162, 28, 175, 0.1); }
.faq-fuel-style summary.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; position: relative; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-fuel-style summary.faq-question:hover { background-color: #F9FAFB; }
.faq-fuel-style .faq-item[open] summary.faq-question { color: var(--gift-accent); background: #FDF4FF; }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-question .icon-plus { display: none; }
.faq-fuel-style .faq-item[open] summary.faq-question::after { content: '−'; color: var(--gift-accent); }
.faq-answer { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; border-top: 1px solid #F3F4F6; }

@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .icon-heading { 
        display: flex !important; flex-direction: row !important; justify-content: center !important; 
        align-items: center !important; text-align: left; width: 100%; gap: 12px; 
    }
    .header-icon { margin: 0; }
    .formula-card { padding: 24px; text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    .badge-purple, .badge-pink { align-self: center; }
    .math-expression { width: 100%; }
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}