body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

*:focus {
    outline: none;
}

#header {
    background: linear-gradient(135deg, #6441a4 0%, #7551b9 100%);
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

#header h1 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
}

#inputContainer {
    margin-left: 15px;
    display: flex;
    align-items: center;
    position: relative;
    gap: 0;
}

#inputContainer input {
    padding: 12px 18px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 220px;
    border-radius: 6px 0 0 6px;
    transition: all 0.3s ease;
}

#inputContainer input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#inputContainer input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

#inputContainer button {
    padding: 12px 20px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-left: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

#inputContainer button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#inputContainer button:active {
    transform: translateY(1px);
}

@media (max-width: 600px) {
    #header {
        padding: 12px 15px;
    }
    
    #inputContainer input {
        width: 160px;
        padding: 10px 15px;
    }
    
    #inputContainer button {
        padding: 10px 15px;
    }
    
    #header .fa-tv {
        font-size: 24px;
    }
}

#mainContent {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#streamsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    flex: 3;
    overflow-y: auto;
}

.stream {
    position: relative;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    flex: 1 1 calc(50% - 20px);
    display: flex;
    flex-direction: column;
    cursor: grab;
}

.stream.full {
    flex: 1 1 100%;
}

.stream iframe {
    width: 100%;
    height: 100%;
    flex: 1;
}

.stream .stream-name {
    position: absolute;
    top: 5px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    z-index: 5;
}

.controls {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f0f0f0;
    z-index: 10;
}

.closeButton, .chatButton, .settingsButton {
    cursor: pointer;
    background-color: #6441a4;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.closeButton:hover, .chatButton:hover, .settingsButton:hover {
    opacity: 1;
}

#chatSidebar {
    flex: 1;
    background-color: #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
}

#chatSidebar iframe {
    flex: 1;
    border: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    z-index: 1;
    width: calc(100% - 10px);
    border-radius: 6px;
    padding: 8px;
    top: 50px;
    left: 5px;
    font-size: 14px;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-content div {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dropdown-content div:hover {
    background-color: #f5f5f5;
    transform: translateX(2px);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.modal .close:hover,
.modal .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Refresh animation */
@keyframes refresh-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(100, 65, 164, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(100, 65, 164, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(100, 65, 164, 0);
    }
}

.stream.refreshing {
    animation: refresh-pulse 1s ease-out;
}
