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

body {
    font-family: 'Courier New', monospace;
    background: #050508;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(157, 78, 221, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 0, 110, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: #e0e6ed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 0%, rgba(157, 78, 221, 0.03) 50%, transparent 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #0a0a0f 0%, #111 50%, #0f0f1a 100%);
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.header-left, .header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4ff 0%, #9d4edd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.6));
}

.status {
    color: #9d4edd;
}

#timer {
    color: #ffaa00;
    font-size: 16px;
}

.path {
    color: #00d4ff;
}

.main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 20px;
}

.terminal-section {
    grid-row: 1 / 3;
    background: rgba(15, 15, 25, 0.8);
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    max-height: calc(100vh - 140px);
}

.users-section, .channels-section {
    background: rgba(15, 15, 25, 0.8);
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.terminal-header, .users-header, .channels-header {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(157, 78, 221, 0.08));
    padding: 14px 20px;
    border-bottom: 2px solid rgba(157, 78, 221, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #c9a9dd;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5555; }
.dot.yellow { background: #ffaa00; }
.dot.green { background: #00ff41; }

.terminal-output {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 136, 0.3) rgba(0, 0, 0, 0.2);
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(157, 78, 221, 0.3);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 78, 221, 0.5);
}

.terminal-output p {
    margin-bottom: 5px;
    line-height: 1.4;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-top: 2px solid rgba(157, 78, 221, 0.2);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(157, 78, 221, 0.03) 100%);
}

.prompt {
    color: #9d4edd;
    margin-right: 10px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e6ed;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
}

#terminal-input::placeholder {
    color: rgba(157, 78, 221, 0.3);
}

.users-list, .channels-list {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.user-item, .channel-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.05), rgba(157, 78, 221, 0.02));
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-item:hover, .channel-item:hover {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(157, 78, 221, 0.08));
    border-color: rgba(157, 78, 221, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.2);
}

.channel-item.active {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.25), rgba(157, 78, 221, 0.15));
    border-color: #9d4edd;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.user-status {
    color: #00ff41;
    margin-right: 5px;
}

.message {
    margin-bottom: 8px;
    line-height: 1.4;
}

.message-user {
    color: #00d4ff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.4);
}

.message-text {
    color: #e0e6ed;
}

.message-time {
    color: #888;
    font-size: 12px;
    margin-right: 5px;
}

.channel {
    color: #ffaa00;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid rgba(157, 78, 221, 0.5);
    border-radius: 12px;
    padding: 0;
    min-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(157, 78, 221, 0.3);
    backdrop-filter: blur(20px);
}

.modal-header {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(157, 78, 221, 0.08));
    padding: 18px 24px;
    border-bottom: 2px solid rgba(157, 78, 221, 0.4);
    font-weight: bold;
    color: #c9a9dd;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-login {
    padding: 12px;
    font-size: 14px;
    width: 100%;
}

#auth-form {
    margin-top: 15px;
}

#auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(157, 78, 221, 0.4);
    color: #e0e6ed;
    font-family: 'Courier New', monospace;
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
}

#auth-form input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.btn-submit, .btn-cancel {
    padding: 10px 20px;
    margin-right: 10px;
}

.btn-cancel {
    border-color: #ff0055;
    color: #ff0055;
}

.btn-cancel:hover {
    background: #ff0055;
    color: #0a0e27;
}

.system-msg {
    color: #888;
}

.success {
    color: #00ff41;
}

.error {
    color: #ff0055;
}

.warning {
    color: #ffaa00;
}

.irc-link {
    color: #00d4ff;
    text-decoration: underline;
    cursor: pointer;
}

.irc-link:hover {
    color: #00ff41;
    text-shadow: 0 0 5px #00ff41;
}

button {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.1), rgba(157, 78, 221, 0.05));
    border: 2px solid rgba(157, 78, 221, 0.5);
    color: #c9a9dd;
    padding: 8px 18px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(157, 78, 221, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    background: linear-gradient(135deg, #9d4edd, #00d4ff);
    color: white;
    border-color: #9d4edd;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.6), 0 0 40px rgba(157, 78, 221, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.btn-new {
    border-color: #00d4ff;
    color: #00d4ff;
    padding: 4px 10px;
    font-size: 16px;
}

.btn-new:hover {
    background: #00d4ff;
    color: #0a0e27;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .terminal-section {
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .terminal-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .terminal-header > div {
        width: 100%;
        justify-content: space-between;
    }
    
    #radio-player span {
        font-size: 10px !important;
    }
    
    #radio-player {
        padding: 4px 6px !important;
        gap: 4px !important;
    }
    
    #radio-play {
        font-size: 14px !important;
        width: 20px !important;
        height: 20px !important;
    }
}

.btn-emoji {
    padding: 4px 8px;
    margin-left: 5px;
    font-size: 18px;
    background: rgba(0, 255, 65, 0.1);
}

.emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: #0a0e27;
    border: 2px solid #00ff41;
    border-radius: 8px;
    padding: 10px;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.emoji-item:hover {
    background: rgba(0, 255, 65, 0.2);
    transform: scale(1.2);
}

.gif-grid::-webkit-scrollbar {
    width: 8px;
}

.gif-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.gif-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.gif-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

.history-msg {
    opacity: 0.7;
}

audio {
    width: 100% !important;
    max-width: 300px !important;
    height: 32px !important;
    border-radius: 6px !important;
    filter: invert(1) hue-rotate(180deg) saturate(2) !important;
    outline: none !important;
}

audio::-webkit-media-controls-panel {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(157, 78, 221, 0.08));
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 6px;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-mute-button {
    filter: brightness(1.5) saturate(1.5);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #c9a9dd;
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.5);
}
