/* ============================================
   Boiler Fault Codes - Page-Specific Styles
   ============================================ */

/* Page header */
.codes-hero {
    padding: 120px 2rem 3rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.codes-hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: var(--gradient-text);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-shift 4s ease infinite;
    margin-bottom: 1rem;
}

.codes-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* Search bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 1.1rem 1.5rem 1.1rem 3.2rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white;
    font-size: 1.05rem;
    font-family: inherit;
    box-shadow: var(--glass-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3), 0 0 8px rgba(244, 114, 182, 0.2);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* Brand filter chips */
.brand-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    max-width: 900px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
}

.brand-chip {
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.brand-chip:hover {
    border-color: rgba(124, 58, 237, 0.5);
    color: var(--text-primary);
}

.brand-chip.active {
    background: var(--gradient-accent);
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    border-color: transparent;
    color: white;
    font-weight: 600;
}

/* Results section */
.codes-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-count span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Fault code cards grid */
.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Individual fault code card */
.code-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
    height: auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.code-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(124, 58, 237, 0.1);
}

/* Gradient top accent */
.code-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

/* Card header: brand + code */
.code-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Montserrat', monospace;
    letter-spacing: 1px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #a78bfa;
}

.brand-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Description */
.code-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.code-card-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* What to check section */
.code-card-checks {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.code-card-checks h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.code-card-checks ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.code-card-checks li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.code-card-checks li::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    font-size: 0.7rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Severity indicator */
.severity {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-low {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #66bb6a;
}

.severity-medium {
    background: rgba(255, 183, 77, 0.15);
    border: 1px solid rgba(255, 183, 77, 0.3);
    color: #ffb74d;
}

.severity-high {
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

/* Card footer with CTA */
.code-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.code-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #a78bfa;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.code-card-cta:hover {
    color: #f472b6;
}

/* CTA Buttons on Cards */
.card-cta-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.card-cta-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--glass-border);
}

.card-cta-btn.btn-call {
    background: linear-gradient(135deg, #ef5350, #e91e63);
    color: white;
    border-color: transparent;
    animation: pulse-glow 2s ease-in-out infinite;
}

.card-cta-btn.btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 83, 80, 0.4);
}

.card-cta-btn.btn-callback {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border-color: rgba(124, 58, 237, 0.3);
}

.card-cta-btn.btn-callback:hover {
    background: rgba(124, 58, 237, 0.25);
    color: #c4b5fd;
    transform: translateY(-2px);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(239, 83, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 83, 80, 0.6), 0 0 30px rgba(239, 83, 80, 0.3);
    }
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-results span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Back to home link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--text-primary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .codes-hero {
        padding: 100px 1rem 2rem;
    }

    .codes-hero h1 {
        font-size: 2rem;
    }

    .codes-hero p {
        font-size: 1rem;
    }

    .search-bar {
        font-size: 1rem;
        padding: 1rem 1.2rem 1rem 2.8rem;
    }

    .brand-filters {
        gap: 0.5rem;
    }

    .brand-chip {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

    .codes-grid {
        grid-template-columns: 1fr;
    }

    .codes-results {
        padding: 1rem;
    }

    .code-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .code-card-footer {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
}

@media (max-width: 400px) {
    .brand-chip {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   Callback Modal
   ============================================ */
.callback-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.callback-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.callback-modal-content {
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.callback-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.callback-close:hover {
    color: var(--text-primary);
}

.callback-modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callback-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.callback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group label i {
    font-size: 0.8rem;
    color: #a78bfa;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bfa' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group select option {
    background: #1a1a2e;
    color: white;
}

.callback-submit-btn {
    padding: 1rem 2rem;
    background: var(--gradient-accent);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: gradient-shift 4s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.callback-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.4);
}

.callback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.callback-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

.callback-note i {
    color: #66bb6a;
}

.form-messages {
    margin-bottom: 1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .callback-modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .callback-modal-content h2 {
        font-size: 1.5rem;
    }
    
    .card-cta-buttons {
        flex-direction: column;
    }
    
    .card-cta-btn {
        width: 100%;
    }
}
