/*==============================================
IRC Chat Galaxy Interface - May the Force be with your conversations
Version: 2.0 - Echoing through the digital cosmos
Author: The Jedi Code Council
================================================*/

/*TABLE OF CONTENTS*/
/*
1. IRC Chat Container & Main Structure
2. IRC Sidebar & Navigation
3. IRC Channels & Users Lists
4. IRC Chat Panel & Messages
5. IRC Input Controls
6. IRC Status & Connection States
7. IRC Responsive Design
8. IRC Animations & Effects
9. IRC Custom Scrollbars
10. IRC Accessibility & Focus States
*/

/*==============================================
1. IRC Chat Container & Main Structure
================================================*/
.irc-chat-container {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f3a 50%, #2c3e50 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.irc-chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #2ecc71);
    animation: forceFlow 3s linear infinite;
}

.irc-chat-container h2 {
    color: #ecf0f1;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
    margin-bottom: 30px;
    text-align: center;
}

.irc-main-panel {
    height: 650px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow:
            0 15px 35px rgba(0, 0, 0, 0.3),
            inset 0 0 30px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

/*==============================================
2. IRC Sidebar & Navigation
================================================*/
.irc-sidebar {
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 50%, #34495e 100%);
    border-right: 3px solid transparent;
    border-image: linear-gradient(180deg, #3498db, #2980b9) 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.irc-sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, #3498db, transparent);
}

.irc-section {
    flex: 1;
    padding: 20px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
}

.irc-section:hover {
    background: rgba(52, 152, 219, 0.05);
}

.irc-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(236, 240, 241, 0.1);
}

.section-header h5 {
    color: #ecf0f1;
    font-weight: 600;
    font-size: 1.1em;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.section-header i {
    margin-right: 8px;
    color: #3498db;
}

/*==============================================
3. IRC Channels & Users Lists
================================================*/
.channels-list, .users-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}

.channel-item {
    padding: 12px 15px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #bdc3c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.channel-item::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent);
    transition: left 0.5s ease;
}

.channel-item:hover::before {
    left: 100%;
}

.channel-item:hover {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    transform: translateX(8px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.channel-item.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateX(5px);
    box-shadow:
            0 8px 25px rgba(52, 152, 219, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.channel-item.active::before {
    display: none;
}

.user-count {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 0.75em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    min-width: 25px;
    text-align: center;
}

.user-total {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.8em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.user-item {
    padding: 8px 15px;
    margin: 3px 0;
    border-radius: 8px;
    color: #95a5a6;
    font-size: 0.9em;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.user-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #2ecc71;
    transition: height 0.3s ease;
}

.user-item:hover {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    transform: translateX(5px);
}

.user-item:hover::before {
    height: 60%;
}

.user-item.user-op {
    color: #f39c12;
    font-weight: 600;
}

.user-item.user-op::before {
    background: #f39c12;
}

.user-item.user-voice {
    color: #9b59b6;
    font-weight: 500;
}

.user-item.user-voice::before {
    background: #9b59b6;
}

/*==============================================
4. IRC Chat Panel & Messages
================================================*/
.irc-chat-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #4a6741 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #3498db;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    animation: headerScan 4s ease-in-out infinite;
}

.chat-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.3em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-status {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 500;
}

.status-connected {
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.status-disconnected {
    color: #e74c3c;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.status-connecting {
    color: #f39c12;
    animation: statusPulse 2s ease-in-out infinite;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.message-message {
    margin: 8px 0;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    border-left: 4px solid transparent;
    backdrop-filter: blur(5px);
}

.message-message:hover {
    background: rgba(52, 152, 219, 0.08);
    border-left-color: #3498db;
    transform: translateX(5px);
    box-shadow: 0 3px 15px rgba(52, 152, 219, 0.1);
}

.message-user {
    font-weight: 600;
    color: #2980b9;
    text-shadow: 0 1px 2px rgba(41, 128, 185, 0.2);
}

.message-timestamp {
    color: #7f8c8d;
    font-size: 0.8em;
    margin-right: 10px;
    font-family: 'Courier New', monospace;
}

.message-content {
    color: #2c3e50;
    margin-left: 5px;
}

.system-message {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
    font-style: italic;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.system-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: systemMessageGlow 3s ease-in-out infinite;
}

.error-message {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 8px 0;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    border-left: 4px solid #922b21;
}

.notice-message {
    background: linear-gradient(135deg, #f39c12, #d68910);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 8px 0;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
    border-left: 4px solid #b7950b;
}

/*==============================================
5. IRC Input Controls
================================================*/
.chat-input-container {
    padding: 20px 25px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-top: 2px solid rgba(52, 152, 219, 0.3);
    position: relative;
}

.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
}

.chat-input-container .input-group {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 30px;
    overflow: hidden;
    background: white;
}

.chat-input-container .input-group-text {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 18px;
    font-size: 1.1em;
}

.chat-input-container .form-control {
    border: none;
    padding: 15px 20px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.chat-input-container .form-control:focus {
    box-shadow: none;
    background: white;
    outline: none;
}

.chat-input-container .form-control::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.chat-input-container .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    padding: 15px 25px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chat-input-container .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.chat-input-container .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.chat-input-container .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.chat-input-container .btn-primary:active {
    transform: translateY(-1px);
}

/*==============================================
6. IRC Status & Connection States
================================================*/
@keyframes forceFlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes headerScan {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    }
    50% {
        opacity: 0.6;
        text-shadow: 0 0 20px rgba(243, 156, 18, 0.8);
    }
}

@keyframes systemMessageGlow {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/*==============================================
7. IRC Responsive Design
================================================*/
@media (max-width: 992px) {
    .irc-main-panel {
        height: auto;
        min-height: 500px;
    }

    .irc-chat-container {
        padding: 20px;
        margin: 20px 0;
    }
}

@media (max-width: 768px) {
    .irc-main-panel {
        flex-direction: column;
        height: auto;
    }

    .irc-sidebar {
        height: 350px;
        border-right: none;
        border-bottom: 3px solid #3498db;
        flex-direction: row;
    }

    .irc-section {
        flex: 1;
        height: auto;
        padding: 15px;
    }

    .channels-list, .users-list {
        max-height: 200px;
    }

    .chat-input-container .input-group {
        flex-direction: column;
        border-radius: 15px;
    }

    .chat-input-container .form-control {
        margin-bottom: 10px;
        border-radius: 15px !important;
    }

    .chat-input-container .btn-primary {
        border-radius: 15px;
        width: 100%;
    }

    .chat-input-container .input-group-text {
        border-radius: 15px 15px 0 0;
    }
}

/*==============================================
8. IRC Custom Scrollbars - The elegant path of the Force
================================================*/
.channels-list::-webkit-scrollbar,
.users-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.channels-list::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 5px;
}

.channels-list::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3498db, #2980b9);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.channels-list::-webkit-scrollbar-thumb:hover,
.users-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2980b9, #21618c);
}

/*==============================================
9. IRC Accessibility & Focus States
================================================*/
.channel-item:focus,
.user-item:focus,
.chat-input-container .form-control:focus,
.chat-input-container .btn-primary:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.channel-item:focus-visible,
.user-item:focus-visible {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

/*==============================================
10. IRC Special Effects - The Force flows through all
================================================*/
.irc-chat-container:hover {
    box-shadow:
            0 25px 70px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 50px rgba(52, 152, 219, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

/* Styles for external IRC messages - transmissions from distant worlds */
.irc-external-message {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.05));
    border-left: 4px solid #2ecc71;
    margin: 10px 0;
    position: relative;
}

.irc-external-message::before {
    content: '📡';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #2ecc71;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.local-message {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
    border-left: 4px solid #3498db;
}

.local-message::before {
    content: '💬';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message-channel {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.message-source {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .irc-chat-container {
        border: 2px solid #3498db;
    }

    .channel-item.active,
    .system-message,
    .error-message,
    .notice-message {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support - respect the user's preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/*==============================================
End of IRC Chat Galaxy Styles
May your conversations flow like the Force itself
================================================*/