/* Text Chat Styles - Room.razor specific styles */

.chat-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile */
    max-width: 100%;
    margin: 0 auto;
    background: #e5ddd5;
    overflow: hidden;
    touch-action: manipulation; /* Prevent double-tap zoom */
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0f2f5;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.online-users-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #00a884 0%, #00c9a0 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.3);
    animation: fadeIn 0.3s ease-out;
}

.online-users-badge svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.online-count {
    min-width: 20px;
    text-align: center;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.contact-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contact-status.online {
    color: #00a884;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #54656f;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.icon-btn .icon {
    width: 24px;
    height: 24px;
}

.icon-btn.btn-leave,
.icon-btn.btn-leave-input {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    transition: all 0.3s ease;
}

.icon-btn.btn-leave:hover,
.icon-btn.btn-leave-input:hover {
    background: #dc3545;
    color: white;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.icon-btn.btn-leave:active,
.icon-btn.btn-leave-input:active {
    transform: rotate(90deg) scale(0.95);
}

.incoming-call-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 168, 132, 0.1);
    border-radius: 8px;
}

.incoming-call-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00a884;
}

.btn-audio-accept,
.btn-audio-reject {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.btn-audio-accept {
    background: #00a884;
    color: white;
}

.btn-audio-accept:hover {
    background: #008f6f;
}

.btn-audio-accept .icon {
    width: 16px;
    height: 16px;
}

.btn-audio-reject {
    background: var(--danger-color);
    color: white;
}

.btn-audio-reject:hover {
    background: #cc0000;
}

.btn-audio-reject .icon {
    width: 16px;
    height: 16px;
}

/* Active Call Bar - Redesigned Compact */
.active-call-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #00a884 0%, #00c9a0 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.25);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.active-call-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.call-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.call-contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
}

.call-contact-name::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0);
    }
}

.call-timer {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.call-controls {
    display: flex;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.call-btn {
    width: 38px;
    height: 38px;
    border: 2px solid white;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    position: relative;
}

.call-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
    border-color: white;
}

.call-btn:hover::after {
    opacity: 0.3;
    transform: scale(1.15);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn.muted {
    background: rgba(255, 51, 51, 0.9);
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.call-btn.muted:hover {
    background: #ff3333;
    transform: scale(1.08);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.call-btn.hangup-btn {
    background: rgba(255, 51, 51, 0.9);
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.call-btn.hangup-btn:hover {
    background: #ff3333;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.6);
}

.call-btn .icon {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scroll-behavior: smooth;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d9d9d9' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    -webkit-overflow-scrolling: touch;
}

/* Find Partner Center Card */
.find-partner-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    min-height: 400px;
}

.find-partner-card {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.5s ease-out;
}

.find-partner-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 200, 83, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.find-partner-icon svg {
    color: white;
    width: 48px;
    height: 48px;
}

.find-partner-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.find-partner-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.btn-find-partner-center {
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 200, 83, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-find-partner-center:hover {
    background: linear-gradient(135deg, #00a844 0%, #008f38 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 200, 83, 0.4);
}

.btn-find-partner-center:active {
    transform: translateY(0);
}

.btn-find-partner-center svg {
    width: 20px;
    height: 20px;
}

/* Searching Animation */
.searching-animation {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.5s ease-out;
}

.searching-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.searching-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0084ff 0%, #006edb 100%);
    animation: searchingBounce 1.4s infinite ease-in-out;
}

.searching-dot:nth-child(1) {
    animation-delay: 0s;
}

.searching-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.searching-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes searchingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-20px);
    }
}

.searching-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.searching-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
}

.btn-cancel-search-center {
    background: transparent;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cancel-search-center:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3);
}

.btn-cancel-search-center:active {
    transform: translateY(0);
}

.btn-cancel-search-center svg {
    width: 16px;
    height: 16px;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.message {
    display: flex;
    margin-bottom: 0.5rem;
    animation: messageSlideIn 0.2s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.outgoing {
    justify-content: flex-end;
}

.message.incoming {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 65%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.outgoing .message-bubble {
    background: #d9fdd3;
    border-bottom-right-radius: 2px;
}

.message.incoming .message-bubble {
    background: white;
    border-bottom-left-radius: 2px;
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #111b21;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-media {
    margin: -0.25rem -0.5rem 0.25rem -0.5rem;
}

.message-media img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-play-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #00a884;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-play-btn .icon {
    width: 16px;
    height: 16px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.message-time {
    font-size: 0.7rem;
    color: #667781;
}

.media-pending {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #667781;
    font-size: 0.85rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #00a884;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border-bottom-left-radius: 2px;
    max-width: 65%;
    margin: 0 1.5rem 0.5rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667781;
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-text {
    font-size: 0.85rem;
    color: #667781;
    font-style: italic;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f2f5;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
}
    .chat-input-bar .icon-btn.btn-leave-input {
        display: none;
    }

    .input-wrapper {
        flex: 1;
        background: white;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
    }

.input-wrapper textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    max-height: 100px;
    overflow-y: auto;
}

.input-wrapper textarea::placeholder {
    color: #8696a0;
}

.send-btn {
    background: #00a884 !important;
    color: white !important;
}

.send-btn:hover {
    background: #008f6f !important;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.emoji-picker {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    z-index: 999;
    width: 90%;
    max-width: 380px;
    animation: slideUpFade 0.3s ease-out;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.emoji-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
    overflow-x: auto;
    scrollbar-width: thin;
    flex-shrink: 0;
}

.emoji-tabs::-webkit-scrollbar {
    height: 4px;
}

.emoji-tabs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.emoji-tab {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.emoji-tab:hover {
    background: #f0f2f5;
    opacity: 0.8;
    transform: scale(1.1);
}

.emoji-tab.active {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    flex: 1;
    overflow-x: hidden;
}

.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.emoji-item {
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: #f0f2f5;
    transform: scale(1.2);
}

.emoji-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 998;
    animation: fadeIn 0.2s ease-out;
}

.upload-status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
}

/* Incoming Call Header Notification */
.incoming-call-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Auto-reconnect notice */
.auto-reconnect-notice {
    background: linear-gradient(135deg, #00a884 0%, #00c9a0 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 168, 132, 0.2);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

.auto-reconnect-notice span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reconnect-timer {
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cancel-auto-find-btn {
    background: rgba(255, 77, 77, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    padding: 0;
}

    .cancel-auto-find-btn:hover {
        background: rgba(255, 77, 77, 0.3);
        transform: scale(1.1);
    }

.cancel-auto-find-btn:active {
    transform: scale(0.95);
}

.cancel-auto-find-btn svg {
    width: 16px;
    height: 16px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.call-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    flex: 1;
}

.call-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

.call-header-details {
    flex: 1;
}

.call-header-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.1rem;
}

.call-header-status {
    font-size: 0.85rem;
    opacity: 0.9;
}

.call-header-timer {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.call-header-actions {
    display: flex;
    gap: 0.5rem;
}

.call-header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.call-header-btn.accept {
    background: rgba(0, 200, 83, 0.9);
}

.call-header-btn.accept:hover {
    background: #00c853;
    transform: scale(1.1);
}

.call-header-btn.reject {
    background: rgba(255, 51, 51, 0.9);
}

.call-header-btn.reject:hover {
    background: #ff3333;
    transform: scale(1.1);
}

.call-header-btn svg {
    width: 20px;
    height: 20px;
}

/* Confirmation Dialog */
.confirm-dialog {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.confirm-header {
    margin-bottom: 1rem;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.confirm-title svg {
    color: #ff9800;
}

.confirm-body {
    margin-bottom: 1.5rem;
}

.confirm-message {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-confirm-cancel,
.btn-confirm-ok {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-confirm-cancel {
    background: #f0f2f5;
    color: var(--text-primary);
}

.btn-confirm-cancel:hover {
    background: #e4e6eb;
}

.btn-confirm-ok {
    background: #dc3545;
    color: white;
}

.btn-confirm-ok:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.options-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.options-menu {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f2f5;
}

.options-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.options-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f2f5;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.options-close-btn:hover {
    background: #e4e6eb;
    transform: rotate(90deg);
}

.options-section {
    margin-bottom: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f0f2f5;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom:10px;
}

.option-item:hover {
    background: #e4e6eb;
}

.option-info {
    flex: 1;
}

.option-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.option-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Call Settings (moved to options) */
.call-settings {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 0 1rem 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.call-settings:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.call-settings-checkbox {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.call-settings-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.call-settings-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.call-settings-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.call-settings-checkbox input:checked + .call-settings-slider {
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
}

.call-settings-checkbox input:checked + .call-settings-slider:before {
    transform: translateX(22px);
}

.call-settings-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.call-settings-label svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.call-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.call-icon {
    width: 24px;
    height: 24px;
    color: #00a884;
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.call-type {
    font-weight: 600;
    font-size: 0.9rem;
}

.call-duration {
    font-size: 0.8rem;
    color: #667781;
}

.btn-find-partner {
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.3);
}

.btn-find-partner:hover {
    background: linear-gradient(135deg, #00a844 0%, #008f38 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.4);
}

.btn-cancel-search {
    background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.3);
}

.btn-cancel-search:hover {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4);
}

.partner-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 132, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Design - Mobile First Approach */

/* Small Mobile Phones (320px - 480px) */
@media (max-width: 480px) {
    /* Chat Header */
    .chat-header {
        padding: 0.625rem 0.875rem;
        min-height: 56px;
    }

    .chat-header-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .contact-info {
        gap: 0.625rem;
    }

    .contact-name {
        font-size: 0.875rem;
    }

    .contact-status {
        font-size: 0.75rem;
    }  

    .chat-actions {
        gap: 0.375rem;
        justify-content: center;
    }
        .chat-actions .icon-btn.btn-leave{
            display:none;
        }
        /* Buttons */
        .btn-find-partner,
        .btn-cancel-search {
            display: none; /* Hide on mobile - use center card instead */
        }

    .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .icon-btn .icon {
        width: 18px;
        height: 18px;
    }

    /* Hide emoji button on mobile */
    .chat-input-bar .emoji-btn {
        display: none;
    }
    .chat-input-bar .icon-btn.btn-leave-input {
        margin-right: 15px;
        display:inline-block;
    }
    /* Reorder buttons on mobile - leave before input, attachment after input */
    .chat-input-bar {
        display: flex;
        flex-wrap: nowrap;
    }
    
    .chat-input-bar .btn-leave-input {
        order: 1;
    }
    
    .chat-input-bar .input-wrapper {
        order: 2;
    }
    
    .chat-input-bar .attach-btn {
        order: 3;
    }
    
    .chat-input-bar .send-btn {
        order: 4;
    }

    /* Messages */
    .messages-area {
        padding: 1rem 0.875rem;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 0.5rem 0.65rem;
    }

    /* Find Partner Center - Mobile */
    .find-partner-center {
        min-height: 300px;
    }

    .find-partner-card,
    .searching-animation {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .find-partner-icon {
        width: 64px;
        height: 64px;
    }

    .find-partner-icon svg {
        width: 36px;
        height: 36px;
    }

    .find-partner-title {
        font-size: 1.35rem;
    }

    .find-partner-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .btn-find-partner-center {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .searching-title {
        font-size: 1.25rem;
    }

    .searching-subtitle {
        font-size: 0.9rem;
    }

    .btn-cancel-search-center {
        padding: 0.625rem 1.5rem;
        font-size: 0.9rem;
    }

    .chat-input-bar {
        padding: 0.625rem 0.875rem;
        gap: 0.375rem;
    }

    .input-wrapper {
        padding: 0.375rem 0.625rem;
    }

    .input-wrapper textarea {
        font-size: 0.95rem;
        padding: 0.125rem 0;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .send-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Emoji Picker */
    .emoji-picker {
        max-width: calc(100vw - 1.5rem);
        width: 96%;
        bottom: 65px;
        left: 0.75rem;
        right: 0.75rem;
        transform: none;
        padding: 0.75rem;
        max-height: 320px;
    }

    .emoji-tabs {
        gap: 0.125rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.375rem;
    }

    .emoji-tab {
        font-size: 1.25rem;
        padding: 0.375rem 0.5rem;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.375rem;
        max-height: 220px;
    }

    .emoji-item {
        font-size: 1.5rem;
        padding: 0.375rem;
    }

    /* Confirmation Dialog */
    .confirm-dialog {
        max-width: 92%;
        padding: 1.25rem;
    }

    .confirm-title {
        font-size: 1.1rem;
    }

    .confirm-message {
        font-size: 0.9rem;
    }

    .btn-confirm-cancel,
    .btn-confirm-ok {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    /* Options Menu */
    .options-menu {
        min-width: 280px;
        max-width: 92%;
        padding: 1.25rem;
    }

    .options-title {
        font-size: 1.25rem;
    }

    /* Active Call Bar */
    .active-call-bar {
        padding: 0.5rem 0.875rem;
    }

    /* Incoming Call */
    .incoming-call-header {
        padding: 0.75rem 0.875rem;
    }

    .call-header-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .call-header-name {
        font-size: 0.9rem;
    }

    .call-header-status {
        font-size: 0.75rem;
    }

    .call-header-btn {
        width: 40px;
        height: 40px;
    }

    .call-header-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Tablets and Medium Mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .chat-header {
        padding: 0.75rem 1rem;
    }

    .online-users-badge {
        display: flex; /* Show on tablets */
    }

    .message-bubble {
        max-width: 75%;
    }

    .emoji-picker {
        max-width: calc(100vw - 2rem);
        width: 95%;
    }

    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-header {
        padding: 0.5rem 1rem;
        min-height: 50px;
    }

    .chat-header-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .contact-name {
        font-size: 0.85rem;
    }

    .message-container {
        padding: 0.5rem;
    }

    .message-bubble {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .message-input-container {
        padding: 0.5rem;
    }

    .incoming-call-header {
        padding: 0.5rem 0.875rem;
    }

    .active-call-bar {
        padding: 0.375rem 0.75rem;
    }
}

/* Desktop and Larger Screens (769px+) */
@media (min-width: 769px) {
    .chat-header {
        padding: 1rem 1.5rem;
    }

    .chat-header-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .contact-info {
        gap: 1rem;
    }

    .contact-name {
        font-size: 1.1rem;
    }

    .contact-status {
        font-size: 0.9rem;
    }

    .chat-actions {
        gap: 0.75rem;
    }

    .message-bubble {
        max-width: 60%;
    }
}

