@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Chicle&display=swap');

:root {
    --vh: 100vh; /* Default value */
}

body {
    background-color: #1f2022;
    color: #e0e0e0;
    font-family: 'Varela Round', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(var(--vh, 1vh) * 100); /* Use custom property */
    overflow: hidden;
}

.iphone-frame {
    width: 390px;
    height: 100%;
    background-color: #1f2022;
    border-radius: 40px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.iphone-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    /*width: 160px;*/
    /*height: 5px;*/
    background-color: #333;
    border-radius: 10px;
}

.iphone-frame::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    /*width: 100px;*/
    /*height: 5px;*/
    background-color: #333;
    border-radius: 10px;
}

.container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #1f2022;
}

.logo {
    font-size: 1.6em;
    font-weight: bolder;
    color: #ffffff;
    font-family: 'Chicle', cursive;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 2.5px 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 10px 5px rgba(59, 130, 246, 0.4);
    }
    100% {
        box-shadow: 0 0 2.5px 0 rgba(59, 130, 246, 0.4);
    }
}

.playing {
    animation: pulse 2s infinite;
}

.profile-pic {
    width: 25px;
    height: 25px;
    background-color: #444;
    border-radius: 50%;
    transition: box-shadow 0.3s ease;
}

main {
    padding: 20px;
}

.eyebrow {
    font-size: 0.7em;
    color: #ababab;
    margin-bottom: -6px;
}

.time-posted {
    font-size: 0.7em;
    color: #757575;
    margin-left: 5px;
}

.book-section {
    margin-bottom: 20px;
}

.author-info {
    display: flex;
    align-items: flex-start;
    margin-top:-14px;
    margin-bottom: 10px;
}

.author-pic {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    margin-top: 20px;
}

.author-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1.15em;
}

.author-name {
    font-size: 0.8em;
    color: #7a7a7a;
    margin-top: -5px;
}

.rating {
    font-size: 0.8em;
    color: #f5c518;
    margin-top: 5px;
    margin-bottom: 5px;
}

.rating-count {
    color: #888;
    font-size: 0.7em;
}

.book-pic {
    width: 94px;
    height: 141px;
    margin-top: 16px;
    transform: rotate(8deg);
    border-radius: 8px;
    margin-left: 5px;
}

.cta-button {
    margin-top: 16px;
    padding: 10px 20px;
    background-color: #3b82f6;
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-family: 'Varela Round', sans-serif;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    text-decoration: none; /* Ensure no underline */
    display: inline-block;
}

.cta-button-link {
    text-decoration: none; /* Ensure no underline */
    display: inline-block;
}

.cta-button:hover {
    background-color: #2563eb; /* Darker blue for hover state */
}

.user-post {
    background-color: #2a2b30;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    margin-top: 20px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.vote-arrows {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.vote-arrows button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0; /* Remove default padding */
}

.vote-arrows img {
    width: 24px; /* Adjust size as needed */
    height: 24px; /* Adjust size as needed */
    display: block;
}

.vote-arrows button:hover img {
    filter: brightness(0) saturate(100%) invert(42%) sepia(85%) saturate(1510%) hue-rotate(200deg) brightness(97%) contrast(101%);
}

.vote-count {
    margin: 0 5px;
    color: #888;
    font-size: 0.8em;
}

.speech-bubble {
    background-color: #3e4046;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    flex-grow: 1;
}

.author-bubble {
    margin-left: 0px;
}

.user-name {
    margin: 0 0 5px 0;
    font-size: 0.8em;
    color: #bbb;
}

.user-question {
    margin: 0;
}

.play-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 48px;
    height: 48px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    }

.pause-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 54px;
    height: 54px;
    margin-left:-4px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button img, .pause-button img {
    width: 100%;
    height: 100%;
    display: block;
}

.play-button::after, .pause-button::after {
    content: attr(data-fallback);
    font-size: 1.5em;
    display: none;
}

.play-button svg, .pause-button svg {
    display: block;
}

.play-button.fallback, .pause-button.fallback {
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button.fallback img, .pause-button.fallback img {
    display: none;
}

.play-button.fallback::after, .pause-button.fallback::after {
    display: block;
}


.author-reply {
    display: flex;
    align-items: center;
    margin-top: 10px;
    position: relative;
}

.author-badge {
    background-color: #f5c518;
    color: #3d3d3d;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

.author-reply-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    margin-right: 0;
}

.connector {
    position: absolute;
    top: 50%;
    left: 39px; /* Centered relative to the profile picture */
    transform: translateY(-50%);
    display: none;
}

.vertical-line {
    width: 2px;
    height: 80%; /* Adjust as needed */
    background-color: #444;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display:none;
}

.horizontal-line {
    width: 30px;
    height: 2px;
    background-color: #444;
    position: absolute;
    top: calc(80% + 2px); /* Adjust to meet the vertical line */
    left: 0;
    display: none;
}

/* Frame for larger screens */
@media (min-width: 411px) {
    body {
        background-color: #333538;
    }

    .iphone-frame {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 390px;
        height: 844px;
        background-color: #1f2022;
        border-radius: 40px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        position: relative;
        margin: auto;
    }

    .container {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
