/* Override page background to show space theme */
body, html {
    background: var(--mv-bg) !important;}

/* Make footer opaque and above space-bg */
html body footer.site-footer,
html body.has-fixed-footer footer.site-footer {
    position: relative !important;
    z-index: 2 !important; background: var(--mv-bg);}

/* === Deep Space Background === */
.space-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, var(--mv-bg) 0%, var(--mv-bg) 30%, var(--mv-bg) 60%, var(--mv-bg) 100%);
    overflow: hidden;}

.space-bg .star {
    position: absolute;
    border-radius: 50%;
    background: var(--mv-text);}

.space-bg .star--sm { width: 1px; height: 1px; opacity: 0.35; animation: twinkle 3s ease-in-out infinite;}
.space-bg .star--md { width: 1.5px; height: 1.5px; opacity: 0.55; animation: twinkle 4s ease-in-out infinite;}
.space-bg .star--lg { width: 2.5px; height: 2.5px; opacity: 0.8; animation: twinkle 5s ease-in-out infinite; box-shadow: 0 0 6px rgba(150, 220, 255, 0.7);}

@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.8);}
    50% { opacity: 1; transform: scale(1.3);}
}

/* Nebula glow — bright cyan/teal clouds */
.space-bg .nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: nebulaPulse 20s ease-in-out infinite;}

@keyframes nebulaPulse {
    0%, 100% { transform: scale(1); opacity: 0.8;}
    50% { transform: scale(1.15); opacity: 1;}
}

/* === All page content sits above the space bg === */
.page-wrapper {
    position: relative;
    z-index: 1;}

/* === Hero === */
.dev-hero {
    position: relative;
    padding: 60px 0 20px;
    margin-bottom: 20px;
    text-align: center;}

.dev-hero-title {
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--mv-accent);}

.dev-hero-sub {
    font-size: 1.05rem; color: var(--mv-accent);
    margin-bottom: 0;}

/* === Search === */
.dev-search {
    position: relative;
    max-width: 600px;
    margin: 40px auto 50px;}

.dev-search-box {
    position: relative;
    background: rgba(12, 20, 38, 0.7);
    border: 1.5px solid rgba(110, 193, 255, 0.2);
    border-radius: 30px;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;}

.dev-search-box:focus-within {
    border-color: rgba(110, 193, 255, 0.5);
    box-shadow: var(--mv-glow);}

.dev-search-box i { font-size: 1.1rem; color: var(--mv-accent);}

.dev-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;}

/* Fara "patrat" interior la focus: inelul global :focus-visible (base.css) e mutat
   pe pilula intreaga prin .dev-search-box:focus-within; input-ul ramane curat. */
.dev-search-input:focus,
.dev-search-input:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;}

.dev-search-input::-webkit-search-cancel-button,
.dev-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;}

.dev-search-input::placeholder { color: var(--mv-accent);}

.dev-clear-btn {
    padding: 6px 14px;
    background: rgba(110, 193, 255, 0.12);
    border: 1px solid rgba(110, 193, 255, 0.3);
    border-radius: 15px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;}

.dev-clear-btn:hover { background: rgba(110, 193, 255, 0.2);}

/* === Grid Container (the outer glass panel) === */
.grid-panel {
    background: rgba(10, 18, 35, 0.5);
    border: 1px solid rgba(110, 193, 255, 0.1);
    border-radius: 28px;
    padding: 36px 28px;}

/* === Grid — 2 columns === */
.dev-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;}

@media (max-width: 1100px) {
    .dev-grid { grid-template-columns: 1fr; gap: 20px;}
}

/* === Coach Card === */
.coach-card {
    position: relative;
    display: flex;
    flex-direction: column; background: rgba(8, 14, 30, 0.95);
    border: 1px solid rgba(110, 193, 255, 0.18);
    border-radius: 22px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.23,1,0.32,1), box-shadow 0.35s ease, border-color 0.35s ease;
    min-height: 260px;}

.cc-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;}

/* Main body */
.coach-card-main {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 24px;
    padding: 22px 24px 0;
    flex: 1;
    align-items: flex-end;}

/* Photo frame */
.coach-card-photo-wrap {
    position: relative;
    flex-shrink: 0;
    width: 180px;
    height: 220px;}

.coach-card-photo-frame {
    width: 100%;
    height: 100%;
    border-radius: 16px 16px 0 0;
    border: none;
    overflow: hidden;
    position: relative;}

.coach-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s cubic-bezier(0.23,1,0.32,1), filter 0.4s ease;
    filter: brightness(0.95) saturate(0.9);}

.coach-card:hover .coach-card-photo {
    filter: brightness(1) saturate(1);}

/* Video count badge */
.coach-card-vcount {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(6, 12, 28, 0.88);
    border: 1px solid rgba(110, 193, 255, 0.3);
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700; color: var(--mv-accent);
    z-index: 4;
    white-space: nowrap;}

/* Specializations */
.coach-card-specs {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 4px;
    padding-bottom: 14px;
    min-width: 0;
    align-self: flex-start;}

.coach-card-specs-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;}

.coach-card-spec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;}

.coach-card-spec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(110, 193, 255, 0.06);
    border: 1px solid rgba(110, 193, 255, 0.2);
    border-radius: 14px;
    transition: all 0.3s ease;}

.coach-card:hover .coach-card-spec-item {
    border-color: rgba(110, 193, 255, 0.35);
    background: rgba(110, 193, 255, 0.1);}

.coach-card-spec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0; color: var(--mv-text-inverse);}

.coach-card-spec-item span:last-child {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;}

/* Footer */
.coach-card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-top: 1px solid rgba(110, 193, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);}

.coach-card-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    flex-shrink: 1;
    min-width: 0;}

.coach-card-cert {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);}

.coach-card-cert-check {
    width: 20px;
    height: 20px;
    border-radius: 50%; background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--mv-text-inverse);
    font-weight: 900;}

.coach-card-book {
    margin-left: auto;
    flex-shrink: 0;
    padding: 10px 24px; background: var(--mv-accent);
    color: var(--mv-text-inverse);
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23,1,0.32,1);
    position: relative;
    overflow: hidden;}

.coach-card-book::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--mv-elev-4);
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;}

.coach-card-book:hover::before {
    width: 160px;
    height: 160px;}

.coach-card-book:hover {}

/* Loading */
.dev-loading {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;}

.dev-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(110, 193, 255, 0.15);
    border-top: 3px solid var(--mv-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;}

@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

/* === Responsive === */
@media (max-width: 768px) {
    .dev-hero-title { font-size: 2rem;}
    .dev-hero-sub { font-size: 0.95rem;}
    .dev-hero { padding: 35px 0 15px; margin-bottom: 15px;}
    .dev-search { margin: 25px auto 35px;}
    .dev-search-box {
        background: rgba(12, 20, 38, 0.9) !important;}
    .grid-panel { padding: 20px 14px; border-radius: 20px;}
    .coach-card-main { gap: 14px; padding: 16px 14px 12px;}
    .coach-card-photo-wrap { width: 130px; height: 160px;}
    .coach-card-specs-title { font-size: 1.15rem; margin-bottom: 12px;}
    .coach-card-spec-item { font-size: 0.88rem; gap: 10px;}
    .coach-card-spec-dot { width: 7px; height: 7px;}
    .coach-card-footer { padding: 10px 14px; gap: 8px; flex-wrap: wrap;}
    .coach-card-name { font-size: 0.9rem;}
    .coach-card-book { padding: 6px 16px; font-size: 0.9rem;}
}

@media (max-width: 600px) {
    .dev-grid { gap: 16px; grid-template-columns: 1fr !important;}
    .coach-card-main { flex-direction: column; gap: 12px; padding: 14px 14px 10px;}
    .coach-card-photo-wrap { width: 100%; height: 200px;}
    .coach-card-specs-title { font-size: 1.05rem;}
    .coach-card-spec-item { padding: 7px 10px;}
    .coach-card-spec-text { font-size: 0.82rem;}
    .coach-card-footer { flex-direction: column; gap: 10px; padding: 14px;}
    .coach-card-name { font-size: 1rem; text-align: center;}
    .coach-card-cert { align-self: center;}
    .coach-card-price { font-size: 1.1rem; text-align: center; margin-left: 0;}
    .coach-card-book { width: 100%; text-align: center; padding: 12px; font-size: 0.9rem;}
    .container { padding: 0 12px;}
    .dev-hero-title { font-size: 1.5rem;}
    .dev-hero-sub { font-size: 0.85rem; padding: 0 10px;}
}

@media (prefers-reduced-motion: reduce) {
    .space-bg .star, .space-bg .nebula { animation: none !important; opacity: 0.5 !important;}
}
