/* Chat System Styles */

.chat-section {
    padding: 0;
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
}

.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 80px);
    background: white;
    position: relative;
}

/* Sidebar */
.chat-sidebar {
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #34495e;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.btn-new-message {
    background: #59c9b3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-new-message:hover {
    background: #4db8a2;
    transform: translateY(-1px);
}

.notification-settings {
    padding: 15px 20px;
    border-bottom: 1px solid #34495e;
}

.btn-enable-notifications {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-enable-notifications:hover {
    background: #2980b9;
}

.btn-enable-notifications.enabled {
    background: #27ae60;
}

.channel-section, .dm-section {
    padding: 20px;
}

.channel-section h3, .dm-section h3 {
    font-size: 0.85rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.channel-list, .dm-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.channel-item, .dm-item {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.channel-item:hover, .dm-item:hover {
    background: #34495e;
}

.channel-item.active, .dm-item.active {
    background: #59c9b3;
    color: white;
    font-weight: 600;
}

.channel-name, .dm-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.unread-badge {
    background: #e74c3c;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.offline-indicator {
    width: 8px;
    height: 8px;
    background: #95a5a6;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

/* Chat Main Area */
.chat-main {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.chat-info h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.chat-info p {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9rem;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #ecf0f1;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    background: #f8f9fa;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #95a5a6;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 5px;
}

.message-author {
    font-weight: 600;
    color: #2c3e50;
}

.message-time {
    font-size: 0.8rem;
    color: #95a5a6;
}

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #ecf0f1;
    line-height: 1.5;
    color: #2c3e50;
}

.message-media {
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
}

.message-media img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: all 0.3s;
}

.message-media img:hover {
    opacity: 0.9;
}

.message-media video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.message.own {
    flex-direction: row-reverse;
}

.message.own .message-avatar {
    margin-right: 0;
    margin-left: 12px;
    background: linear-gradient(135deg, #59c9b3 0%, #4db8a2 100%);
}

.message.own .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message.own .message-text {
    background: #59c9b3;
    color: white;
    border-color: #59c9b3;
}

.message.own .message-media {
    border: 2px solid #59c9b3;
}

.system-message {
    text-align: center;
    color: #95a5a6;
    font-size: 0.85rem;
    font-style: italic;
    margin: 20px 0;
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #95a5a6;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 2px solid #ecf0f1;
    background: white;
}

.chat-input {
    padding: 20px 30px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ecf0f1;
    border-radius: 25px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.chat-input input[type="text"]:focus {
    outline: none;
    border-color: #59c9b3;
}

.btn-attach {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-attach:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.btn-send {
    background: #59c9b3;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-send:hover {
    background: #4db8a2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(89, 201, 179, 0.3);
}

/* Media Preview */
.media-preview {
    padding: 10px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.media-preview-content {
    position: relative;
    display: inline-block;
}

.btn-remove-media {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-remove-media:hover {
    background: #c0392b;
}

/* Info Panel */
.chat-info-panel {
    width: 300px;
    background: #f8f9fa;
    border-left: 1px solid #ecf0f1;
    display: none;
    flex-direction: column;
}

.chat-info-panel.active {
    display: flex;
}

.info-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-header h3 {
    margin: 0;
    color: #2c3e50;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
}

.info-content {
    padding: 20px;
    overflow-y: auto;
}

.info-section {
    margin-bottom: 30px;
}

.info-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.member-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
}

.member-status {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 5px 10px;
    transition: all 0.2s;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 5px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.btn-clear-all {
    background: none;
    border: none;
    color: #59c9b3;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e3f2fd;
}

.notification-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.notification-message {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 0.8rem;
    color: #95a5a6;
}

.empty-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #95a5a6;
}

/* Modal Overrides for Chat */
.modal textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.modal textarea:focus {
    outline: none;
    border-color: #59c9b3;
}

/* Responsive */
@media (max-width: 1024px) {
    .chat-container {
        grid-template-columns: 250px 1fr;
    }

    .chat-info-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
    }

    .chat-sidebar.mobile-visible {
        display: flex;
        position: absolute;
        width: 80%;
        height: 100%;
        z-index: 100;
    }

    .chat-info-panel {
        position: absolute;
        right: 0;
        height: 100%;
        z-index: 99;
    }

    .notification-panel {
        width: 90%;
        right: 5%;
    }

    .message-content {
        max-width: 85%;
    }
}
