/* SD Tech Scene Groups - Frontend Styles v0.3.0 */

.sdtech-groups-wrapper {
    --sdtech-primary: #2563eb;
    --sdtech-primary-hover: #1d4ed8;
    --sdtech-text: #1f2937;
    --sdtech-muted: #6b7280;
    --sdtech-light: #9ca3af;
    --sdtech-border: #e5e7eb;
    --sdtech-bg: #f9fafb;
    --sdtech-bg-hover: #f3f4f6;

    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: var(--sdtech-text);
    line-height: 1.6;
}

/* ── Group Count ── */

.sdtech-groups-count {
    font-size: 0.9375rem;
    color: var(--sdtech-muted);
    margin-bottom: 4px;
    text-align: center;
}

.sdtech-groups-count strong {
    color: var(--sdtech-text);
    font-weight: 700;
}

.sdtech-groups-last-updated {
    font-size: 0.8125rem;
    color: var(--sdtech-light);
    text-align: center;
    margin: 0 0 12px;
    font-style: italic;
}

/* ── Search Bar ── */

.sdtech-search-bar {
    position: sticky;
    top: 0;
    z-index: 110;
    background: linear-gradient(to bottom, rgba(255,255,255,0.98) 60%, rgba(255,255,255,0.92));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 0 12px;
}

.sdtech-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.sdtech-search-icon {
    position: absolute;
    left: 18px;
    color: var(--sdtech-primary);
    pointer-events: none;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sdtech-search-input-wrap:focus-within .sdtech-search-icon {
    opacity: 1;
}

.sdtech-search-input {
    width: 100%;
    padding: 14px 48px 14px 50px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--sdtech-text);
    border: 1.5px solid var(--sdtech-border);
    border-radius: 50px;
    background: #fff;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
}

.sdtech-search-input::placeholder {
    color: var(--sdtech-light);
    font-weight: 400;
}

.sdtech-search-input:focus {
    border-color: var(--sdtech-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), 0 2px 8px rgba(0,0,0,0.06);
}

.sdtech-search-clear {
    display: none;
    position: absolute;
    right: 14px;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--sdtech-bg);
    color: var(--sdtech-muted);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    padding: 0;
    font-family: inherit;
}

.sdtech-search-clear:hover {
    background: var(--sdtech-border);
    color: var(--sdtech-text);
    transform: scale(1.1);
}

.sdtech-search-results-count {
    display: none;
    font-size: 0.8rem;
    color: var(--sdtech-muted);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

/* ── Category Navigation — Wrapping Block ── */

.sdtech-groups-nav {
    padding: 12px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--sdtech-border);
    line-height: 2;
}

.sdtech-groups-nav a {
    color: var(--sdtech-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 2px 0;
    transition: color 0.2s;
}

.sdtech-groups-nav a:hover,
.sdtech-groups-nav a:focus {
    color: var(--sdtech-primary-hover);
    text-decoration: underline;
}

.sdtech-nav-sep {
    color: var(--sdtech-light);
    margin: 0 6px;
    user-select: none;
}

/* ── Category Sections ── */

.sdtech-category-section {
    margin-bottom: 32px;
    scroll-margin-top: 100px;
}

.sdtech-category-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sdtech-text);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--sdtech-primary);
    margin-bottom: 8px;
    scroll-margin-top: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sdtech-category-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sdtech-category-description {
    font-size: 0.875rem;
    color: var(--sdtech-muted);
    margin: 0 0 12px;
    line-height: 1.5;
    font-style: italic;
}

/* Category edit link — same hover pattern as group edit */
.sdtech-edit-cat {
    opacity: 0;
}

.sdtech-category-heading:hover .sdtech-edit-cat {
    opacity: 1;
}

.sdtech-top-link {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sdtech-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border: 1px solid var(--sdtech-border);
    border-radius: 4px;
    transition: all 0.2s;
}

.sdtech-top-link:hover {
    color: var(--sdtech-primary);
    border-color: var(--sdtech-primary);
}

/* ── Groups List — Compact Single-Line ── */

.sdtech-groups-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sdtech-group-item {
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    line-height: 1.7;
    transition: background 0.15s;
}

.sdtech-group-item:hover {
    background: var(--sdtech-bg);
}

/* The main single line */
.sdtech-group-line {
    display: flex;
    align-items: baseline;
    gap: 0;
    flex-wrap: wrap;
}

/* Expand arrow — inline after links, chevron down/up */
.sdtech-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 6px;
    border: none;
    background: none;
    color: var(--sdtech-light);
    cursor: pointer;
    transition: color 0.2s;
    vertical-align: middle;
}

.sdtech-expand-btn:hover {
    color: var(--sdtech-primary);
}

.sdtech-expand-arrow {
    transition: transform 0.2s ease;
}

.sdtech-group-item.sdtech-expanded .sdtech-expand-arrow {
    transform: rotate(180deg);
}

/* Admin edit link — only visible when logged in */
.sdtech-edit-link {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    color: var(--sdtech-light);
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    vertical-align: middle;
    text-decoration: none;
}

.sdtech-group-item:hover .sdtech-edit-link {
    opacity: 1;
}

.sdtech-edit-link:hover {
    color: var(--sdtech-primary);
}

/* Group name */
.sdtech-group-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.sdtech-group-name a {
    color: var(--sdtech-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.sdtech-group-name a:hover {
    color: var(--sdtech-primary-hover);
    text-decoration: underline;
}

/* Virtual badge */
.sdtech-badge-virtual {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6d28d9;
    background: #ede9fe;
    padding: 0 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Inline text links after the title */
.sdtech-inline-links {
    margin-left: 6px;
    font-size: 0.8125rem;
}

.sdtech-inline-links a {
    color: var(--sdtech-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.sdtech-inline-links a:hover {
    color: var(--sdtech-primary-hover);
    text-decoration: underline;
}

.sdtech-link-sep {
    color: var(--sdtech-light);
    margin: 0 4px;
    user-select: none;
}

/* Inactive badge */
.sdtech-badge-inactive {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b45309;
    background: #fef3c7;
    padding: 0 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Expandable Details Panel ── */

.sdtech-group-details {
    padding: 6px 0 8px 24px;
    font-size: 0.85rem;
    color: var(--sdtech-muted);
    border-left: 2px solid var(--sdtech-border);
    margin-left: 8px;
    margin-top: 2px;
}

/* Details panel hidden by default via inline style="display:none",
   toggled to display:block by JS on click. */

.sdtech-group-details p {
    margin: 2px 0;
    line-height: 1.5;
}

.sdtech-group-description {
    color: var(--sdtech-text);
    margin-bottom: 4px !important;
}

.sdtech-group-schedule,
.sdtech-group-location-detail {
    font-size: 0.8125rem;
    color: var(--sdtech-muted);
}

/* ── Inactive Group ── */

.sdtech-group-inactive {
    opacity: 0.5;
}

/* ── Section/item hidden by search ── */

.sdtech-category-section.sdtech-section-hidden {
    display: none;
}

.sdtech-group-item.sdtech-card-hidden {
    display: none;
}

/* ── Responsive ── */

@media (max-width: 640px) {
    .sdtech-groups-wrapper {
        padding: 0 12px;
    }

    .sdtech-search-bar {
        padding: 12px 0 8px;
    }

    .sdtech-search-input-wrap {
        max-width: 100%;
    }

    .sdtech-search-input {
        padding: 12px 44px 12px 46px;
        font-size: 0.875rem;
    }

    .sdtech-groups-nav {
        padding: 8px 0;
        line-height: 1.9;
    }

    .sdtech-groups-nav a {
        font-size: 0.8125rem;
    }

    .sdtech-nav-sep {
        margin: 0 4px;
    }

    .sdtech-category-heading {
        font-size: 1.05rem;
    }

    .sdtech-category-section {
        scroll-margin-top: 80px;
    }

    .sdtech-category-heading {
        scroll-margin-top: 80px;
    }

    .sdtech-group-name {
        font-size: 0.875rem;
    }

    .sdtech-inline-links {
        font-size: 0.75rem;
    }

    .sdtech-group-details {
        padding-left: 16px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
