/* Theme Variables */
:root {
    /* Light Theme */
    --bg-light: #ffffff;
    --text-light: #1a1a1a;
    --primary-light: #7C3AED;
    --secondary-light: #e4e6eb;
    --accent-light: #ffffff;
    
    /* Dark Theme */
    --bg-dark: #18191a;
    --text-dark: #ffffff;
    --primary-dark: #8B5CF6;
    --secondary-dark: #242526;
    --accent-dark: #02060a;

    /* Common */
    --gradient-dark: linear-gradient(135deg, #7C3AED, #3B82F6);
    --gradient-light: linear-gradient(135deg, #8B5CF6, #60A5FA);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 16px;
}

/* Theme Specific Styles */
[data-theme="light"] {
    --bg: var(--bg-light);
    --text: var(--text-light);
    --primary: var(--primary-light);
    --secondary: var(--secondary-light);
    --accent: var(--accent-light);
    --gradient: var(--gradient-light);
}

[data-theme="dark"] {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --primary: var(--primary-dark);
    --secondary: var(--secondary-dark);
    --accent: var(--accent-dark);
    --gradient: var(--gradient-dark);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    transition: 0.2s;
}

body {
   
    color: var(--text);
    min-height: 100vh;
    transition: var(--transition);
    
}


/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

[data-theme="light"] .glass-effect {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle button {
    background: var(--secondary);
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    transform: rotate(45deg);
    background: var(--primary);
    color: white;
}

.theme-toggle i {
    font-size: 20px;
}

/* Login Screen */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    background: transparent;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    background: var(--secondary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    margin-bottom: 30px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-upload {
    margin-bottom: 20px;
    position: relative;
}
.profile-upload .profile_img_cnt{
    width: 120px;
    height: 120px;
    border-radius: 100%;
    overflow: hidden;
    border: 3px solid var(--primary);
    position: relative;
}

.profile-upload .profile_img_cnt img {
    width: 100%;
    height:100% ;    
    
    object-fit: cover;
}
.profile-upload .profile_img_cnt .overlay_btn{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    border: none;
    outline: none;
    color: white;
    background-color: rgba(0, 0, 0, 0.767);
    position: absolute;
    top: 0%;
    left: 0%;
    font-weight: bold;
    font-family: monospace;
    opacity: 0;
}
.profile-upload .profile_img_cnt:hover .overlay_btn{
    opacity: 1;
}
.profile-upload .profile_img_cnt .overlay_btn i{
    font-size: 30px;
}

.profile-upload .edit_pen_btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 100%;
    cursor: pointer;
    position: absolute;
    z-index: 4;
    font-size: 80%;
    bottom: 9%;
    right: 0;
    transition: var(--transition);
}



/* #username {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 15px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--background);
    color: var(--text);
}

#gender {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--background);
    color: var(--text);
    cursor: pointer;
} */

.gradient-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    width: 100%;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
}

.theme-toggle button {
    background: var(--secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
}

.theme-toggle button:hover {
    transform: rotate(180deg);
    background: var(--primary);
    color: white;
}

/* Root Variables */
:root {
    --primary: #7c3aed;
    --secondary: #1f2937;
    --background: #111827;
    --text: #f3f4f6;
    --accent: #4f46e5;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --gradient: linear-gradient(45deg, #7c3aed, #4f46e5);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #7c3aed;
    --secondary: #1f2937;
    --background: #111827;
    --text: #f3f4f6;
}

/* Light Theme */
[data-theme="light"] {
    --primary: #4f46e5;
    --secondary: #f3f4f6;
    --background: #ffffff;
    --text: #1f2937;
}

/* Chat Area Instagram Style */
.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #00000000;
}

.chat-header {
    padding: 16px;
    background: #26262600;
    border-bottom: 1px solid #363636;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.partner-info .prtnr_img {
    width: 40px;
    height: 40px;
    border-radius: 100%;
    border: 2px solid #8e8e8e;
    overflow: hidden;
}
.partner-info .prtnr_img img{
    width: 100%;
    height: auto;

}
.partner-details{
   
    display: flex;
    align-items: center;
    text-transform: capitalize;
}
.partner-details h3 {
    color: rgba(0, 0, 0, 0.849);
    font-size: 19px;
    font-weight: 600;
    text-transform: capitalize;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 63%;
}

.gender-badge {
    
    color: blueviolet;
    font-weight: bold;
    padding: 0px 10px;
    font-style: italic;
    font-size: 16px;
    font-weight: 700;
    background-color: transparent;
    
    width: fit-content;
}
.disconnect-btn{
    padding: 5px 20px;
    background-color: rgba(255, 0, 0, 0);
    cursor: pointer;
    color: red;
    border: 1px solid red;
    border-radius: 20px;
}
.disconnect-btn:hover{
    background-color: rgb(228, 76, 76);
    color: white;
}
.messages-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.message {
    max-width: 65%;
    margin: 8px 0;
    position: relative;
}

.message-content {
    padding: 12px 16px;
    border-radius: 22px;
    font-size: 14px;
    line-height: 1.4;
}

.message.sent .message-content {
    background: var(--primary);
    color: white;
    margin-left: auto;
    
    border-bottom-right-radius: 4px;
}
.message.sent{
    align-self: flex-end;
}

.message.received .message-content {
    background:#0095f6;
    color: rgb(255, 255, 255);
    margin-right: auto;
    
    border-bottom-left-radius: 4px;
}
.message.received{
    align-self: flex-start;
}
.message-time {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 4px;
    display: block;
}

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

.chat-input-area {
    padding: 16px;
   
    border-top: 1px solid #363636;
}





.message-input textarea::placeholder {
    color: #8e8e8e;
}

/* Stats Section Update */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 0px;
   background-color: transparent;
   padding: 5px;
   border-radius: 10px;
   border-top: 2px solid rgba(102, 106, 111, 0.699);
}
.stats-section h4{
    color: rgb(37, 35, 35);
    padding: 10px ;
}
.stat-item {
    color: rgb(102, 106, 111);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-weight: bold;
    transform: scale(1);
    background: rgba(66, 57, 245, 0);
background: linear-gradient(135deg, rgba(66, 57, 245, 0) 0%, rgba(232, 87, 213, 0) 100%);
}
.stat-item:hover{
    background: rgb(67,57,245);
background: linear-gradient(135deg, rgba(67,57,245,1) 0%, rgba(232,87,212,1) 100%);
    padding: 10px 10px;
    color: white;
    
    
}
.stat-item div{
    display: flex;
}
.stat-item i{
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-item:hover i{
    color: white;
}
.stat-item span{
    color: rgb(102, 106, 111);
}
.stat-item:hover span{
    color: white;
}
/* Chat Area Styles */
.main-container {
    display: flex;
    max-width: 1200px;
    height: calc(100vh - 40px);
    margin: 20px auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--secondary);
}

.sidebar {
    width:400px;
    height: 100%;
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
    background-color: rgb(255, 255, 254);
    border-top-right-radius: 1vw;
    border-bottom-right-radius: 1vw;
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--border-radius);
    background: var(--secondary);
    position: relative;
    overflow: hidden;
}

.user-profile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05));
}

.user-profile img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-container h3 {
    font-size: 1.2em;
    color: var(--text);
    margin-bottom: 10px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: var(--secondary);
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.partner-profile {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.gender-tag {
    background: var(--primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

/* Loading Animation */
.loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, transparent 60%);
    animation: rotate 1s linear infinite;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: var(--bg);
    border-radius: 50%;
}

.loading-animation i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: var(--primary);
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Empty State Styles */
.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background-color: transparent;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.empty-state-content i {
    font-size: 4em;
    color: var(--primary);
    margin-bottom: 20px;
}
.empty-state-content #img_rbt_empt{
    min-width: 100px;
    max-width: 13vw;
    height: auto;
}

.empty-state-content h2 {
    margin-bottom: 10px;
    color: rgba(0, 0, 0, 0.863);
}

.empty-state-content p {
    color: rgba(255, 255, 255, 0.6);
    color: rgba(0, 0, 0, 0.863);
}

.empty-state-content .gradient-btn {
    padding: 15px 40px;
    font-size: 1.2em;
    margin-top: 20px;
}

/* Chat Area Styles */
.chat-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid blueviolet;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
}

.partner-info {
    
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 60%;
}

.partner-avatar {
    position: relative;
    width: 45px;
    height: 45px;
}

.partner-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}



.chat-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
}

/* Message Input Styles */
.chat-input-area {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    
    border-top: 1px solid rgb(113, 90, 243);
    position: relative;
    backdrop-filter: blur(10px);
}

.attach-btn {
    background: var(--secondary);
    border: none;
    color: var(--primary);
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(45deg);
}

.message-input {
    flex: 1;
    position: relative;
}

.message-input textarea {
    width: 100%;
    padding: 12px 20px;
    background: var(--secondary);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text);
    font-size: 16px;
    transition: var(--transition);
    resize: none;
    height: 45px; /* Default height */
    min-height: 45px;
    overflow-y: hidden;
    line-height: 1.5;
}

.message-input textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Scrollbar for textarea when content is too long */
.message-input textarea::-webkit-scrollbar {
    width: 6px;
}

.message-input textarea::-webkit-scrollbar-track {
    background: transparent;
}

.message-input textarea::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.send-btn {
    background: var(--gradient);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Attachment Menu Styles */
.attachment-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--secondary);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 10px;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.attachment-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: var(--border-radius);
}

.attachment-option:hover {
    background: var(--accent);
}

.attachment-option i {
    color: var(--primary);
    font-size: 1.2em;
}

/* Preference Select Update */
.preference-select {
   
    width: 100%;
    max-width: 300px;
    border: 2px solid blueviolet;
    padding:0 10px;
    border-radius: 10px;
}
.preference-select:hover{
    box-shadow: 0px 0px 3px blueviolet;
}
.preference-select .custom-select {
    height: 50px;
    font-size: 1.1em;
    text-align: center;
   
    background-color: transparent;
    color: blueviolet;
    font-weight: 500;
    border: none;
    outline: none;
}

.preference-select i {
    font-size: 1.4em;
    left: 20px;
}

#startRandomChat {
    min-width: 200px;
    padding: 15px 30px;
    font-size: 1.1em;
}

#startRandomChat:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Main Chat Screen Styles */
.app-container {
    display: flex;
    gap: 0px;
    width: 100%;
    height:100%;
    background-color: #f1f4ff; 
   
}

/* Left Sidebar Styles */
.left-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    
}

.user-info {
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    position: relative;
    width: 60px;
    height: 60px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.user-details h3 {
    font-size: 1.1em;
    margin-bottom: 4px;
}

.user-details span {
    font-size: 0.9em;
    color: var(--primary);
}

/* Search Section Styles */
.search-section {
    padding: 20px;
    border-radius: var(--border-radius);
}

.search-header {
    margin-bottom: 20px;
}

.search-header h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.6);
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    position: relative;
}

.filter-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.custom-select {
    width: 100%;
    padding: 12px 0px;
    background: var(--secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text);
    font-size: 0.9em;
    cursor: pointer;
}

.search-btn {
    background: var(--gradient);
    color: white;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
}

/* Chat Section Styles */
.chat-section {
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.sdbarbtn{
    width: 100%;

    position: absolute;
    left: 0%;
    height: 20px;
}
.sdbarbtn .cls_opn_side_bar_btn{
    width: 40px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    border-top-right-radius: 100%;
    border-bottom-right-radius: 100%;
    background-color: white;
    position: absolute;
    right: -40px;
    z-index: 99;
    font-size: 18px;
    display: none;

    
}
.sdbarbtn .cls_opn_side_bar_btn:hover{
    background-color: rgb(245, 245, 245);
    color: blueviolet;
}
/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        
        top: 0%;
        left: 0%;
        position: fixed;
        z-index: 99;
        transform: translateX(-100%);
    }
    .sdbarbtn .cls_opn_side_bar_btn{
        display: flex;
    }

    .user-profile-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }

    .profile-header {
        width: 80px;
        height: 80px;
        margin: 0;
    }

    
}

.screen {
    display: none;
    height: 100vh;
}

.screen.active {
    display: flex;
}

.screen.hidden {
    display: none !important;
}

/* Search Loader Styles */
.waiting-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.836);
    z-index: 100;
    backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
}

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

.search-loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary);
    opacity: 0;

    animation: pulse 2s ease-out infinite;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon i {
    color: white;
    font-size: 24px;
    animation: bounce 1s infinite;
}

.search-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-text h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.search-text p {
    color:rgb(0, 0, 0) ;
    opacity: 0.9;

}

@keyframes pulse {
    0% {

        transform: scale(0.5) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5) rotate(-360deg);
        opacity: 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Cancel Search Button */
.cancel-btn {
    margin-top: 30px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgb(238, 89, 89);
    border-radius: var(--border-radius);
    color: rgb(238, 89, 89);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-weight: 500;
    letter-spacing: 0.5px;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cancel-btn:hover {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff4444;
    transform: scale(1.05);
}

.cancel-btn i {
    font-size: 16px;
}

/* Message Input Updates */
.message-input textarea {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    color: rgb(13, 13, 49);
    font-size: 16px;
    transition: var(--transition);
    resize: none;
    height: 45px; /* Default height */
    min-height: 45px;
    overflow-y: hidden;
    line-height: 1.5;
    max-height: 72px;
    font-weight: 600;
    background-color: #eaecf5;
}

.message-input textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Scrollbar for textarea when content is too long */
.message-input textarea::-webkit-scrollbar {
    width: 6px;
}

.message-input textarea::-webkit-scrollbar-track {
    background: transparent;
}

.message-input textarea::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* GIF Selector Styles */
.gif-selector {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 350px;
    max-height: 400px;
    background: rgb(234, 236, 245);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    padding: 15px;
    gap: 15px;
}

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

.gif-selector.hidden {
    display: none;
}

.gif-search {
    padding: 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
   
}

.gif-search input {
    width: 100%;
    padding:10px 20px;
    border: none;
    border-radius: var(--border-radius);
    
    color: rgba(0, 0, 0, 0.432);
    font-size: 14px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gif-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

.gif-search i {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.gif-grid{
    width: 100%;
    height: 100%;
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    grid-auto-rows: 95px;
    grid-auto-flow: dense;
    overflow: scroll;
}
.gif-grid::-webkit-scrollbar{
    display: none;
}
.gif-grid .wide{
    grid-column: span 2;
}
.gif-grid .tall{
    grid-row: span 2;
}
.gif-grid .big{
    grid-column: span 2;
    grid-row: span 2;
}

.gif-item{
    display: flex;
    justify-content: center;
    align-items: center;
    
}
.gif-item .gif-img-container{
    width: auto;
}
.gif-img-container img{
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    display: inline-block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}





.gif-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--primary);
    gap: 10px;
}

.gif-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gif-no-results, .gif-error {
    padding: 20px;
    text-align: center;
    color: var(--text);
    opacity: 0.7;
}

/* Media Message Styles */
.message img, .message video {
    max-width: 100%;
    border-radius: 12px;
    margin: 5px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: block;
    background: var(--accent);
    min-width: 200px;
    min-height: 150px;
}

.message img:hover, .message video:hover {
    transform: scale(1.02);
}

/* Input Actions Update */
.input-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
}

.action-btn:hover {
    background: blue;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Attachment Options Styles */
.attachment-wrapper {
    position: relative;
}

.attachment-options {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
    margin-bottom: 10px;
    background: transparent;
    border-radius: var(--border-radius);
    
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    
}

.attachment-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.attachment-option {
    background: var(--accent);
    border: none;
    color: var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attachment-option:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

#attachmentButton {
    transition: transform 0.3s ease;
    color: white;
}

#attachmentButton.active {
    transform: rotate(45deg);
    background: var(--primary);
    color: white;
}
.attachment-option i{
    font-size: 16px;
    color: white;
}

/* Add loading spinner styles */
.loading-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner i {
    font-size: 1.2em;
}

/* Video controls styling */
.message video::-webkit-media-controls {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
}

.message video::-webkit-media-controls-panel {
    padding: 5px;
}

/* Media Modal Styles */
.media-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-modal.show {
    display: flex;
    opacity: 1;
}

.media-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: auto;
    background: transparent;
}

.media-modal .modal-header {
    position: absolute;
    top: -40px;
    right: 0;
    z-index: 1;
}

.media-modal .close-modal {
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.media-modal .close-modal:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.media-modal .modal-body {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-media.show {
    transform: scale(1);
    opacity: 1;
}

.modal-media.hidden {
    display: none;
}

/* Video specific styles */
#modalVideo {
    background: black;
    width: 100%;
}

/* Update message media styles */
.message img, .message video {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message img:hover, .message video:hover {
    transform: scale(1.02);
}

/* Add User Profile Styles */
.user-profile {
    background: var(--secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.user-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.user-profile .profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    background: var(--accent);
}

.user-profile .profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile .user-info {
    flex: 1;
}

.user-profile .user-info h3 {
    font-size: 1.4em;
    margin-bottom: 5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--primary),
        transparent
    );
    margin: 10px 0 30px;
    opacity: 0.3;
}

/* GIF selector error states */
.gif-no-results, .gif-error {
    padding: 20px;
    text-align: center;
    color: var(--text);
    opacity: 0.7;
}

.gif-loading {
    padding: 20px;
    text-align: center;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gif-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Sidebar Styles */
.user-profile-card {
    width: 100%;
    display: flex;
    align-items: center;
flex-direction: column;
    background-color: transparent;
    text-align: center;
    gap: 10px;
}

.profile-header {
    position: relative;
    width: 120px;
    height: 120px;
   
}

.profile-header img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.online-indicator {
    position: absolute;
    bottom: 13%;
    right: 5px;
    width: 15px;
    height: 15px;
    background: yellow;
    border-radius: 50%;
    border: 2px solid var(--secondary);
}

.profile-info {
    display: flex;align-items: center;
    max-width: 100%;
    
    
}
.profile-info p {
    font-weight: bold;
    font-size: 18px;
    text-transform: capitalize;
    color: #252424;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: -webkit-fill-available;
}
.profile-info span{
    font-style: italic;
    color: #8ad09a;
    font-weight: bold;
    padding: 0px 10px;
    font-size: 14px;
    background-color: transparent;
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.568);
    width: fit-content;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--gradient);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}
@media (max-width:850px){
    .chat-header{
        padding: 15px 20px 15px 50px;
    }
}
@media (max-width:450px) {
    .sidebar{
        width: calc(100vw - 50px);
    }
}