/**
 * SLMA Theme — agency-profile.css
 * Agency profile page — Figma-matched
 */

/* ============================================================
   PROFILE HEADER
   ============================================================ */

.profile-header {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ecff 100%);
    padding: 56px 0 48px;
    border-bottom: 1px solid var(--border);
}

.profile-header-inner {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: flex-start;
}

/* Logo */
.profile-logo-wrap {
    width: 220px;
    height: 110px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.profile-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    color: var(--white);
    font-weight: 800;
    font-size: 40px;
    letter-spacing: -1px;
}

/* Header info */
.profile-header-info {
    display: flex;
    flex-direction: column;
}

.profile-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.profile-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.profile-meta-row h1 {
    margin: 0;
    font-size: 32px;
}

.badge-verified-inline {
    display: inline-flex;
    align-items: center;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.profile-founded {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 4px 0 10px 0;
}

.profile-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}

.rating-number {
    font-weight: 600;
    color: var(--text-primary);
}

.write-review-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
}

.profile-service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.profile-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.profile-location,
.profile-website {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 6px 0;
}

.profile-website a {
    color: var(--accent);
}

.profile-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ============================================================
   PROFILE TABS BAR
   ============================================================ */

.profile-tabs-bar {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 80px;
    z-index: 100;
}

.profile-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
}

.profile-tabs::-webkit-scrollbar {
    display: none;
}

.profile-tab {
    display: inline-block;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
}

.profile-tab:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.profile-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   PROFILE BODY LAYOUT
   ============================================================ */

.profile-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    padding: 40px 0 80px;
    align-items: start;
}

/* ============================================================
   PROFILE MAIN — SECTIONS
   ============================================================ */

.profile-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.profile-about-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================
   CARE TYPES GRID
   ============================================================ */

.care-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.care-type-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
    background: var(--page-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    gap: 8px;
    transition: border-color 0.2s ease;
}

.care-type-tile:hover {
    border-color: var(--accent);
}

.care-type-icon {
    font-size: 28px;
    line-height: 1;
}

.care-type-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
   KEY STATS GRID
   ============================================================ */

.key-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-box {
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================================
   SERVICES LIST
   ============================================================ */

.services-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.service-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.service-item:first-child {
    padding-top: 0;
}

.service-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-item h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
}

.service-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   REVIEWS SECTION
   ============================================================ */

.reviews-summary {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 20px;
}

.reviews-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.score-big {
    font-size: 52px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-based {
    font-size: 13px;
    color: var(--text-muted);
}

.reviews-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    width: 32px;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--amber);
    border-radius: 4px;
}

.no-reviews-note {
    font-size: 14px;
    color: var(--text-muted);
    margin: 12px 0 0 0;
    font-style: italic;
}

/* ============================================================
   PROFILE SIDEBAR
   ============================================================ */

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 140px;
}

.sidebar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}

.sidebar-card h3 {
    font-size: 16px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Contact form */
.contact-form .form-field {
    margin-bottom: 14px;
}

.contact-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.contact-form input,
.contact-form textarea {
    font-size: 14px;
}

.form-or {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 12px 0;
    position: relative;
}

.form-or::before,
.form-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 16px);
    height: 1px;
    background: var(--border);
}

.form-or::before { left: 0; }
.form-or::after { right: 0; }

/* Quick facts */
.quick-facts {
    display: flex;
    flex-direction: column;
}

.fact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.fact-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fact-key {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.fact-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Verified card */
.sidebar-verified {
    background: var(--green-light);
    border-color: #6ee7b7;
    text-align: center;
}

.sidebar-verified h3 {
    border-bottom-color: #6ee7b7;
}

.sidebar-verified-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.sidebar-verified p {
    font-size: 13px;
    color: #065f46;
    margin: 0;
}

/* Similar agencies */
.similar-list {
    display: flex;
    flex-direction: column;
}

.similar-agency-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.similar-agency-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.similar-agency-row:hover {
    background: var(--page-bg);
    padding-left: 8px;
    padding-right: 8px;
    margin: 0 -8px;
    border-radius: 6px;
}

.similar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.similar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.similar-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-rating {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */

@media (max-width: 1024px) {
    .key-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   RESPONSIVE — TABLET 900px
   ============================================================ */

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
        padding: 32px 0 60px;
    }
    .profile-sidebar {
        position: static;
    }
}

/* ============================================================
   RESPONSIVE — TABLET 768px
   ============================================================ */

@media (max-width: 768px) {
    .profile-header { padding: 40px 0 32px; }
    .profile-header-inner { grid-template-columns: 90px 1fr; gap: 20px; }
    .profile-logo-wrap { width: 160px; height: 80px; }
    .profile-logo-placeholder { font-size: 26px; }
    .profile-meta-row h1 { font-size: 26px; }
    .profile-header-top { flex-direction: column; }
    .profile-header-actions { flex-direction: row; }
    .care-types-grid { grid-template-columns: repeat(2, 1fr); }
    .key-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .reviews-summary { grid-template-columns: 1fr; }
    .profile-tabs-bar { top: 70px; }
    .profile-section { padding: 20px; }
}

/* ============================================================
   RESPONSIVE — MOBILE 480px
   ============================================================ */

@media (max-width: 480px) {
    .profile-header-inner { grid-template-columns: 72px 1fr; gap: 14px; }
    .profile-logo-wrap { width: 140px; height: 70px; }
    .profile-logo-placeholder { font-size: 20px; }
    .profile-meta-row h1 { font-size: 22px; }
    .care-types-grid { grid-template-columns: repeat(2, 1fr); }
    .key-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-header-actions { flex-direction: column; }
    .profile-header-actions .btn { width: 100%; }
    .profile-section { padding: 16px; }
    .profile-tabs-bar { top: 56px; }
    .stat-number { font-size: 24px; }
}


/* ================================================================
   REVIEW CARDS
   ================================================================ */
.reviews-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.review-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
}
.review-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.reviewer-meta {
    flex: 1;
}
.reviewer-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    display: block;
}
.review-date {
    font-size: 13px;
    color: var(--text-muted);
}
.review-stars-sm {
    color: var(--amber);
    font-size: 14px;
    white-space: nowrap;
}
.review-body {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ================================================================
   REVIEW FORM
   ================================================================ */
.write-review-section {
    margin-top: 8px;
}
.review-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}
.review-form .form-group {
    margin-bottom: 20px;
}
.review-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.review-form input[type="text"],
.review-form input[type="email"],
.review-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.review-form input[type="text"]:focus,
.review-form input[type="email"]:focus,
.review-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.review-form textarea {
    min-height: 100px;
    resize: vertical;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.star-picker {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}
.star-picker input[type="radio"] {
    display: none;
}
.star-picker label {
    font-size: 30px;
    color: #d1d5db;
    cursor: pointer;
    line-height: 1;
    transition: color 0.1s;
    margin: 0;
    padding: 0;
}
.star-picker input[type="radio"]:checked ~ label,
.star-picker label:hover,
.star-picker label:hover ~ label {
    color: var(--amber);
}
.review-submit-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.review-submit-btn:hover {
    opacity: 0.9;
}
.review-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.review-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    display: none;
}
.review-form-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}
.review-form-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}