/* Chat Styles for the D r P Scheduling Assistant */

.schedule-section {
    padding: 100px 0 80px;
    min-height: calc(100vh - 80px);
}

.schedule-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.schedule-info {
    flex: 1;
    min-width: 300px;
}

/* Light frosted-glass panel (matches the theme's card glass) — shared by
   schedule.html and email.html; dark text below pairs with this. */
.chat-container {
    flex: 2;
    min-width: 350px;
    background: rgba(255, 253, 248, 0.58);
    -webkit-backdrop-filter: blur(13px) saturate(1.2);
    backdrop-filter: blur(13px) saturate(1.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.50);
    box-shadow: 0 12px 32px rgba(45, 90, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-container:hover {
    box-shadow: 0 16px 40px rgba(45, 90, 110, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(45, 212, 191, 0.45);
}

/* Sign-in cover over the chat window (PO 2026-07-10): honest UX for the
   backend's sign-in requirement — chat.js toggles [hidden] from auth state. */
.chat-container {
    position: relative;
}

.chat-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 253, 248, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

.chat-gate[hidden] {
    display: none;
}

.chat-gate-card {
    text-align: center;
    max-width: 320px;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(61, 43, 31, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

.chat-gate-lock {
    font-size: 1.6rem;
    color: var(--secondary-color, #0e9f8e);
    margin-bottom: 10px;
}

.chat-gate-card h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.chat-gate-card p {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: rgba(61, 43, 31, 0.75);
}

.chat-gate .gate-actions {
    display: flex;
    justify-content: center;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(125, 211, 252, 0.16);
    border-bottom: 1px solid rgba(61, 43, 31, 0.10);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-weight: 600;
    color: var(--text-light);
}

.chat-title i {
    color: var(--wake-teal-deep);
}

.chat-controls button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.chat-controls button:hover {
    color: var(--wake-teal-deep);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background: var(--primary-gradient);
    border-top-right-radius: 4px;
    color: #053b34;
}

.message.assistant .message-content {
    background: rgba(125, 211, 252, 0.22);
    border: 1px solid rgba(14, 159, 142, 0.20);
    border-top-left-radius: 4px;
    color: var(--text-light);
}

.message p {
    margin: 0;
    line-height: 1.4;
    /* inherit the bubble's color — styles.css's bare `p` rule would
       otherwise paint espresso text onto the dark panel */
    color: inherit;
}

.message.typing .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(14, 159, 142, 0.65);
    border-radius: 50%;
    animation: typingAnimation 1s infinite;
}

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

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

@keyframes typingAnimation {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.45);
    border-top: 1px solid rgba(61, 43, 31, 0.10);
}

.chat-input textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(61, 43, 31, 0.15);
    border-radius: 20px;
    padding: 12px 15px;
    color: var(--text-light);
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-size: 0.95rem;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input textarea:focus {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.85);
}

.chat-input textarea::placeholder {
    color: var(--text-dark);
}

.chat-input button {
    background: var(--primary-gradient);
    color: #053b34;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
    background: var(--primary-gradient);
}

.chat-input button:active {
    transform: scale(0.95);
}

.chat-input button i {
    font-size: 1rem;
}

/* Info Card Styles */
.info-card, 
.availability-highlights {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

.info-card h3,
.availability-highlights h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-weight: 600;
}

.schedule-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.schedule-steps li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #053b34;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-text {
    margin-top: 5px;
    color: var(--text-medium);
}

.availability-highlights ul {
    margin: 15px 0;
}

.availability-highlights li {
    margin-bottom: 10px;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 10px;
}

.availability-highlights i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.note {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .schedule-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .schedule-info {
        min-width: unset;
    }
    
    .chat-container {
        min-width: unset;
        height: 60vh;
        min-height: 450px;
        max-height: 600px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-input {
        padding: 15px;
    }
    
    .chat-input textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .info-card, 
    .availability-highlights {
        padding: 20px;
    }
}

/* Mobile optimizations for smaller screens */
@media (max-width: 480px) {
    .chat-container {
        height: 70vh;
        min-height: 400px;
        border-radius: 8px;
    }
    
    .chat-header h3 {
        font-size: 1rem;
    }
    
    .chat-input {
        padding: 12px;
        gap: 8px;
    }
    
    .chat-input textarea {
        padding: 10px 12px;
        min-height: 40px;
    }
    
    .chat-input button {
        padding: 10px 16px;
    }
    
    .message-content {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .typing-indicator {
        padding: 6px 12px;
    }
    
    /* Adjust info sections on mobile */
    .schedule-steps li {
        gap: 12px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .step-text {
        font-size: 0.9rem;
    }
}

/* Additional animation for chat messages */
.message {
    animation: message-pop 0.3s ease-out;
    transform-origin: bottom;
}

@keyframes message-pop {
    0% { 
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}