/**
 * SEO Front Component Stylesheet
 * Consolidated styles for com_seofront
 * Version: 5.1.3
 * Last Updated: January 27, 2026
 */

/* ===========================
   General Report Styles
   =========================== */

body.com_seofront.view-report h3 {
	text-align: center;
}

/* ===========================
   Summary Controls & Tabs
   =========================== */

.summary-controls {
}

.summary-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	border-bottom: 2px solid #e5e7eb;
}

.summary-tab-btn {
	padding: 10px 20px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 6px 6px 0 0;
	cursor: pointer;
	font-size: 15px;
	font-weight: 500;
	color: #6b7280;
	transition: all 0.3s ease;
	border-bottom: none;
}

.summary-tab-btn:hover {
	background: #e5e7eb;
	color: #374151;
}

.summary-tab-btn.active {
	background: #7a2255;
	color: white;
	border-color: #7a2255;
}

.summary-tab-btn i {
	margin-right: 8px;
}

.summary-tab-content {
	display: none;
}

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

/* Filter buttons with grey background */
#summary-filter-tab .button {
	background: #f3f4f6;
}

#summary-filter-tab .button.is-checked {
	background: #7a2255;
	color: white;
}

#summary-filter-tab .button:hover:not(.is-checked) {
	background: #e5e7eb;
}

/* ===========================
   Filter and Sort Buttons
   =========================== */

body .button-group {
    display: inline-flex;
    gap: 0 !important;
    flex-wrap: wrap;
    font-size: 0;
}

body .button-group .button {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background-color: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    margin-left: -1px;
}

body .button-group .button:first-child {
    border-radius: 6px 0 0 6px;
    margin-left: 0;
}

body .button-group .button:last-child {
    border-radius: 0 6px 6px 0;
}

body .button-group .button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
    z-index: 1;
    position: relative;
}

body .button-group .button.is-checked {
    background-color: #7a2255;
    color: #ffffff;
    border-color: #7a2255;
    z-index: 2;
    position: relative;
}

/* ===========================
   Performance Metrics Section
   =========================== */

.performance-metrics-section {
    margin-bottom: 32px;
}

.performance-metrics-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 24px;
}

.performance-metrics-header h3 {
    margin: 0;
}

.performance-metrics-section h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.metrics-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.metrics-toggle-wrapper {
    position: absolute;
    right: 0;
}

.metrics-toggle-wrapper .form-switch {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
}

.metrics-toggle-wrapper .form-check-input {
    width: 3.5em;
    height: 1.75em;
    cursor: pointer;
    margin-right: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%237a2255'/%3e%3c/svg%3e") !important;
}

.metrics-toggle-wrapper .form-check-input:checked {
    background-color: #7a2255 !important;
    border-color: #7a2255 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

.metrics-toggle-wrapper .form-check-input:focus {
    border-color: #7a2255 !important;
    box-shadow: 0 0 0 0.25rem rgba(122, 34, 85, 0.25) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%237a2255'/%3e%3c/svg%3e") !important;
}

.metrics-toggle-wrapper .form-check-input:focus:checked {
    background-color: #7a2255 !important;
    border-color: #7a2255 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

.metrics-toggle-wrapper .form-check-label {
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin: 0 0 0 10px;
    padding: 0 15px;
}

.performance-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.metric-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 20px;
    position: relative;
    transition: box-shadow 0.2s;
}

.metric-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.metric-title {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-info-icon {
    font-size: 12px;
    color: #9ca3af;
    cursor: help;
}

.metric-info-icon:hover {
    color: #6b7280;
}

.metric-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-excellent {
    background-color: #10b981;
    color: white;
}

.badge-very-good {
    background-color: #22c55e;
    color: white;
}

.badge-good {
    background-color: #84cc16;
    color: white;
}

.badge-average {
    background-color: #eab308;
    color: white;
}

.badge-needs-improvement {
    background-color: #f59e0b;
    color: white;
}

.badge-poor {
    background-color: #ef4444;
    color: white;
}

.badge-na {
    background-color: #9ca3af;
    color: white;
}

.metric-value {
    font-size: 48px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 16px;
}

.metric-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.metric-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 12px;
}

.metric-data-points {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.data-point {
    font-size: 12px;
    color: #4b5563;
    padding: 4px 8px;
    background-color: #f3f4f6;
    border-radius: 4px;
}

.data-point i {
    color: #7a2255;
}

.metric-learn-more {
    font-size: 13px;
    color: #7a2255;
    font-weight: 500;
    text-decoration: none;
}

.metric-learn-more:hover {
    color: #942968;
    text-decoration: underline;
}

/* ===========================
   Isotope Grid & Metric Boxes
   =========================== */

/* Isotope grid container */
body .metrics-container {
    margin-top: 24px;
}

/* Grid item wrapper */
body .grid-item {
    margin-bottom: 20px;
    padding: 0 10px;
}

/* Isotope transitions handled by Isotope.js */
/* DO NOT add CSS transitions to .grid-item - causes animation conflicts */

/* Box card */
.box {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: box-shadow 0.2s ease;
}

.box:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

/* Responsive adjustments for grid items */
@media (max-width: 767px) {
    .col-sm-6 {
        width: 100%;
    }

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

    .metric-value {
        font-size: 36px;
    }
}

/* ===========================
   Response Codes Section
   =========================== */

.response-codes-section {
    margin-bottom: 32px;
}

.response-codes-section h3 {
    text-align: center;
    margin-bottom: 24px;
}

.response-codes-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.response-codes-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.stat-value.success {
    color: #6eb878;
}

.stat-value.error {
    color: #ef4444;
}

.response-codes-chart {
    width: 280px;
    height: 180px;
    margin: 0 auto 24px;
}

.response-codes-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.response-codes-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.response-codes-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.response-codes-legend .legend-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.response-codes-legend .legend-count {
    font-size: 12px;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===========================
   Box Component Styling
   =========================== */

/* Box card */
body .box {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body .box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Box status colors (left border accent) */
body .box-success {
    border-left: 4px solid #10b981;
}

body .box-danger {
    border-left: 4px solid #ef4444;
}

body .box-warning {
    border-left: 4px solid #f59e0b;
}

body .box-info {
    border-left: 4px solid #3b82f6;
}

/* Category badge (top-right corner icon) */
body .category-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff !important;
    background-color: #4b5563;
    z-index: 100;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

body .category-badge i {
    color: #ffffff !important;
}

body .category-badge:hover {
    transform: scale(1.1);
    background-color: #374151;
}

/* Box header */
body .box-header {
    padding: 5px 5px 5px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    flex-wrap: wrap;
}

body .box-header.with-border {
    border-bottom: 1px solid #e5e7eb;
}

/* Status icon (left side of header) */
body .status-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
}

body .box-success .status-icon {
    background-color: #10b981;
    color: #ffffff !important;
}

body .box-danger .status-icon {
    background-color: #ef4444;
    color: #ffffff !important;
}

body .box-warning .status-icon {
    background-color: #f59e0b;
    color: #ffffff !important;
}

body .box-info .status-icon {
    background-color: #3b82f6;
    color: #ffffff !important;
}

/* Box title */
body .box-header .box-title {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    line-height: 1.2;
    width: 100%;
    text-align: left !important;
}

body .box-header .box-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
    text-align: left;
    display: block;
}

body .box-header .box-title a:hover {
    color: #7a2255;
}

/* Text center wrapper for score badge */
body .box-header .text-center {
    width: 100%;
    text-align: center;
    line-height: 1;
    margin: -15px 0 0 0;
    padding: 0;
}

/* Score badge (below heading) */
body .score-badge {
    font-size: 1.4em;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: #f3f4f6;
    color: #4b5563;
    white-space: nowrap;
    display: inline-block;
    margin: 0 auto;
}

/* Score badge color variations based on alert type */
body .score-badge-success {
    color: #059669;
    background-color: #d1fae5;
}

body .score-badge-info {
    color: #0284c7;
    background-color: #e0f2fe;
}

body .score-badge-warning {
    color: #d97706;
    background-color: #fef3c7;
}

body .score-badge-danger {
    color: #dc2626;
    background-color: #fee2e2;
}

/* Box tools (collapse button) - positioned at bottom of entire card */
body .box-tools {
    position: absolute !important;
    bottom: -10px !important;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

body .box-tools.pull-right {
    right: auto;
    left: 50%;
}

body .box-tools .btn {
    margin: 0;
}

body .btn-box-tool {
    background-color: #4b5563;
    border: none;
    padding: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 16px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .btn-box-tool i {
    color: #ffffff !important;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

/* Chevron points down when collapsed */
body .btn-box-tool.collapsed i,
body .btn-box-tool[aria-expanded="false"] i {
    transform: rotate(0deg);
}

/* Chevron points up when expanded */
body .btn-box-tool[aria-expanded="true"] i {
    transform: rotate(180deg);
}

body .btn-box-tool:hover {
    background-color: #374151;
    transform: scale(1.15);
}

/* Box body (collapsible content) - add padding at bottom for chevron */
body .box-body {
    padding: 20px;
    padding-bottom: 48px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

body .box-body strong {
    color: #1f2937;
    font-weight: 600;
}

/* Alert boxes within body */
body .box-body .alert {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

body .box-body .alert-success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

body .box-body .alert-danger {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

body .box-body .alert-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

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

/* Well (description box) */
body .box-body .well {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

body .box-body .well small {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

/* ===========================
   Accordion Behavior
   =========================== */

/* Chevron rotation for accordion toggles */
.accordion-chevron {
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Rotate chevron when accordion is expanded */
.accordion-toggle[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

/* Active accordion card z-index management */
.grid-item.accordion-active {
    z-index: 1000 !important;
    position: relative;
}

/* Close button styling */
.accordion-close {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
}

/* ===========================
   Mobile Responsive Overrides
   =========================== */

@media (max-width: 767px) {
    body .grid-item {
        padding: 0 5px;
        margin-bottom: 15px;
    }

    body .category-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
        top: 8px;
        right: 8px;
    }

    body .score-badge {
        font-size: 11px;
        padding: 3px 8px;
        margin-right: 30px;
    }

    body .box-header {
        padding: 12px 16px;
    }

    body .box-body {
        padding: 16px;
    }
}

/* ===========================
   Layout Fixes (v5.1.5)
   =========================== */

/* Restore spacing between Masthead and Report Metadata */
#showcase {
    padding-top: 50px;
}

/* Ensure Masthead contains the absolute positioned image and prevents scrollbars */
#t4-masthead {
    min-height: 480px; /* Ensure space for the composite image */
    position: relative;
    overflow: hidden; /* Prevent horizontal scrollbar from wide images */
}

/* Ensure no horizontal scrollbar globally from this view */
body.com_seofront.view-report {
    overflow-x: hidden;
}

/* Spacing for the Metadata Bar */
.report-meta-bar {
    margin-bottom: 30px;
}
