/* ==========================================================================
   SMS Conversation Animator Styles
   iPhone-like SMS interface with animated typing indicators
   ========================================================================== */

/* ==========================================================================
   Main Container
   ========================================================================== */
.sms-container {
    max-width: 400px;
    margin-top: 0;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}
@media (min-width: 992px) {
    .sms-container {
        margin-left: auto;
        margin-right: 0;
    }
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.sms-header {
    background: #f8f8f8;
    color: #333;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.sms-header-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #5a5a5a 0%, #8a8a8a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.sms-header-name {
    flex: 1;
    font-weight: 400;
    font-size: 0.75rem;
}

/* ==========================================================================
   Messages Container
   ========================================================================== */
.sms-messages {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    scroll-behavior: smooth;
    background: white;
}

/* ==========================================================================
   Message Bubbles
   ========================================================================== */
.sms-message {
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlideIn 0.5s ease-out forwards;
}

/* Message alignment */
.sms-message.sent {
    text-align: right;
}

.sms-message.received {
    text-align: left;
}

/* Base bubble styling */
.sms-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.3;
    font-size: 15px;
    position: relative;
    text-align: left;
}

/* Sent message styling (right side, blue) */
.sms-message.sent .sms-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 5px;
}

/* Received message styling (left side, grey) */
.sms-message.received .sms-bubble {
    background: #E5E5EA;
    color: #333;
    border-bottom-left-radius: 5px;
}

/* ==========================================================================
   Message Bubble Tails (speech bubble corners)
   ========================================================================== */
/* Sent message tail (right side) */
.sms-message.sent .sms-bubble::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: -4px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #007AFF;
    border-bottom: none;
    border-right: none;
}

/* Received message tail (left side) */
.sms-message.received .sms-bubble::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: -4px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #E5E5EA;
    border-bottom: none;
    border-left: none;
}

/* ==========================================================================
   Typing Indicator
   ========================================================================== */
.sms-typing {
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(10px);
    animation: typingSlideIn 0.3s ease-out forwards;
}

/* Typing indicator alignment */
.sms-typing.received {
    text-align: left;
}

.sms-typing.sent {
    text-align: right;
}

/* Base typing bubble styling */
.sms-typing .sms-bubble {
    background: #E5E5EA;
    color: #8E8E93;
    border-bottom-left-radius: 5px;
    padding: 10px 14px;
    position: relative;
}

/* Typing indicator tails */
.sms-typing.received .sms-bubble::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: -4px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #E5E5EA;
    border-bottom: none;
    border-left: none;
}

/* Sent typing indicator styling */
.sms-typing.sent .sms-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 5px;
}

.sms-typing.sent .sms-bubble::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: -4px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #007AFF;
    border-bottom: none;
    border-right: none;
}

/* ==========================================================================
   Typing Animation Dots
   ========================================================================== */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #8E8E93;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

/* Staggered animation delays for wave effect */
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

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

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Custom Scrollbar Styling
   ========================================================================== */
.sms-messages::-webkit-scrollbar {
    width: 4px;
}

.sms-messages::-webkit-scrollbar-track {
    background: transparent;
}

.sms-messages::-webkit-scrollbar-thumb {
    background: #C7C7CC;
    border-radius: 2px;
}

.sms-messages::-webkit-scrollbar-thumb:hover {
    background: #8E8E93;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 480px) {
    .sms-container {
        margin: 0 10px;
        border-radius: 15px;
        padding: 0;
    }
    
    .sms-header {
        padding: 10px 12px;
    }
    
    .sms-messages {
        height: 350px;
        padding: 12px;
    }
    
    .sms-bubble {
        max-width: 80%;
        font-size: 14px;
    }
} 