/* CoreOptimize AI Tools - Frontend Styles */

:root {
    --core-primary: #2563eb;
    --core-secondary: #0f172a;
    --core-accent: #10b981;
    --core-base: #0b0f19;
    --core-surface: #111827;
    --core-surface-light: #1a2233;
    --core-text: #e2e8f0;
    --core-muted: #94a3b8;
    --core-border: #1f2937;
    --core-border-light: #334155;
    --core-success: #10b981;
    --core-warning: #f59e0b;
    --core-error: #ef4444;
    --core-radius: 16px;
    --core-shadow: 0 18px 35px rgba(15, 23, 42, 0.25);
}

/* Base tool wrapper */
.coreoptimize-tool {
    background: var(--core-surface);
    border-radius: var(--core-radius);
    border: 1px solid rgba(51, 65, 85, 0.6);
    box-shadow: var(--core-shadow);
    padding: 32px;
    margin: 32px 0;
    color: var(--core-text);
}

.coreoptimize-tool__header {
    margin-bottom: 24px;
}

.coreoptimize-tool__title {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    color: #fff;
}

.coreoptimize-tool__description {
    margin: 0;
    color: var(--core-muted);
    font-size: 1.02rem;
}

.coreoptimize-tool__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 28px;
}

@media (max-width: 1024px) {
    .coreoptimize-tool__grid {
        grid-template-columns: 1fr;
    }
}

.coreoptimize-tool__column {
    background: rgba(15, 23, 42, 0.65);
    border-radius: calc(var(--core-radius) - 4px);
    border: 1px solid rgba(51, 65, 85, 0.45);
    padding: 24px;
}

.coreoptimize-tool__column--sidebar {
    display: grid;
    gap: 18px;
}

.coreoptimize-tool__insight-card {
    background: rgba(14, 23, 38, 0.85);
    border-radius: 14px;
    border: 1px solid rgba(71, 85, 105, 0.45);
    padding: 18px 20px;
}

.coreoptimize-tool__insight-card--highlight {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.45);
}

.coreoptimize-tool__insight-card h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #fff;
}

.coreoptimize-tool__insight-card p {
    margin: 0;
    color: var(--core-muted);
    line-height: 1.5;
}

.coreoptimize-tool__insight-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    color: var(--core-muted);
}

.coreoptimize-tool__insight-card li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coreoptimize-tool__insight-card .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    background: rgba(148, 163, 184, 0.25);
    color: var(--core-text);
}

.badge--excellent { background: rgba(16, 185, 129, 0.18); color: var(--core-success); }
.badge--good { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.badge--warning { background: rgba(245, 158, 11, 0.18); color: var(--core-warning); }
.badge--danger { background: rgba(239, 68, 68, 0.18); color: var(--core-error); }

.coreoptimize-tool__result {
    background: rgba(12, 21, 34, 0.8);
    border: 1px solid rgba(45, 57, 81, 0.55);
    border-radius: 14px;
    padding: 20px;
}

.coreoptimize-tool__result-placeholder {
    display: grid;
    gap: 14px;
}

.placeholder-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--core-muted);
}

.placeholder-score {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    padding: 16px 18px;
}

.placeholder-score__value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--core-accent);
    line-height: 1;
}

.placeholder-score__label {
    font-size: 0.9rem;
    color: var(--core-muted);
}

.placeholder-recommendation {
    margin: 0;
    color: var(--core-muted);
    line-height: 1.55;
}

.placeholder-link, .placeholder-link:visited {
    color: var(--core-primary);
    font-weight: 600;
}

.placeholder-link:hover {
    color: var(--core-accent);
}

/* Form styling */
.techinovex-tool-form {
    background: rgba(14, 23, 38, 0.85);
    border: 1px solid rgba(45, 61, 92, 0.55);
    border-radius: calc(var(--core-radius) - 4px);
    padding: 24px;
    color: var(--core-text);
    box-shadow: inset 0 0 0 1px rgba(56, 78, 110, 0.25);
}

.techinovex-form-fields {
    display: grid;
    gap: 18px;
}

.techinovex-field-group label {
    color: #dbe7ff;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.techinovex-field-group input,
.techinovex-field-group select,
.techinovex-field-group textarea {
    background: rgba(11, 17, 28, 0.92);
    border: 1px solid rgba(56, 78, 110, 0.6);
    color: var(--core-text);
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.techinovex-field-group input:focus,
.techinovex-field-group select:focus,
.techinovex-field-group textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.75);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    background: rgba(11, 17, 28, 1);
}

.techinovex-field-group input::placeholder,
.techinovex-field-group textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.techinovex-field-description {
    color: rgba(148, 163, 184, 0.75);
    font-size: 0.75rem;
}

.techinovex-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.techinovex-submit-btn {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--core-primary), #3b82f6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.techinovex-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.35);
}

.techinovex-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.techinovex-submit-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 999px;
    animation: core-spin 0.75s linear infinite;
}

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

/* Result container (AJAX target) */
.techinovex-result-container {
    margin-top: 18px;
}

.techinovex-result {
    background: rgba(12, 20, 33, 0.95);
    border-radius: 14px;
    border: 1px solid rgba(56, 78, 110, 0.55);
    padding: 22px;
    animation: core-fade-in 0.4s ease;
    color: var(--core-text);
}

.techinovex-result h4,
.techinovex-result h5 {
    color: #fff;
    margin: 0 0 10px;
    font-weight: 700;
}

.techinovex-result p,
.techinovex-result li {
    color: var(--core-muted);
    line-height: 1.6;
}

.techinovex-result-success {
    border-left: 4px solid var(--core-success);
}

.techinovex-result-error {
    border-left: 4px solid var(--core-error);
}

@keyframes core-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generic tool cards / grid styles (other tools) */
.techinovex-all-tools {
    display: grid;
    gap: 22px;
}

.techinovex-tool-card {
    background: var(--core-surface-light);
    border-radius: 14px;
    border: 1px solid rgba(51, 65, 85, 0.6);
    padding: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.techinovex-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.25);
}

.techinovex-tool-card .tool-icon {
    font-size: 32px;
    color: var(--core-primary);
    margin-bottom: 12px;
}

.techinovex-tool-card .tool-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #fff;
}

.techinovex-tool-card .tool-description {
    margin: 0 0 14px;
    color: var(--core-muted);
}

/* Tabs */
.techinovex-tool-tabs {
    background: rgba(14, 21, 34, 0.9);
    border-radius: var(--core-radius);
    border: 1px solid rgba(51, 65, 85, 0.6);
    overflow: hidden;
}

.techinovex-tab-buttons {
    display: flex;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}

.techinovex-tab-button {
    flex: 1;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--core-muted);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.techinovex-tab-button:hover,
.techinovex-tab-button.active {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
}

.techinovex-tab-content {
    display: none;
    padding: 24px;
}

.techinovex-tab-content.active {
    display: block;
}

/* Two-column layout for all tools */
.techinovex-tool-two-column {
    width: 100%;
}

.techinovex-tool-two-column__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .techinovex-tool-two-column__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.techinovex-tool-two-column__left,
.techinovex-tool-two-column__right {
    background: rgba(14, 23, 38, 0.85);
    border: 1px solid rgba(45, 61, 92, 0.55);
    border-radius: calc(var(--core-radius) - 4px);
    padding: 24px;
}

/* Section headers with icons */
.techinovex-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.techinovex-section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.techinovex-section-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

/* Result wrapper and placeholder */
.techinovex-result-wrapper {
    min-height: 200px;
}

.techinovex-result-placeholder {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.techinovex-result-placeholder-text {
    margin: 0;
    padding: 20px;
    background: rgba(11, 17, 28, 0.6);
    border: 2px dashed rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    text-align: center;
    color: var(--core-muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* Result metrics grid */
.techinovex-result-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.techinovex-metric-card {
    background: rgba(11, 17, 28, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.techinovex-metric-card:hover {
    background: rgba(11, 17, 28, 0.85);
    border-color: rgba(37, 99, 235, 0.4);
}

.techinovex-metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--core-primary);
    line-height: 1.2;
    margin-bottom: 8px;
}

.techinovex-metric-label {
    display: block;
    font-size: 0.85rem;
    color: var(--core-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide placeholder when results are shown */
.techinovex-result-container:not(:empty) ~ .techinovex-result-placeholder,
.techinovex-result-container:not(:empty) + .techinovex-result-placeholder {
    display: none;
}

.techinovex-result-wrapper:has(.techinovex-result-container:not(:empty)) .techinovex-result-placeholder {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .coreoptimize-tool {
        padding: 24px;
    }

    .coreoptimize-tool__column {
        padding: 20px;
    }

    .techinovex-tool-two-column__left,
    .techinovex-tool-two-column__right {
        padding: 20px;
    }

    .techinovex-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .techinovex-submit-btn {
        width: 100%;
    }

    .techinovex-result-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .coreoptimize-tool {
        padding: 18px;
    }

    .coreoptimize-tool__column {
        padding: 18px;
    }

    .techinovex-tool-two-column__left,
    .techinovex-tool-two-column__right {
        padding: 18px;
    }

    .placeholder-score__value {
        font-size: 2rem;
    }

    .techinovex-metric-value {
        font-size: 1.75rem;
    }
}
