* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
}

/* Popup Styles */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.popup-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 28rem;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid #dc2626;
    background-color: #f9fafb;
}

.breaking-news {
    background-color: #dc2626;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.popup-date {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-body {
    padding: 2rem;
    text-align: left;
    background: white;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: black;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .popup-title {
        font-size: 1.875rem;
    }
}

.popup-subtitle {
    font-size: 1rem;
    color: #b91c1c;
    font-weight: bold;
    font-style: italic;
    border-left: 4px solid #dc2626;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .popup-subtitle {
        font-size: 1.25rem;
    }
}

.popup-images {
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .popup-images {
        padding: 0 2rem;
    }
}

.as-seen-on {
    width: 100%;
    height: auto;
    margin-bottom: 0.75rem;
}

.senior-card {
    border-radius: 0.5rem;
    width: 100%;
    height: auto;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.popup-footer {
    padding: 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .popup-footer {
        padding: 2rem;
    }
}

.claim-text {
    text-align: center;
    font-weight: bold;
    color: black;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.claim-button {
    width: 100%;
    background-color: #b91c1c;
    color: white;
    font-weight: 900;
    padding: 1.5rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.claim-button:hover {
    background-color: #991b1b;
    transform: scale(1.05);
}

/* Main Layout Styles */

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */

.header {
    background: white;
    border-bottom: 1px solid #d1d5db;
}

.nav {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .nav {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .nav {
        padding: 0 2rem;
    }
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem;
    gap: 0.75rem;
}

.shield-icon {
    height: 2rem;
    width: 2rem;
    color: #1e3a8a;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.nav-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Main Content */

main {
    flex: 1;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    main {
        padding: 2rem 0;
    }
}

/* Chat Container */

.chat-container {
    max-width: 42rem;
    margin: 0 auto;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 11rem);
    max-height: calc(100vh - 11rem);
}

/* Mobile-specific fix for Chrome address bar */

@media (max-width: 767px) {
    .chat-container {
        height: calc(100vh - 16rem);
        max-height: calc(100vh - 16rem);
        position: relative;
    }
    /* Ensure chat messages don't take too much space */
    .chat-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    /* Ensure options are always visible */
    .chat-input-container {
        flex-shrink: 0;
        position: relative;
        z-index: 10;
    }
}

@media (min-width: 768px) {
    .chat-container {
        height: 600px;
        margin: 2rem auto;
        max-height: calc(100vh - 12rem);
    }
}

/* Chat Header */

.chat-header {
    background-color: #2563eb;
    color: white;
    padding: 1rem;
    flex-shrink: 0;
}

.chat-header-content {
    display: flex;
    align-items: center;
}

.agent-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    object-fit: cover;
}

.agent-name {
    font-weight: 600;
}

.agent-status {
    font-size: 0.875rem;
    color: #dbeafe;
}

/* Chat Messages */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f9fafb;
    scroll-behavior: smooth;
}

/* Message Styles */

.message {
    display: flex;
    margin-bottom: 0.75rem;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.agent {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    display: flex;
    max-width: 75%;
    align-items: flex-start;
}

@media (min-width: 1024px) {
    .message-content {
        max-width: 66.666667%;
    }
}

.message.agent .message-content {
    flex-direction: row;
}

.message.user .message-content {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
    object-fit: cover;
}

.message.user .message-avatar {
    display: none;
}

.message-bubble {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.message.agent .message-bubble {
    background: white;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.message.user .message-bubble {
    background-color: #2563eb;
    color: white;
}

.message-text {
    font-size: 0.875rem;
}

.message-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.message.agent .message-time {
    text-align: left;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */

.typing-indicator {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
    animation: messageSlideIn 0.3s ease-out;
}

.typing-content {
    display: flex;
    align-items: center;
}

.typing-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
    object-fit: cover;
}

.typing-dots {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

.dots-container {
    display: flex;
    gap: 0.25rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.1s;
}

.dot:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat Input Container */

.chat-input-container {
    flex-shrink: 0;
}

/* Chat Options */

.chat-options {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.option-button {
    width: 100%;
    text-align: left;
    padding: 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.5rem;
}

.option-button:last-child {
    margin-bottom: 0;
}

.option-button:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
    transform: scale(1.02);
}

.option-button:active {
    transform: scale(0.98);
}

/* Special styling for Medicare question */

.option-button.medicare-yes {
    background: linear-gradient(135deg, #10b981, #16a34a);
    color: white;
    font-weight: 600;
    border: 2px solid #16a34a;
    animation: pulseSize 1.5s ease-in-out infinite;
    text-align: center;
    font-size: 0.95rem;
}

@keyframes pulseSize {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.option-button.medicare-yes:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    animation: pulseSize 1.5s ease-in-out infinite;
}

.option-button.medicare-no {
    background-color: #dc2626;
    color: white;
    font-weight: 600;
    border: 2px solid #dc2626;
    padding: 0.5rem;
    font-size: 0.825rem;
    text-align: center;
}

.option-button.medicare-no:hover {
    background-color: #b91c1c;
    border-color: #991b1b;
}

/* Chat Results */

.chat-results {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.results-content {
    text-align: center;
}

.results-success {
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.call-button {
    display: inline-block;
    background-color: #16a34a;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s;
    margin-bottom: 0.75rem;
}

.call-button:hover {
    background-color: #15803d;
}

.results-timer-text {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc2626;
}

/* Call Button in Chat */

.chat-call-button-container {
    padding: 1rem;
    animation: messageSlideIn 0.3s ease-out;
}

.call-button-section {
    background: linear-gradient(to bottom, #f0fdf4, #dcfce7);
    border: 2px solid #16a34a;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.call-success {
    color: #16a34a;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.chat-call-button {
    display: inline-block;
    background-color: #16a34a;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    white-space: nowrap;
}

.chat-call-button:hover {
    background-color: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.call-timer-text {
    font-size: 0.875rem;
    color: #374151;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.chat-countdown {
    font-size: 1.75rem;
    font-weight: bold;
    color: #dc2626;
}

.chat-countdown-inline {
    font-size: 1.125rem;
    font-weight: bold;
    color: #dc2626;
}

/* Footer */

.footer {
    background-color: #1f2937;
    color: white;
    margin-top: 3rem;
}

.footer-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

@media (min-width: 640px) {
    .footer-content {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .footer-content {
        padding: 2rem;
    }
}

.footer-copyright {
    font-size: 0.875rem;
    color: #9ca3af;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}