/**
 * AEO-Simulator Styles
 * HMF-IT
 */

/* Tool Content Section */
.tool-content-section {
    background-color: var(--bg-dark-secondary);
    padding: 2rem 0 6rem;
    min-height: 60vh;
    border-top: 1px solid var(--glass-border-dark);
}
[data-bs-theme="light"] .tool-content-section {
    background-color: var(--bg-light-secondary);
    border-top-color: var(--glass-border-light);
}

.tool-content-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

/* Search/Input Card */
.aeo-search-card {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}
[data-bs-theme="light"] .aeo-search-card {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.aeo-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.aeo-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .aeo-input-row {
        grid-template-columns: 1fr;
    }
}

.aeo-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aeo-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}
[data-bs-theme="light"] .aeo-label {
    color: var(--text-light);
}

.aeo-input {
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--glass-border-dark);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    font-family: var(--font-display);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
[data-bs-theme="light"] .aeo-input {
    background: var(--bg-light);
    border-color: var(--glass-border-light);
    color: var(--text-light);
}
.aeo-input:focus {
    outline: none;
    border-color: var(--hmf-green);
    box-shadow: 0 0 0 3px rgba(106, 122, 38, 0.2);
}
.aeo-input::placeholder {
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-input::placeholder {
    color: var(--text-light-muted);
}

.aeo-help {
    font-size: 0.8rem;
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-help {
    color: var(--text-light-muted);
}

.aeo-submit-row {
    display: flex;
    justify-content: center;
}

.aeo-submit-btn {
    padding: 1rem 2.5rem;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
}
.aeo-submit-btn:hover,
.aeo-submit-btn:focus {
    box-shadow: var(--glow-green);
    transform: translateY(-2px);
}
.aeo-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.aeo-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.aeo-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border-dark);
    border-top-color: var(--hmf-green);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: aeo-spin 1s linear infinite;
}

@keyframes aeo-spin {
    to { transform: rotate(360deg); }
}

.aeo-loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.aeo-loading-subtext {
    font-size: 0.9rem;
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-loading-subtext {
    color: var(--text-light-muted);
}

/* Error State */
.aeo-error {
    background: rgba(163, 38, 56, 0.1);
    border: 1px solid var(--hmf-red);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--hmf-red-light);
}
.aeo-error svg {
    flex-shrink: 0;
}

/* Result Cards */
.result-card {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
[data-bs-theme="light"] .result-card {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}
.result-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Score Card */
.aeo-score-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.aeo-score-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.aeo-score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.aeo-score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.aeo-score-bg {
    fill: none;
    stroke: var(--glass-border-dark);
    stroke-width: 8;
}
[data-bs-theme="light"] .aeo-score-bg {
    stroke: var(--glass-border-light);
}

.aeo-score-progress {
    fill: none;
    stroke: var(--hmf-green);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.aeo-score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.aeo-score-value span:first-child {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.aeo-score-max {
    font-size: 0.9rem;
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-score-max {
    color: var(--text-light-muted);
}

.aeo-score-info {
    flex: 1;
}

.aeo-score-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.aeo-score-label {
    font-size: 1rem;
    color: var(--hmf-green);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.aeo-score-label.excellent { color: #22c55e; }
.aeo-score-label.good { color: var(--hmf-green); }
.aeo-score-label.needs-work { color: #f59e0b; }
.aeo-score-label.poor { color: #ef4444; }
.aeo-score-label.critical { color: #dc2626; }

.aeo-score-url {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    margin: 0;
    word-break: break-all;
}
[data-bs-theme="light"] .aeo-score-url {
    color: var(--text-light-muted);
}

/* Subscores */
.aeo-subscores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.aeo-subscore {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border-dark);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
[data-bs-theme="light"] .aeo-subscore {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--glass-border-light);
}

.aeo-subscore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.aeo-subscore-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.aeo-subscore-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hmf-green);
}

.aeo-subscore-bar {
    height: 6px;
    background: var(--glass-border-dark);
    border-radius: 3px;
    overflow: hidden;
}
[data-bs-theme="light"] .aeo-subscore-bar {
    background: var(--glass-border-light);
}

.aeo-subscore-fill {
    height: 100%;
    background: var(--hmf-green);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.aeo-subscore-details {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-subscore-details {
    color: var(--text-light-muted);
}

.aeo-subscore-details li {
    margin-bottom: 0.25rem;
}

/* Answer Card */
.aeo-answer-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
}
[data-bs-theme="light"] .aeo-answer-content {
    background: rgba(0, 0, 0, 0.02);
}

.aeo-answer-quote {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--hmf-green);
    color: var(--text-dark);
}
[data-bs-theme="light"] .aeo-answer-quote {
    color: var(--text-light);
}

.aeo-answer-source {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
}
[data-bs-theme="light"] .aeo-answer-source {
    color: var(--text-light-muted);
}

.aeo-source-label {
    font-weight: 600;
}

/* Findings */
.aeo-findings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aeo-finding {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 3px solid;
}
[data-bs-theme="light"] .aeo-finding {
    background: rgba(0, 0, 0, 0.02);
}

.aeo-finding.high { border-left-color: #ef4444; }
.aeo-finding.medium { border-left-color: #f59e0b; }
.aeo-finding.low { border-left-color: #3b82f6; }
.aeo-finding.info { border-left-color: #6b7280; }

.aeo-finding-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}
.aeo-finding.high .aeo-finding-icon { background: #ef4444; }
.aeo-finding.medium .aeo-finding-icon { background: #f59e0b; }
.aeo-finding.low .aeo-finding-icon { background: #3b82f6; }
.aeo-finding.info .aeo-finding-icon { background: #6b7280; }

.aeo-finding-content {
    flex: 1;
}

.aeo-finding-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.aeo-finding-detail {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    margin: 0;
}
[data-bs-theme="light"] .aeo-finding-detail {
    color: var(--text-light-muted);
}

/* Fixes */
.aeo-fixes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aeo-fix {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
}
[data-bs-theme="light"] .aeo-fix {
    background: rgba(0, 0, 0, 0.02);
}

.aeo-fix-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.aeo-fix-header:hover {
    background: rgba(255, 255, 255, 0.05);
}
[data-bs-theme="light"] .aeo-fix-header:hover {
    background: rgba(0, 0, 0, 0.04);
}

.aeo-fix-priority {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    color: #fff;
}
.aeo-fix-priority.high { background: #ef4444; }
.aeo-fix-priority.medium { background: #f59e0b; }
.aeo-fix-priority.low { background: #3b82f6; }

.aeo-fix-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.aeo-fix-chevron {
    transition: transform var(--transition-fast);
}
.aeo-fix.open .aeo-fix-chevron {
    transform: rotate(180deg);
}

.aeo-fix-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
}
.aeo-fix.open .aeo-fix-body {
    display: block;
}

.aeo-fix-why,
.aeo-fix-how {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.aeo-fix-why strong,
.aeo-fix-how strong {
    color: var(--hmf-green);
}

/* Meta Details */
.aeo-meta-card {
    padding: 0;
    overflow: hidden;
}

.aeo-meta-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.aeo-meta-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}
[data-bs-theme="light"] .aeo-meta-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.aeo-meta-toggle span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.aeo-chevron {
    transition: transform var(--transition-fast);
}
.aeo-meta-toggle[aria-expanded="true"] .aeo-chevron {
    transform: rotate(180deg);
}

.aeo-meta-details {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--glass-border-dark);
}
[data-bs-theme="light"] .aeo-meta-details {
    border-top-color: var(--glass-border-light);
}

.aeo-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0 0;
}

.aeo-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aeo-meta-item dt {
    font-size: 0.8rem;
    color: var(--text-dark-muted);
    font-weight: 500;
}
[data-bs-theme="light"] .aeo-meta-item dt {
    color: var(--text-light-muted);
}

.aeo-meta-item dd {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

/* Tool Disclaimer */
.tool-disclaimer {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}
[data-bs-theme="light"] .tool-disclaimer {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}
.tool-disclaimer-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1rem;
}
.tool-disclaimer-title svg {
    color: var(--hmf-green-light);
}
.tool-disclaimer-text {
    font-size: 0.9rem;
    opacity: 0.7;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* No findings/fixes message */
.aeo-empty-message {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dark-muted);
    font-size: 0.9rem;
}
[data-bs-theme="light"] .aeo-empty-message {
    color: var(--text-light-muted);
}
