/* ===== Tools Page Styles ===== */

.tools-hero {
    padding: 120px 0 40px;
    background: linear-gradient(135deg, #F8F9FF 0%, #EEF1FF 50%, #F0F7FF 100%);
    position: relative;
    overflow: hidden;
}
.tools-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,91,219,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

/* Tool Navigation Tabs */
.tools-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 32px;
    padding: 6px;
    background: #f4f5fa;
    border-radius: 16px;
}
.tool-nav-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-secondary);
    white-space: nowrap;
}
.tool-nav-btn:hover {
    background: rgba(255,255,255,0.7);
    color: var(--text-primary);
}
.tool-nav-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(59,91,219,0.12);
}

/* Tool Panels */
.tool-panel {
    display: none;
    animation: toolFadeIn 0.35s ease;
}
.tool-panel.active {
    display: block;
}
@keyframes toolFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tool Card */
.tool-card {
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
    border-bottom: 1px solid #f0f1f6;
    background: linear-gradient(135deg, #fafbff, #f5f7ff);
}
.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: white;
    box-shadow: 0 2px 8px rgba(59,91,219,0.1);
    flex-shrink: 0;
}
.tool-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}
.tool-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.tool-body {
    padding: 32px;
}
.tool-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.styled-input,
.tool-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e5ef;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #fafbff;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.styled-input:focus,
.tool-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,91,219,0.1);
    background: white;
}

/* Styled Range */
.styled-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, #e2e5ef 0%);
    border-radius: 6px;
    outline: none;
    margin-top: 4px;
}
.styled-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59,91,219,0.3);
    border: 3px solid white;
}

/* Radio Cards */
.radio-group {
    display: flex;
    gap: 8px;
}
.radio-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 1.5px solid #e2e5ef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: #fafbff;
}
.radio-card input { display: none; }
.radio-card span { font-weight: 600; font-size: 0.85rem; }
.radio-card small { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }
.radio-card.active,
.radio-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59,91,219,0.06);
    color: var(--primary);
}
.radio-card:hover {
    border-color: var(--primary);
}

/* Result Area */
.tool-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.result-card {
    background: linear-gradient(135deg, #f8f9ff, #eef1ff);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: center;
}
.result-card.main-result {
    background: linear-gradient(135deg, #3B5BDB, #5B7CFF);
    color: white;
    padding: 28px;
}
.result-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 6px;
}
.result-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
}
.result-value.accent {
    color: var(--primary);
}
.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9ff;
    border-radius: 10px;
    font-size: 0.88rem;
}
.result-row span:last-child {
    font-weight: 700;
    color: var(--text-primary);
}
.profit-positive { color: #16a34a !important; }

/* ROI Gauge */
.roi-gauge {
    background: #f0f0f5;
    border-radius: 12px;
    height: 40px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}
.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 12px;
    transition: width 0.6s ease;
}
.gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Text Generator */
.generated-text-area {
    background: #fafbff;
    border: 1.5px solid #e2e5ef;
    border-radius: 16px;
    overflow: hidden;
}
.text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f0f2f8;
    font-weight: 600;
    font-size: 0.85rem;
}
.copy-btn {
    padding: 6px 14px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.copy-btn:hover { background: #2B4BC8; }
.text-output {
    padding: 20px;
    min-height: 200px;
    white-space: pre-wrap;
    font-size: 0.92rem;
    line-height: 1.6;
}
.text-placeholder {
    color: var(--text-tertiary);
    text-align: center;
    padding: 40px 20px;
}
.text-tips {
    margin-top: 16px;
    padding: 20px;
    background: #fffdf0;
    border: 1px solid #fde68a;
    border-radius: 14px;
}
.text-tips h4 { margin: 0 0 10px; font-size: 0.9rem; }
.text-tips ul { margin: 0; padding-left: 20px; }
.text-tips li { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }

/* Channel Matcher Results */
.match-results .match-card {
    padding: 16px;
    background: #f8f9ff;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid #e8eaf2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.match-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}
.match-card-info h4 { margin: 0; font-size: 0.95rem; }
.match-card-info p { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.match-card-price { font-weight: 800; color: var(--primary); font-size: 1.1rem; white-space: nowrap; }
.match-summary {
    margin-top: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #3B5BDB, #5B7CFF);
    color: white;
    border-radius: 16px;
    text-align: center;
}
.match-summary strong { font-size: 1.3rem; display: block; margin-top: 6px; }

/* Heatmap */
.planner-heatmap {
    margin-bottom: 32px;
}
.planner-heatmap h3 { margin: 0 0 4px; }
.heatmap-grid {
    display: grid;
    grid-template-columns: 80px repeat(24, 1fr);
    gap: 2px;
    font-size: 0.7rem;
}
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: default;
    transition: transform 0.15s;
    min-height: 28px;
}
.heatmap-cell:hover { transform: scale(1.15); z-index: 2; }
.heatmap-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    padding-right: 8px;
}
.heatmap-hour {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 4px 0;
}
.heatmap-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    justify-content: center;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

/* Planner Tips */
.planner-tips {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.tip-card {
    padding: 20px;
    background: #f8f9ff;
    border-radius: 16px;
    border: 1px solid #e8eaf2;
    text-align: center;
    transition: all 0.2s;
}
.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59,91,219,0.1);
}
.tip-icon { font-size: 2rem; margin-bottom: 8px; }
.tip-card h4 { margin: 0 0 6px; font-size: 0.95rem; }
.tip-card p { margin: 0; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

/* Other Tools Grid (individual pages) */
.other-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.other-tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
}
.other-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59,91,219,0.1);
    border-color: var(--primary);
}
.other-tool-icon { font-size: 1.8rem; flex-shrink: 0; }
.other-tool-card strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.other-tool-card p { margin: 0; font-size: 0.8rem; color: var(--text-secondary); }

/* Tools Hub Cards */
.tools-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.tool-hub-card {
    display: block;
    padding: 28px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.tool-hub-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(59,91,219,0.12);
    border-color: var(--primary);
}
.tool-hub-card .hub-icon { font-size: 2.5rem; margin-bottom: 12px; }
.tool-hub-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.tool-hub-card p { margin: 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.tool-hub-card .hub-arrow {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-grid-2 { grid-template-columns: 1fr; }
    .tools-nav { gap: 4px; padding: 4px; }
    .tool-nav-btn { padding: 10px 12px; font-size: 0.78rem; }
    .tool-header { padding: 20px; flex-direction: column; text-align: center; }
    .tool-body { padding: 20px; }
    .radio-group { flex-direction: column; }
    .planner-tips { grid-template-columns: 1fr 1fr; }
    .heatmap-grid { grid-template-columns: 60px repeat(24, 1fr); font-size: 0.55rem; }
    .heatmap-cell { min-height: 20px; }
    .result-value { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .planner-tips { grid-template-columns: 1fr; }
    .tools-nav { flex-direction: column; }
    .tool-nav-btn { width: 100%; }
    .other-tools-grid { grid-template-columns: 1fr; }
    .tools-hub-grid { grid-template-columns: 1fr; }
}
