/* Roster Scraper Pro — Team Colors Design v3.1 */

/* ═══════════════════════════════════════
   RESET & BASE — scoped to plugin only
   ═══════════════════════════════════════ */
.roster-college-grid-container *,
.roster-page-container *,
.roster-modal *,
.log-modal * {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════ */
.roster-college-grid-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    background: transparent;
}

/* ═══════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════ */
.roster-search-container {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    background: #fff;
    border-bottom: none;
}

.roster-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    font-family: inherit;
}

.roster-search-input:focus {
    border-color: #6b7280;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.08);
}

.roster-search-input::placeholder {
    color: #9ca3af;
}

/* ═══════════════════════════════════════
   CONFERENCE SECTIONS
   ═══════════════════════════════════════ */
.conference-section {
    margin-bottom: 40px;
}

.conference-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid #1f2937;
}

.conference-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 !important;
    padding: 0 !important;
}

.conference-count {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

/* ═══════════════════════════════════════
   COLLEGE GRID
   ═══════════════════════════════════════ */
.roster-college-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 0;
    background: transparent;
}

/* ═══════════════════════════════════════
   COLLEGE CARDS — Team Color Backgrounds
   Uses var(--primary-color) set via inline style
   ═══════════════════════════════════════ */
.college-card.college-card {
    background: var(--primary-color, #374151) !important;
    background-color: var(--primary-color, #374151) !important;
    border-radius: 12px;
    padding: 22px 14px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    min-height: 0;
    aspect-ratio: auto !important;
    color: #ffffff !important;
}

.college-card.college-card::before {
    display: none;
}

.college-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ═══════════════════════════════════════
   LOGO
   ═══════════════════════════════════════ */
.college-logo-container {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.college-logo {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50%;
    object-fit: contain;
    padding: 8px;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════
   COLLEGE NAME & INFO
   ═══════════════════════════════════════ */
.college-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: space-between;
}

.college-name {
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 4px;
    min-height: 36px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* ═══════════════════════════════════════
   ACTION BUTTONS — on colored background
   ═══════════════════════════════════════ */
.college-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.roster-btn,
.log-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.3;
    touch-action: manipulation;
    white-space: nowrap;
    min-height: 34px;
}

.roster-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a1a !important;
}

.roster-btn:hover {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.log-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
}

.log-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

/* ═══════════════════════════════════════
   MODALS
   ═══════════════════════════════════════ */
.roster-modal,
.log-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.roster-modal-content,
.log-modal-content {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
}

.roster-modal-header,
.log-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roster-modal-header h2,
.log-modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.roster-modal-close,
.log-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
}

.roster-modal-close:hover,
.log-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.roster-modal-body,
.log-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 60px);
}

.log-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.log-modal-content {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════
   LOADING & ERROR
   ═══════════════════════════════════════ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: #9ca3af;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #374151;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 16px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

.roster-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.roster-no-data h3 {
    margin-bottom: 8px;
    color: #374151;
}

/* ═══════════════════════════════════════
   ROSTER TABLE (modal)
   ═══════════════════════════════════════ */
.roster-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.roster-table th,
.roster-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.roster-table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ═══════════════════════════════════════
   ROSTER DETAIL PAGE
   ═══════════════════════════════════════ */
.roster-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.roster-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.roster-back-link:hover {
    color: #1f2937;
    text-decoration: none;
}

.roster-page-header {
    border-radius: 12px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    color: #fff;
}

.roster-page-logo {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
    flex-shrink: 0;
}

.roster-page-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.roster-page-info h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.roster-page-meta {
    font-size: 13px;
    opacity: 0.9;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.roster-page-meta span {
    color: #fff;
}

.roster-jump-nav {
    background: #f9fafb;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border: 1px solid #e5e7eb;
}

.roster-jump-nav strong {
    font-size: 13px;
    color: #6b7280;
    margin-right: 6px;
}

.roster-jump-nav a {
    color: #374151;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 16px;
    background: #e5e7eb;
    transition: all 0.15s;
}

.roster-jump-nav a:hover {
    background: #d1d5db;
    color: #1f2937;
}

.roster-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1f2937;
    color: #1f2937;
}

.roster-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 28px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.roster-full-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.roster-full-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    border-bottom: none;
}

.roster-full-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.roster-full-table tbody tr:hover {
    background: #f9fafb;
}

.roster-full-table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Desktop wide (5 cols)
   ═══════════════════════════════════════ */
@media (min-width: 1200px) {
    .roster-college-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Tablet (3 cols)
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .roster-college-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .roster-college-grid-container {
        padding: 0 16px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile (2 cols)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .roster-college-grid-container {
        padding: 0 12px;
    }

    .roster-search-container {
        padding: 12px 0;
    }

    .roster-search-input {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 8px;
    }

    .conference-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .conference-title {
        font-size: 17px;
    }

    .conference-section {
        margin-bottom: 32px;
    }

    .roster-college-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .college-card.college-card {
        padding: 16px 10px 12px;
        border-radius: 10px;
        gap: 10px;
    }

    .college-logo {
        width: 52px;
        height: 52px;
        padding: 6px;
    }

    .college-name {
        font-size: 11.5px;
        min-height: 30px;
    }

    .college-actions {
        gap: 5px;
    }

    .roster-btn,
    .log-btn {
        font-size: 9px;
        padding: 7px 4px;
        min-height: 32px;
        border-radius: 5px;
        letter-spacing: 0.3px;
    }

    /* Modals — slide-up sheet on mobile */
    .roster-modal,
    .log-modal {
        padding: 0;
        align-items: flex-end;
    }

    .roster-modal-content,
    .log-modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }

    .roster-modal-close,
    .log-modal-close {
        width: 38px;
        height: 38px;
    }

    /* Roster page mobile */
    .roster-page-container {
        padding: 0 12px 28px;
    }

    .roster-page-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 12px;
        border-radius: 10px;
    }

    .roster-page-logo {
        width: 56px;
        height: 56px;
    }

    .roster-page-info h1 {
        font-size: 18px;
    }

    .roster-page-meta {
        justify-content: center;
        font-size: 12px;
    }

    .roster-jump-nav {
        justify-content: center;
        padding: 8px 12px;
    }

    .roster-jump-nav strong {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
        margin-right: 0;
    }

    .roster-section-title {
        font-size: 16px;
        margin: 24px 0 12px;
    }

    .roster-full-table {
        font-size: 13px;
        min-width: 600px;
    }

    .roster-full-table th,
    .roster-full-table td {
        padding: 8px 10px;
    }

    .roster-back-link {
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Small phones
   ═══════════════════════════════════════ */
@media (max-width: 420px) {
    .roster-college-grid-container {
        padding: 0 8px;
    }

    .roster-college-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .college-card.college-card {
        padding: 14px 8px 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .college-logo {
        width: 44px;
        height: 44px;
        padding: 5px;
    }

    .college-name {
        font-size: 10.5px;
        min-height: 26px;
        padding: 0;
    }

    .roster-btn,
    .log-btn {
        font-size: 8.5px;
        padding: 6px 3px;
        min-height: 30px;
    }

    .conference-title {
        font-size: 15px;
    }

    .conference-count {
        font-size: 11px;
    }

    .roster-modal-body,
    .log-modal-body {
        padding: 14px;
    }

    .roster-page-info h1 {
        font-size: 16px;
    }

    .roster-full-table {
        font-size: 12px;
        min-width: 540px;
    }
}

/* ═══════════════════════════════════════
   WP ADMIN BAR FIX
   ═══════════════════════════════════════ */
@media screen and (min-width: 783px) {
    .roster-modal,
    .log-modal {
        padding-top: 32px;
    }
}

@media screen and (max-width: 782px) {
    .roster-modal,
    .log-modal {
        padding-top: 46px;
    }
}

/* ═══════════════════════════════════════
   LANDSCAPE MOBILE
   ═══════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {
    .roster-modal,
    .log-modal {
        align-items: center;
    }

    .roster-modal-content,
    .log-modal-content {
        max-height: 88vh;
        border-radius: 12px;
    }
}
