/* Base Styles */
:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    
    --yellow-500: #f59e0b;
    --purple-500: #8b5cf6;
    --pink-500: #ec4899;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius-sm: 0.125rem;
    --border-radius: 0.25rem;
    --border-radius-md: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
    --border-radius-2xl: 1rem;
    --border-radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--gray-800);
    background: linear-gradient(to bottom, var(--primary-50), var(--primary-100));
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animations */
@keyframes textGradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animate {
    background: linear-gradient(
        to right,
        #ff7e5f,
        #feb47b,
        #ffcb80,
        #00c9ff,
        #92fe9d,
        #ff9a9e
    );
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradientAnimation 10s ease infinite;
    display: inline-block;
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.75s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-float-in {
    animation: floatIn 0.5s ease-out;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-600);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Auth Screens */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
}

.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    font-size: 1rem;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.input-with-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    width: 1.25rem;
    height: 1.25rem;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--red-600);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: none;
}

.error-message.active {
    display: block;
}

.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--green-600);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: none;
}

.success-message.active {
    display: block;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-600);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-lg);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn i {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
}

.btn-primary {
    background-color: var(--primary-500);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-600);
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-200);
}

.btn-danger {
    background-color: var(--red-500);
    color: white;
}

.btn-danger:hover {
    background-color: var(--red-600);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--border-radius-full);
    background-color: transparent;
    color: var(--gray-600);
    cursor: pointer;
}

.icon-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.full-width {
    width: 100%;
}

/* Home Screen */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-full);
    background-color: var(--primary-500);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar i {
    width: 1.5rem;
    height: 1.5rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.home-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contacts-container, .sidebar {
    background-color: white;
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.contacts-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 12rem);
    min-height: 500px;
}

.contacts-container h2, .sidebar h2 {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.contacts-container h2 i, .sidebar h2 i {
    margin-right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

.search-container {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    font-size: 1rem;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Custom Scrollbar Styles */
.contacts-list {
    max-height: none;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
    padding-right: 0.5rem;
}

/* For Webkit browsers (Chrome, Safari, etc.) */
.contacts-list::-webkit-scrollbar {
    width: 6px;
}

.contacts-list::-webkit-scrollbar-track {
    background: transparent;
}

.contacts-list::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: var(--border-radius-full);
}

.contacts-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-400);
}

.contact-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 0.5rem;
    background-color: var(--gray-50);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.contact-card:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.contact-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0; /* Helps with text overflow */
}

.contact-details {
    margin-left: 0.75rem;
    overflow: hidden;
}

.contact-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--border-radius-full);
    background-color: var(--green-500);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.call-btn:hover {
    background-color: var(--green-600);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn i {
    width: 1.25rem;
    height: 1.25rem;
}

.info-card {
    background-color: var(--gray-50);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin-top: 1rem;
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.tips-list {
    list-style-type: none;
    padding-left: 0;
}

.tips-list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.tips-list li::before {
    content: "•";
    margin-right: 0.5rem;
}

/* Profile Screen */
.profile-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-section, .profile-settings {
    background-color: white;
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.profile-picture-container {
    position: relative;
    width: 8rem;
    height: 8rem;
    margin: 0 auto 2.5rem;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-full);
    border: 4px solid var(--primary-500);
    background-color: var(--gray-200);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture i {
    width: 3rem;
    height: 3rem;
}

.change-picture-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-full);
    background-color: var(--primary-500);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.change-picture-btn:hover {
    background-color: var(--primary-600);
}

.change-picture-btn i {
    width: 1.25rem;
    height: 1.25rem;
}

.profile-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.profile-settings h2 {
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.help-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Call Screen */
.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--gray-900);
    overflow: hidden;
}

.video-window {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.main-video {
    width: 100%;
    height: 100%;
}

.pip-video {
    position: absolute;
    width: 12rem;
    height: 9rem;
    right: 1rem;
    bottom: 6rem;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    cursor: move;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expand-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.expand-btn:hover {
    opacity: 1;
}

.expand-btn i {
    width: 1rem;
    height: 1rem;
}

.call-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: var(--border-radius-lg);
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
}

.control-btn {
    width: 3rem;
    height: 3rem;
    border-radius: var(--border-radius-full);
    background-color: var(--primary-500);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.control-btn:hover {
    background-color: var(--primary-600);
}

.control-btn.danger {
    background-color: var(--red-500);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    transform: scale(1.2);
}

.control-btn.danger:hover {
    background-color: var(--red-600);
    transform: scale(1.3);
}

.control-btn i {
    width: 1.5rem;
    height: 1.5rem;
}

/* Floating Window */
.floating-window {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20rem;
    height: 75vh;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 30;
    display: flex;
    flex-direction: column;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: linear-gradient(to right, var(--primary-500), var(--purple-500));
    color: white;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: var(--border-radius-full);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.close-btn i {
    width: 1rem;
    height: 1rem;
}

.window-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-top: 1px solid var(--gray-200);
    position: relative;
}

.attachment-btn, .emoji-btn, .send-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--border-radius-full);
}

.attachment-btn:hover, .emoji-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.send-btn {
    background-color: var(--primary-500);
    color: white;
}

.send-btn:hover {
    background-color: var(--primary-600);
}

.message-input-container {
    flex: 1;
    position: relative;
    margin: 0 0.5rem;
}

textarea {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-full);
    padding: 0.5rem 2rem 0.5rem 1rem;
    resize: none;
    max-height: 8rem;
    overflow-y: auto;
}

.emoji-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Message Styles */
.message-container {
    margin-bottom: 1rem;
    display: flex;
}

.message {
    max-width: 75%;
    word-break: break-word;
    position: relative;
}

/* Gift Display */
.gift-display {
    position: absolute;
    z-index: 50;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    color: white;
    animation: bounceIn 0.75s;
}

.gift-display img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* Gift Selector Styles */
.gift-selector {
    width: 300px;
    height: auto;
    max-height: 70vh;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.gift-item:hover {
    background-color: var(--gray-100);
}

.gift-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* Emoji Picker Styles */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 250px;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
}

.emoji-item {
    font-size: 1.25rem;
    text-align: center;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius);
}

.emoji-item:hover {
    background-color: var(--gray-100);
}

/* Attachment Styles */
.attachment-preview {
    margin-top: 0.5rem;
    position: relative;
}

.attachment-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius);
}

.attachment-download {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-link {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.attachment-link a {
    color: inherit;
    text-decoration: none;
}

/* Dialog */
.dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

.dialog-content {
    background-color: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
    z-index: 99999;
}

.caller-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.caller-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: var(--border-radius-full);
    border: 4px solid var(--primary-500);
    background-color: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

.caller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide ALL SVG and icon elements inside caller avatars - aggressive selector */
.caller-avatar > *:not(img),
.caller-avatar svg,
.caller-avatar i,
.caller-avatar [data-lucide],
.caller-avatar .lucide,
.caller-avatar > svg {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1rem;
}

.call-action-btn {
    width: 5rem;
    height: 5rem;
    border-radius: var(--border-radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.call-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.call-action-btn.decline {
    background-color: var(--red-500);
    color: white;
}

.call-action-btn.decline:hover {
    background-color: var(--red-600);
}

.call-action-btn.answer {
    background-color: var(--green-500);
    color: white;
}

.call-action-btn.answer:hover {
    background-color: var(--green-600);
}

.call-action-btn i {
    width: 2.5rem;
    height: 2.5rem;
}

/* Incoming call dialog specific styles for mobile */
#incoming-call-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* Mobile call actions */
@media (max-width: 480px) {
    .call-actions {
        gap: 2rem;
        margin-top: 2rem;
    }
    
    .call-action-btn {
        width: 4.5rem;
        height: 4.5rem;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .call-action-btn.decline {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    }
    
    .call-action-btn.answer {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    }
    
    /* Enhance incoming call dialog for mobile */
    .dialog-content {
        width: 85%;
        max-width: 320px;
        padding: 1.5rem;
    }
    
    /* Make caller info more prominent */
    .caller-info {
        margin: 1.5rem 0;
    }
    
    /* Make minimize content easier to tap */
    .mini-call-content {
        padding: 1rem;
    }
    
    .mini-call-btn {
        width: 44px;
        height: 44px;
    }
}

/* Contact Management Styles */
.search-with-btn {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.search-with-btn input {
    flex: 1;
}

.search-container {
    margin-bottom: 1rem;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    font-size: 1rem;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: var(--border-radius-full);
}

.close-modal-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.contact-search-result {
    margin-top: 1rem;
}

.user-result-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.user-result-card .avatar {
    margin-right: 1rem;
}

.btn-success {
    background-color: var(--green-500);
    color: white;
}

.btn-success:hover {
    background-color: var(--green-600);
}

.btn-success:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
}

/* Active Dialog for Calls */
.active-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-500);
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Call Status Overlay Styles */
.call-status-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    pointer-events: none;
}

.call-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-align: center;
}

.remote-user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #f0f0f0;
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
}

.remote-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remote-user-avatar svg {
    width: 60px;
    height: 60px;
    color: #888;
}

#remote-user-name {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

#call-status-text {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 10px;
}

/* Loading dots animation */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
}

.loading-dots .dot {
    background-color: white;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    display: inline-block;
    animation: dot-pulse 1.5s infinite ease-in-out;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Minimized call dialog */
.minimized-call-dialog {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.mini-call-content {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

.mini-caller-info {
    flex: 1;
    color: white;
}

.mini-caller-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.mini-call-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.mini-call-actions {
    display: flex;
    gap: 0.5rem;
}

.mini-call-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mini-call-btn i {
    width: 16px;
    height: 16px;
}

.mini-call-btn.decline {
    background-color: var(--red-500);
    color: white;
}

.mini-call-btn.answer {
    background-color: var(--green-500);
    color: white;
}

.mini-call-btn.decline:hover {
    background-color: var(--red-600);
}

.mini-call-btn.answer:hover {
    background-color: var(--green-600);
}

.mini-caller-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-full);
    background-color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
}

.mini-caller-avatar i {
    width: 24px;
    height: 24px;
    color: white;
}

.mini-caller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .home-content, .profile-content {
        grid-template-columns: 1fr;
    }
    
    .contacts-container {
        margin-bottom: 1.5rem;
        height: calc(70vh - 6rem);
        min-height: 400px;
    }
    
    .call-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pip-video {
        width: 8rem;
        height: 6rem;
    }
    
    .floating-window {
        width: 90%;
        height: 70vh;
        left: 5%;
        right: 5%;
    }
    
    .gift-selector {
        width: 90%;
        left: 5%;
        right: 5%;
    }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .app-header {
        padding: 0.75rem 1rem;
    }
    
    .home-content, .profile-content {
        padding: 1rem;
    }
    
    .call-controls {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .control-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .control-btn i {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    /* Mobile call dialog enhancements */
    .call-actions {
        gap: 2rem;
        margin-top: 2rem;
    }
    
    .call-action-btn {
        width: 4.5rem;
        height: 4.5rem;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .call-action-btn.decline {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    }
    
    .call-action-btn.answer {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    }
    
    .call-action-btn i {
        width: 2rem;
        height: 2rem;
    }
    
    /* Enhance incoming call dialog for mobile */
    .dialog-content {
        width: 85%;
        max-width: 320px;
        padding: 1.5rem;
    }
    
    .caller-avatar {
        width: 6rem;
        height: 6rem;
    }
    
    .caller-avatar i {
        width: 3rem;
        height: 3rem;
    }
    
    /* Make caller info more prominent */
    .caller-info {
        margin: 1.5rem 0;
    }
    
    /* Make minimize content easier to tap */
    .mini-call-content {
        padding: 1rem;
    }
    
    .mini-call-btn {
        width: 44px;
        height: 44px;
    }
}

/* Contact Menu Styles */
.contact-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-menu {
    position: relative;
}

.menu-toggle-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--border-radius-full);
    background-color: var(--gray-200);
    color: var(--gray-600);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
    background-color: var(--gray-300);
    transform: scale(1.05);
}

.menu-toggle-btn:active {
    transform: scale(0.95);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    border: 1px solid var(--gray-200);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
}

.dropdown-item i {
    width: 1rem;
    height: 1rem;
}

.remove-contact-btn {
    color: var(--red-600);
}

.block-user-btn {
    color: var(--red-700);
}

.silent-call-btn {
    color: var(--blue-600);
}

/* Friend Request Styles */
.contact-buttons {
    display: flex;
    gap: 0.5rem;
}

.search-with-btn {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .search-with-btn {
        flex-direction: row;
    }
    
    .search-with-btn input {
        flex: 1;
    }
}

.requests-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-600);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-600);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-500);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.request-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 0.5rem;
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.request-actions button {
    min-width: 80px;
}

/* Recent Activity Styles */
.recent-activity-list {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.recent-activity-list::-webkit-scrollbar {
    width: 8px;
}

.recent-activity-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 8px;
}

.recent-activity-list::-webkit-scrollbar-thumb {
    background-color: #6c757d;
    border-radius: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    margin-right: 12px;
    width: 30px;
    height: 30px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-icon .incoming {
    color: #28a745;
}

.activity-icon .outgoing {
    color: #007bff;
}

.activity-icon .missed {
    color: #dc3545;
}

.activity-details {
    flex: 1;
}

.activity-user {
    font-weight: bold;
    margin-bottom: 2px;
}

.activity-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

.empty-activity {
    text-align: center;
    color: #6c757d;
    padding: 20px 0;
}

.empty-activity i {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Make sidebar scrollable if needed */
.sidebar {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 12rem);
    min-height: 500px;
    overflow-y: auto;
}

.sidebar button {
    margin-bottom: 1rem;
}