﻿:root {
    --vh: 1vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

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

@keyframes slideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes buttonHover {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-2px) scale(1.02);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
}

body.auth-page {
    background: linear-gradient(-45deg, #2c3e50, #34495e, #4a5568, #1a202c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

body.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(45, 55, 72, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(74, 85, 104, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(113, 128, 150, 0.3) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    z-index: -1;
}

body.chat-page {
    background: #1a1a1a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: float 6s ease-in-out infinite;
}

.container.fullscreen {
    max-width: 100%;
    margin: 0;
    padding: 0;
    animation: none;
    height: 100vh;
}

.auth-form {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    margin: 50px auto;
    border: 1px solid rgba(113, 128, 150, 0.2);
    transition: all 0.3s ease;
}

.auth-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #e2e8f0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #cbd5e0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(45, 55, 72, 0.8);
    color: #e2e8f0;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border: 2px solid #667eea;
    background: rgba(45, 55, 72, 1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn .ripple-effect {
    position: absolute;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.btn-secondary {
    background: linear-gradient(45deg, #4a5568, #2d3748);
}

.btn-secondary:hover {
    box-shadow: 0 10px 25px rgba(74, 85, 104, 0.4);
}

.error {
    color: #ff4757;
    text-align: center;
    margin-top: 10px;
    animation: pulse 1s ease-in-out;
}

.success {
    color: #2ed573;
    text-align: center;
    margin-top: 10px;
    animation: pulse 1s ease-in-out;
}

.chat-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    overflow: hidden;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.sidebar {
    width: 340px;
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(45, 55, 72, 0.8));
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(113, 128, 150, 0.3);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.user-info {
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.user-info h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
}

.friends-tab-container {
    display: flex;
    background: rgba(26, 32, 44, 0.5);
    border-bottom: 1px solid rgba(113, 128, 150, 0.3);
}

.friends-tab {
    flex: 1;
    padding: 15px 10px;
    background: transparent;
    color: #cbd5e0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.friends-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.friends-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-1px);
}

.friends-tab:hover::before {
    width: 100%;
}

.friends-tab.active {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.friends-tab.active::before {
    width: 100%;
}

.friends-tab .ripple-effect {
    position: absolute;
    border-radius: 0;
    background-color: rgba(102, 126, 234, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.add-friend-section {
    padding: 15px;
    border-bottom: 1px solid rgba(113, 128, 150, 0.3);
    display: flex;
    gap: 10px;
}

.add-friend-input {
    flex: 1;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(45, 55, 72, 0.8);
    color: #e2e8f0;
    transition: all 0.3s ease;
    font-size: 14px;
}

.add-friend-input::placeholder {
    color: #a0aec0;
}

.add-friend-input:focus {
    outline: none;
    border: 2px solid #667eea;
    background: rgba(45, 55, 72, 1);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.add-friend-btn {
    padding: 10px 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.add-friend-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.add-friend-btn:hover::before {
    left: 100%;
}

.add-friend-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.add-friend-btn .ripple-effect {
    position: absolute;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.friend-status {
    padding: 10px 15px;
    margin: 0 15px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

.friend-status.success {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.friend-status.error {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.friends-content {
    flex: 1;
    overflow: hidden;
    display: none;
}

.friends-content.active {
    display: flex;
    flex-direction: column;
}

.friends-list-container {
    flex: 1;
    overflow-y: auto;
}

.friend-item {
    padding: 15px;
    border-bottom: 1px solid rgba(113, 128, 150, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: #e2e8f0;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.friend-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    z-index: 0;
}

.friend-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
    color: #667eea;
}

.friend-item:hover::before {
    width: 4px;
}

.friend-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateX(5px);
}

.friend-item .friend-name {
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.friend-item .ripple-effect {
    position: absolute;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.2);
    animation: ripple 0.6s linear;
    pointer-events: none;
    z-index: 0;
}

.friend-request-item {
    padding: 15px;
    border-bottom: 1px solid rgba(113, 128, 150, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    background: rgba(45, 55, 72, 0.3);
    margin: 5px;
    border-radius: 10px;
}

.friend-request-item:hover {
    background: rgba(45, 55, 72, 0.5);
    transform: translateY(-1px);
}

.friend-request-name {
    color: #e2e8f0;
    font-weight: 500;
}

.friend-request-buttons {
    display: flex;
    gap: 8px;
}

.accept-btn, .reject-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.accept-btn {
    background: linear-gradient(45deg, #2ed573, #1dd1a1);
    color: white;
}

.accept-btn:hover {
    background: linear-gradient(45deg, #1dd1a1, #00d2d3);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.4);
}

.reject-btn {
    background: linear-gradient(45deg, #ff4757, #d63031);
    color: white;
}

.reject-btn:hover {
    background: linear-gradient(45deg, #d63031, #b10000);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.accept-btn .ripple-effect,
.reject-btn .ripple-effect {
    position: absolute;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.no-friends {
    padding: 20px;
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(45, 55, 72, 0.8));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(113, 128, 150, 0.3);
    text-align: center;
    font-weight: 500;
    color: #e2e8f0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
}

.exit-chat-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px;
    background: rgba(255, 71, 87, 0.2);
    backdrop-filter: blur(5px);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    overflow: hidden;
}

.exit-chat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 71, 87, 0.3), transparent);
    transition: left 0.5s;
}

.exit-chat-btn:hover::before {
    left: 100%;
}

.exit-chat-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: translateY(-50%) translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.2);
}

.exit-chat-btn .ripple-effect {
    position: absolute;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.settings-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    padding: 10px;
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(5px);
    color: #e2e8f0;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.settings-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    transition: left 0.5s;
    border-radius: 50%;
}

.settings-btn:hover::before {
    left: 100%;
}

.settings-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: translateY(-50%) translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    animation: glow 2s infinite;
}

.settings-btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.settings-dropdown {
    position: absolute;
    top: 55px;
    right: 15px;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border: 1px solid rgba(113, 128, 150, 0.2);
    min-width: 200px;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
    overflow: hidden;
}

.settings-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(113, 128, 150, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background-clip: padding-box;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    transform: translateX(5px);
    border-radius: 0;
}

.settings-item.logout {
    color: #ff4757;
}

.settings-item.logout:hover {
    background: linear-gradient(90deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 71, 87, 0.05) 100%);
    border-radius: 0;
}

.settings-item.delete {
    color: #ff4757;
}

.settings-item.delete:hover {
    background: linear-gradient(90deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 71, 87, 0.05) 100%);
    border-radius: 0;
}

.settings-item .ripple-effect {
    position: absolute;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.2);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.3), rgba(45, 55, 72, 0.3));
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 70%;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(113, 128, 150, 0.2);
    animation: slideIn 0.3s ease-out;
}

.message:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.message.own {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-left: auto;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.message.own:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.message.other {
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.9), rgba(113, 128, 150, 0.9));
    backdrop-filter: blur(5px);
    color: #e2e8f0;
    border: 1px solid rgba(113, 128, 150, 0.3);
}

.message.other:hover {
    background: linear-gradient(135deg, rgba(74, 85, 104, 1), rgba(113, 128, 150, 1));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.message-dots {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0;
    overflow: hidden;
}

.message:hover .message-dots {
    opacity: 1;
}

.message-dots:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.message-dots .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.message-options {
    position: absolute;
    top: 0px;
    right: 35px;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    border: 1px solid rgba(113, 128, 150, 0.3);
    min-width: 150px;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
    overflow: hidden;
}

.option-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(113, 128, 150, 0.1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.option-item:last-child {
    border-bottom: none;
}

.option-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

.option-item.delete {
    color: #ff4757;
}

.option-item.delete:hover {
    background: rgba(255, 71, 87, 0.1);
}

.option-item .ripple-effect {
    position: absolute;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.2);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.message-input {
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(45, 55, 72, 0.8));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(113, 128, 150, 0.3);
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 15px;
    font-size: 16px;
    background: rgba(45, 55, 72, 0.8);
    color: #e2e8f0;
    transition: all 0.3s ease;
}

.message-input input::placeholder {
    color: #a0aec0;
}

.message-input input:focus {
    outline: none;
    border: 2px solid #667eea;
    background: rgba(45, 55, 72, 1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.message-input button {
    padding: 12px 24px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.message-input button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.message-input button:hover::before {
    left: 100%;
}

.message-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.message-input button .ripple-effect {
    position: absolute;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.password-modal {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    max-width: 450px;
    width: 90%;
    border: 1px solid rgba(113, 128, 150, 0.2);
    animation: slideIn 0.3s ease-out;
    position: relative;
    z-index: 10001;
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
    color: #e2e8f0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 600;
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e0;
    font-weight: 500;
    font-size: 14px;
}

.modal-form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(45, 55, 72, 0.8);
    color: #e2e8f0;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-form-group input:focus {
    outline: none;
    border: 2px solid #667eea;
    background: rgba(45, 55, 72, 1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.modal-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.modal-btn-primary:hover::before {
    left: 100%;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary .ripple-effect {
    position: absolute;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.modal-btn-secondary {
    background: linear-gradient(45deg, #4a5568, #2d3748);
    color: #e2e8f0;
}

.modal-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(74, 85, 104, 0.4);
}

.modal-btn-secondary .ripple-effect {
    position: absolute;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.modal-btn-delete {
    background: rgba(255, 71, 87, 0.5);
    color: #a0a0a0;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-btn-delete.active {
    background: linear-gradient(45deg, #ff4757, #d63031);
    color: white;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.modal-btn-delete.active:hover {
    background: linear-gradient(45deg, #d63031, #b10000);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.modal-btn-delete.active .ripple-effect {
    position: absolute;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.edit-message {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.edit-message input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
}

.edit-buttons {
    display: flex;
    gap: 5px;
}

.save-btn, .cancel-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.save-btn {
    background: linear-gradient(45deg, #2ed573, #1dd1a1);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(45deg, #1dd1a1, #00d2d3);
    transform: scale(1.05);
}

.save-btn .ripple-effect {
    position: absolute;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.cancel-btn {
    background: linear-gradient(45deg, #ff4757, #d63031);
    color: white;
}

.cancel-btn:hover {
    background: linear-gradient(45deg, #d63031, #b10000);
    transform: scale(1.05);
}

.cancel-btn .ripple-effect {
    position: absolute;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.edited-indicator {
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}

.delete-message-modal {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    max-width: 350px;
    width: 90%;
    border: 1px solid rgba(113, 128, 150, 0.2);
    animation: slideIn 0.3s ease-out;
    text-align: center;
}

.delete-message-modal h3 {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.delete-message-modal .modal-btn .ripple-effect {
    position: absolute;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.message-link {
    color: #64b5f6;
    text-decoration: underline;
    text-decoration-color: rgba(100, 181, 246, 0.5);
    transition: all 0.3s ease;
    word-break: break-all;
    display: inline;
}

.message-link:hover {
    color: #90caf9;
    text-decoration-color: #90caf9;
    background: rgba(100, 181, 246, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

.message.own .message-link {
    color: #e1f5fe;
    text-decoration-color: rgba(225, 245, 254, 0.7);
}

.message.own .message-link:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.message-content {
    word-wrap: break-word;
    line-height: 1.4;
}

@media (max-width: 480px) {
    html, body {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
        position: fixed;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .container {
        padding: 0;
        margin: 0;
    }
    
    .container.fullscreen {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        width: 100vw;
        position: fixed;
        top: 0;
        left: 0;
        padding: 0;
        margin: 0;
    }
    
    .chat-container {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        position: relative;
        display: flex;
    }
    
    .sidebar {
        width: 100vw;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        border-right: none;
        border-bottom: none;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        transform: translateX(0);
        max-height: 100vh;
        max-height: calc(var(--vh, 1vh) * 100);
        overflow-y: auto;
        transition: transform 0.3s ease;
        background: linear-gradient(135deg, rgba(26, 32, 44, 0.98), rgba(45, 55, 72, 0.98));
        display: flex;
        flex-direction: column;
    }
    
    .sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .user-info {
        padding: 15px 20px;
        min-height: 60px;
        max-height: 60px;
        position: relative;
        flex-shrink: 0;
    }
    
    .user-info h3 {
        font-size: 16px;
        margin: 0;
    }
    
    .settings-btn {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 40px;
        height: 40px;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    .settings-btn:hover {
        transform: translateY(-1px) scale(1.05);
    }
    
    .settings-dropdown {
        top: 45px;
        right: 0;
        min-width: 180px;
        position: fixed;
        z-index: 10001;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .friends-tab-container {
        flex-shrink: 0;
    }
    
    .add-friend-section {
        padding: 12px;
        flex-shrink: 0;
    }
    
    .friends-content {
        flex: 1;
        min-height: 0;
    }
    
    .friends-list-container {
        height: 100%;
        overflow-y: auto;
    }
    
	.chat-main {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		height: calc(var(--vh, 1vh) * 100);
		transform: translateX(100%);
		transition: transform 0.3s ease;
		z-index: 200;
		background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}
    
    .chat-main.active {
        transform: translateX(0);
    }
    
    .chat-main.selected {
        transform: translateX(0);
    }
    
    .chat-header {
        flex-shrink: 0;
        min-height: 60px;
        max-height: 60px;
    }
    
	.messages-container {
		flex: 1;
		overflow-y: auto;
		padding: 15px;
		min-height: 0;
		background: linear-gradient(135deg, rgba(26, 32, 44, 0.3), rgba(45, 55, 72, 0.3));
	}
    
	.message-input {
		flex-shrink: 0;
		padding: 8px 15px 8px 15px;
		background: linear-gradient(135deg, rgba(26, 32, 44, 0.8), rgba(45, 55, 72, 0.8));
		backdrop-filter: blur(10px);
		border-top: 1px solid rgba(113, 128, 150, 0.3);
		display: flex;
		gap: 10px;
		box-sizing: border-box;
	}
    
	.message-input input {
		padding: 12px;
		font-size: 16px;
		border-radius: 12px;
	}

	.message-input button {
		padding: 12px 18px;
		font-size: 16px;
		border-radius: 12px;
		white-space: nowrap;
	}
    
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(15px);
        z-index: 20000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
    }
    
    .password-modal {
        max-width: 90%;
        margin: 0;
        padding: 25px;
        position: relative;
        z-index: 20001;
        transform: none;
        animation: slideIn 0.3s ease-out;
        width: 100%;
        max-width: 400px;
        max-height: 90vh;
        max-height: calc(calc(var(--vh, 1vh) * 100) * 0.9);
        overflow-y: auto;
    }
    
    .delete-message-modal {
        max-width: 85%;
        padding: 20px;
        position: relative;
        z-index: 20001;
        transform: none;
        animation: slideIn 0.3s ease-out;
        width: 100%;
        max-width: 350px;
        max-height: 90vh;
        max-height: calc(calc(var(--vh, 1vh) * 100) * 0.9);
        overflow-y: auto;
    }
    
    .delete-friend-modal {
        max-width: 85%;
        padding: 20px;
        position: relative;
        z-index: 20001;
        transform: none;
        animation: slideIn 0.3s ease-out;
        width: 100%;
        max-width: 350px;
        max-height: 90vh;
        max-height: calc(calc(var(--vh, 1vh) * 100) * 0.9);
        overflow-y: auto;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }
    
    .modal-btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
    
    .modal-header {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .modal-form-group input {
        padding: 16px;
        font-size: 16px;
    }
    
    .auth-form {
        margin: 20px;
        max-width: none;
        padding: 25px;
    }
    
    .friend-delete-btn {
        opacity: 1;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .refresh-btn {
        display: flex;
        left: 10px;
    }
}

@media (max-width: 768px) {
    .chat-main.selected {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1000;
        transform: translateX(0);
    }
    
    .sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .settings-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 10px !important;
        transform: none !important;
        animation: none !important;
        opacity: 1 !important;
        z-index: 10000 !important;
    }
}

.friend-delete-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 71, 87, 0.2);
    backdrop-filter: blur(5px);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    overflow: hidden;
    z-index: 2;
}

.friend-item:hover .friend-delete-btn {
    opacity: 1;
}

.friend-delete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 71, 87, 0.3), transparent);
    transition: left 0.5s;
    border-radius: 50%;
}

.friend-delete-btn:hover::before {
    left: 100%;
}

.friend-delete-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: translateY(-50%) translateY(-2px) scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.2);
}

.friend-delete-btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.delete-friend-modal {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.95));
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    max-width: 350px;
    width: 90%;
    border: 1px solid rgba(113, 128, 150, 0.2);
    animation: slideIn 0.3s ease-out;
    text-align: center;
}

.delete-friend-modal h3 {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.delete-friend-modal .modal-btn .ripple-effect {
    position: absolute;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@media (max-width: 480px) {
    .friend-delete-btn {
        opacity: 1;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .delete-friend-modal {
        max-width: 85%;
        padding: 20px;
        width: 100%;
        max-width: 350px;
    }
}

.refresh-btn {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    padding: 10px;
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(5px);
    color: #e2e8f0;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 36px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.refresh-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    transition: left 0.5s;
    border-radius: 50%;
}

.refresh-btn:hover::before {
    left: 100%;
}

.refresh-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: translateY(-50%) translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    animation: glow 2s infinite;
}

.refresh-btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@media (max-width: 480px) {
    .refresh-btn {
        display: flex;
        left: 10px;
    }
}