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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f1419;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стили для экрана входа */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 12px;
}

.logo i {
    color: #e84393;
    animation: pulse 2s infinite;
}

.subtitle {
    color: #636e72;
    font-size: 14px;
    font-weight: 500;
}

.login-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2d3436;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 15px;
}

.input-group label i {
    color: #6c5ce7;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #636e72;
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #74b9ff;
}

.hint i {
    color: #74b9ff;
}

.user-examples {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.example {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.example:hover {
    transform: translateX(5px);
}

.example.admin {
    background: linear-gradient(135deg, #74b9ff20, #0984e320);
    border-left: 4px solid #0984e3;
    color: #2d3436;
}

.example.admin i {
    color: #0984e3;
}

.example.marhabo {
    background: linear-gradient(135deg, #fd79a820, #e8439320);
    border-left: 4px solid #e84393;
    color: #2d3436;
}

.example.marhabo i {
    color: #e84393;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dfe6e9;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #636e72;
}

.connection-status i {
    font-size: 10px;
}

.connection-status i.fa-circle {
    color: #00b894;
    animation: blink 1.5s infinite;
}

/* Стили для экрана чата */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0f1419;
    color: white;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn.small {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.chat-title i {
    color: #e84393;
}

.chat-subtitle {
    font-size: 13px;
    color: #aaa;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-only {
    display: none;
}

.chat-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    position: relative;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Стили сообщений */
.message {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    position: relative;
    animation: messageAppear 0.3s ease;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.admin {
    align-self: flex-end;
    background: linear-gradient(135deg, #0088cc, #00a8ff);
    border-bottom-right-radius: 4px;
}

.message.marhabo {
    align-self: flex-start;
    background: linear-gradient(135deg, #e84393, #fd79a8);
    border-bottom-left-radius: 4px;
}

.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 13px;
    font-style: italic;
    max-width: 90%;
    text-align: center;
    padding: 10px 16px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.message-sender {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.message-text {
    font-size: 15px;
    line-height: 1.5;
}

.emoji {
    font-size: 20px;
    margin: 0 2px;
    vertical-align: middle;
}

/* Админ панель */
.admin-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: rgba(30, 35, 40, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    overflow-y: auto;
}

.admin-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #00a8ff;
}

.info-item h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #aaa;
    margin-bottom: 10px;
}

.info-item p {
    font-size: 16px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.status-online {
    color: #00b894;
    font-weight: 600;
}

.status-offline {
    color: #d63031;
    font-weight: 600;
}

/* Панель ввода */
.chat-footer {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container {
    position: relative;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 4px 4px 4px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 15px;
    padding: 14px 0;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-btn {
    background: linear-gradient(135deg, #0088cc, #00a8ff);
    border: none;
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

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

/* Панель эмодзи */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(40, 45, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.emoji-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

.emoji-category {
    margin-bottom: 16px;
}

.emoji-category span {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.emoji-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 24px;
    cursor: pointer;
}

.emoji-list span {
    transition: transform 0.2s;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
}

.emoji-list span:hover {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.1);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(30, 35, 40, 0.95);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .login-container {
        margin: 20px;
        padding: 30px 24px;
    }
    
    .admin-panel {
        width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 85%;
    }
}

/* Полоса прокрутки */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
