/* Custom Fonts */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
}

.install-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.install-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.install-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    opacity: 0.9;
}

.install-btn {
    background: white;
    color: #2196F3;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.install-btn:hover {
    transform: scale(1.05);
}

.install-help {
    font-size: 0.9rem;
    margin-top: 1.5rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* App Content */
.app-content {
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

.app-content.hidden {
    display: none;
}

/* Screen Base */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f1f0f5;
    display: flex;
    flex-direction: column;
}

.detail-screen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Slightly darker background */
    display: flex;
    align-items: flex-end;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.detail-screen-container.active {
    opacity: 1;
    visibility: visible;
}

/* Main Screen */
#main-screen {
    z-index: 1;
    transition: filter 0.3s ease;
}

/* Header */
.header {
    padding: 20px 20px 10px;
    background: #f1f0f5;
    position: relative;
}

.header-icons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.icon-svg {
    width: 30px;
    height: 30px;
    filter: brightness(0) saturate(100%) invert(43%) sepia(27%) saturate(1570%) hue-rotate(165deg) brightness(107%) contrast(79%);
}

.close-icon-svg {
    width: 25px;
    height: 25px;
    filter: none;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 650;
    color: #000;
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Pass Card */
.pass-card {
    background: white;
    border-radius: 10px;
    padding-left: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.pass-content {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    /* Allow items to stretch to fill the container height */
}

.pass-left {
    display: flex;
    flex-direction: row;
    /* Keep elements in a row */
    align-items: center;
    /* Center items vertically within flex row */
    gap: 10px;
    flex: 1;
    padding-left: 0px;
}

.citybus-logo-img {
    width: 70px;
    height: 45px;
    object-fit: contain;
}

.pass-info {
    flex: 1;
    /* Allow pass-info to take remaining space */
    text-align: right;
    /* Anchor text to the right */
    padding-right: 10px;
    /* Adjust padding to align with the badge */
}

.pass-info h3 {
    font-size: 1rem;
    font-weight: bold;
    color: #202f50;
}

.time-left-badge {
    color: white;
    text-align: center;
    min-width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #1a294c;
    /* Default background for the whole badge */
    border-radius: 0 10px 10px 0;
    /* Apply border-radius to the right side */
    overflow: hidden;
    /* Ensure inner elements respect border-radius */
}

.badge-header {
    background-color: #275988;
    /* New background color for the 'Time Left' part */
    padding: 5px 0px;
    width: 100%;
    /* Ensure it spans the full width of the badge */
}

.badge-label {
    display: block;
    font-size: 1em;
    font-weight: 500;
    opacity: 0.9;
}

.badge-number {
    display: block;
    font-size: 2.5em;
    font-weight: 600;
    line-height: 1;
    padding: 7px 0px;
}

.badge-unit {
    display: block;
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: 0.5px;
    color: #c7cad3;
    padding-bottom: 5px;
}

/* Buy Passes Button */
.buy-passes-btn {
    background: #F89921;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: auto;
    margin-bottom: 20px;
    width: 100%;
}

.buy-passes-btn:hover {
    transform: translateY(-2px);
}


/* Detail Screen */
.detail-screen {
    color: #3d4043;
    background: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: 'Arial', sans-serif;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.detail-screen-container.active .detail-screen {
    transform: translateY(0);
}

.detail-header {
    padding: 20px;
    text-align: left;
    position: relative;
}

.detail-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2px;
    max-width: 80%;
    word-wrap: break-word;
}

.detail-subtitle {
    font-size: 1rem;
    word-wrap: break-word;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Detail Content */
.detail-content {
    flex: 1;
    position: relative;
    padding: 20px;
    min-height: 500px;
}

/* Pass Display */
.pass-display {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pass-circle {
    width: 200px;
    height: 200px;
    background: #0359d5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.66s linear, height 0.66s linear, padding 0.66s linear;
}

#pass-circle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: black;
    opacity: calc(4 / 15);
    transition: width 0.66s linear, height 0.66s linear;
    z-index: 10;
}

.pass-inner-circle {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

.pass-logo-large {
    text-align: center;
    color: #2196F3;
}

.citybus-logo-img-large {
    width: 90px;
    height: 67.5px;
    object-fit: contain;
}

/* Time Display */
.time-display {
    position: absolute;
    top: 47%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

#current-time {
    font-size: 3.5rem;
    font-weight: bold;
    letter-spacing: -1px;
}

/* Pass Details */
.pass-details {
    position: absolute;
    top: 63%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.pass-info-card {
    border-radius: 5px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.08)
}

.pass-details h3 {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 8px;
}

.location {
    font-size: 0.8rem;
    margin-bottom: 30px;
}

.expiration {
    font-size: 1rem;
    padding: 0;
    background: none;
    border-radius: 0;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 375px) {
    .header h1 {
        font-size: 2.2rem;
    }

    .pass-circle {
        width: 180px;
        height: 180px;
    }

    .pass-inner-circle {
        width: 110px;
        height: 110px;
    }

    #current-time {
        font-size: 2.5rem;
    }
}

@media (max-height: 667px) {
    .detail-content {
        padding: 20px;
        gap: 20px;
    }

    .pass-circle {
        width: 160px;
        height: 160px;
    }

    .pass-inner-circle {
        width: 100px;
        height: 100px;
    }

    #current-time {
        font-size: 2.2rem;
    }
}