/* ============================================
   T-Mobile Parking Availability Dashboard
   Accordion Design with Progress Bars
   ============================================ */

/* TeleNeo Font Face Declarations */
@font-face {
    font-family: 'TeleNeo';
    src: url('../fonts/TeleNeoOffice-Regular_14301196.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TeleNeo';
    src: url('../fonts/TeleNeoOffice-Medium_576149658.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TeleNeo';
    src: url('../fonts/TeleNeoOffice-Bold_2914011576.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Custom Properties - T-Mobile Brand Colors + Status Colors */
:root {
    --tmobile-magenta: #E20074;
    --tmobile-magenta-dark: #C4006B;
    --tmobile-teal: #00A99D;
    --status-open-green: #008110;
    --status-limited-orange: #AD590B;
    --status-none-red: #D20D00;
    --bg-light-gray: #F5F5F5;
    --bg-white: #FFFFFF;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light-gray: #999999;
    --border-gray: #E0E0E0;
    --font-family: "TeleNeo", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* ============================================
   Base Styles & Typography
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-light-gray);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 14px;
}

/* ============================================
   Header Section
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--tmobile-magenta) 0%, var(--tmobile-magenta-dark) 100%);
    color: var(--bg-white);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tmobile-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background-color: var(--bg-white);
    border-radius: 10%;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0;
    line-height: 1.3;
}

/* Top Bar with Updated Time and Refresh */
.top-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.updated-time {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin: 0;
}

.refresh-btn-top {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--tmobile-magenta);
    color: var(--bg-white);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn-top:hover {
    background-color: var(--tmobile-magenta-dark);
}

.refresh-btn-top svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Main Container
   ============================================ */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ============================================
   Accordion Container
   ============================================ */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   Accordion Item
   ============================================ */
.accordion-item {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Accordion Header (Always Visible)
   ============================================ */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem;
    cursor: pointer;
    gap: 1.5rem;
    border: 1px solid var(--border-gray);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.status-badge {
    background-color: var(--status-open-green);
    color: var(--bg-white);
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-limited .status-badge {
    background-color: var(--status-limited-orange);
    color: var(--bg-white);
}

.status-full .status-badge {
    background-color: var(--status-none-red);
    color: var(--bg-white);
}

.building-info {
    flex: 1;
    min-width: 0;
}

.building-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.building-address {
    font-size: 0.875rem;
    color: var(--text-dark);
    margin: 0;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.building-address:hover {
    color: var(--tmobile-magenta);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.availability-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 140px;
    gap: 0.25rem;
}

.availability-summary .availability-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.available-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--status-open-green);
    line-height: 1;
}

.status-limited .available-number {
    color: var(--status-limited-orange);
}

.status-full .available-number {
    color: var(--text-dark);
}

.total-text {
    font-size: 1.125rem;
    color: var(--text-gray);
    font-weight: 400;
    line-height: 1;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-gray);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--status-open-green);
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.status-limited .progress-fill {
    background-color: var(--status-limited-orange);
}

.status-full .progress-fill {
    background-color: var(--status-none-red);
}

/* ============================================
   Accordion Toggle Button
   ============================================ */
.accordion-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: color 0.2s ease;
}

.accordion-toggle:hover {
    color: var(--text-dark);
}

.chevron {
    transition: transform 0.3s ease;
}

.accordion-item.active .chevron {
    transform: rotate(180deg);
}

/* ============================================
   Accordion Content (Expandable)
   ============================================ */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.content-inner {
    padding: 0;
    border-top: none;
    background-color: #F9F9F9;
}

/* ============================================
   Parking Types Row
   ============================================ */
.parking-types-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    background-color: transparent;
    margin-bottom: 0;
}

.parking-type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    background-color: var(--bg-white);
    padding: 1rem;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-gray);
    border-bottom: 1px solid var(--border-gray);
}

.parking-type-item:last-child {
    border-right: none;
}

.parking-type-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.type-icon-small {
    width: 32px;
    height: 32px;
    color: var(--tmobile-magenta);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #F0F0F0;
    border-radius: 50%;
    padding: 6px;
}

.type-icon-small svg {
    width: 20px;
    height: 20px;
}

.type-icon-small img {
    width: 20px;
    height: 20px;
    filter: invert(20%) sepia(97%) saturate(4682%) hue-rotate(313deg) brightness(96%) contrast(93%);
}

.type-label-small {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-value-small {
    font-size: 1.25rem;
    font-weight: 700;
    width: 100%;
}

.available-count {
    color: var(--status-open-green);
    font-weight: 700;
    font-size: 1.125rem;
}

.total-count {
    color: var(--text-gray);
    font-weight: 600;
    font-size: 1.125rem;
}

/* ============================================
   Directions Link
   ============================================ */
.directions-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background-color: var(--tmobile-magenta);
    border-radius: 6px;
    width: 40%;
    margin: 1rem auto;
    transition: all 0.2s ease;
}

.directions-link:hover {
    background-color: var(--tmobile-magenta-dark);
}

.directions-link svg {
    flex-shrink: 0;
}

/* ============================================
   Loading Spinner & Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-gray);
    border-top: 4px solid var(--tmobile-magenta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
}

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

/* Refresh button loading state */
.refresh-btn-top.loading {
    opacity: 0.7;
    pointer-events: none;
}

.refresh-btn-top.loading svg {
    animation: spin 0.8s linear infinite;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-color: var(--bg-white);
    color: var(--text-gray);
    text-align: center;
    padding: 0.75rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-gray);
}

.footer p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.footer-link {
    color: var(--text-dark);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--tmobile-magenta);
}

/* ============================================
   Responsive Design - Tablet (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .parking-types-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }

    .accordion-item.active .accordion-content {
        max-height: 700px;
    }
}

/* ============================================
   Responsive Design - Mobile (max 768px)
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .top-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem;
    }

    .main-container {
        padding: 0 1rem 1rem;
    }

    .accordion-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left {
        flex: 1;
        flex-direction: column;
        gap: 0.5rem;
        min-width: 0;
        align-items: flex-start;
    }

    .status-badge {
        margin-bottom: 0.25rem;
    }

    .header-right {
        flex-shrink: 0;
        justify-content: flex-end;
        align-items: flex-end;
        margin-top: 1.75rem;
    }

    .building-name {
        font-size: 1.125rem;
        font-weight: 700;
    }

    .building-address {
        font-size: 0.75rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .available-number {
        font-size: 2.5rem;
    }

    .availability-summary {
        min-width: 100px;
        max-width: 120px;
    }

    .progress-bar {
        width: 100%;
        max-width: 100%;
    }

    .parking-types-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        margin-top: 0;
        margin-bottom: 0;
    }

    .parking-type-item {
        padding: 1rem 0.75rem;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--border-gray);
        border-bottom: 1px solid var(--border-gray);
    }

    .parking-type-item:nth-child(2n) {
        border-right: none;
    }

    .content-inner {
        padding: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        border-top: 1px solid var(--border-gray);
    }

    .accordion-content {
        margin-top: 0;
    }

    .accordion-item.active .accordion-content {
        max-height: 650px;
    }

    .accordion-item.active .accordion-header {
        border-bottom: none;
    }
}

/* ============================================
   Responsive Design - Small Mobile (max 480px)
   ============================================ */
@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem;
    }

    .tmobile-icon {
        width: 32px;
        height: 32px;
        background-color: var(--bg-white);
        border-radius: 10%;
    }

    .top-bar {
        padding: 0.5rem 1rem;
    }

    .updated-time {
        font-size: 0.75rem;
    }

    .refresh-btn-top {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .refresh-btn-top svg {
        width: 14px;
        height: 14px;
    }

    .accordion-header {
        padding: 1rem;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .building-name {
        font-size: 1.1rem;
    }

    .building-address {
        font-size: 0.8rem;
    }

    .available-number {
        font-size: 1.75rem;
    }

    .total-text {
        font-size: 0.75rem;
    }

    .progress-bar {
        width: 100px;
    }

    .content-inner {
        padding: 0;
    }

    .parking-types-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        padding: 0;
    }

    .parking-type-item {
        padding: 0.75rem;
    }

    .type-icon-small {
        width: 32px;
        height: 32px;
    }

    .type-icon-small svg {
        width: 18px;
        height: 18px;
    }

    .type-icon-small img {
        width: 18px;
        height: 18px;
    }

    .type-label-small {
        font-size: 0.6rem;
    }

    .type-value-small {
        font-size: 0.875rem;
    }

    .directions-link {
        width: calc(100% + 2rem);
        margin: 0 -1rem;
        justify-content: center;
        font-size: 0.875rem;
        border-radius: 0;
        padding: 1rem;
    }
}

/* ============================================
   Accessibility & Print Styles
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus,
a:focus {
    outline: 2px solid var(--tmobile-magenta);
    outline-offset: 2px;
}

@media print {
    .header {
        background: var(--bg-white);
        color: var(--text-dark);
        box-shadow: none;
        border-bottom: 2px solid var(--tmobile-magenta);
    }

    .refresh-btn {
        display: none;
    }

    .accordion-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .accordion-content {
        max-height: none !important;
    }
}
