* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #1a1a1a;
    color: white;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.site-header {
    background: linear-gradient(to right, #1e1e1e, #2a2a2a);
    padding: 20px 0;  
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 100vw;
    position: relative;
    z-index: 2;
    overflow: visible;
}

.header-content {
    width: 100%;
    padding-left: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    left: 0;
}

.logo {
    height: 45px;
    width: 45px;
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    padding: 8px;
    border-radius: 8px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

.logo:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #FF8C00, #FFA500);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.logo img {
    height: 100%;
    width: auto;
    filter: brightness(1.1);
}

.site-title {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header.hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 5px;  /* OPX KORTE HBE DESKTOP E*/
}

.video-wrapper {
    position: relative;
    background: #2a2a2a;
    border-radius: 8px;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-wrapper:first-child video {
    transform: none;
}

.video-wrapper:last-child video {
    transform: scaleX(-1);
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.control-panel {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.control-panel:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.id-container {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.media-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#remote-id {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #333;
    color: white;
}

.control-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #444;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.control-button:hover {
    background: #555;
}

.control-button.connect {
    background: #4CAF50;
}

.control-button.connect:hover {
    background: #45a049;
}

.control-button.disconnect {
    background: #f44336;
}

.control-button.disconnect:hover {
    background: #d32f2f;
}

.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999;
}

.pip {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    width: 250px !important;
    height: 141px !important;
    z-index: 1000;
    border: 2px solid #444;
}

.pip video {
    border-radius: 8px;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .id-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .id-container input,
    .id-container .control-button {
        flex: 1 1 auto;
    }
    .id-container .control-button.connect {
        margin-right: 10px;
    }
    
    .media-controls {
        flex-wrap: wrap;
    }
}

.app-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 140px);
    min-height: 600px;
    position: relative; 
    z-index: 1;
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-section {
    background: #2a2a2a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.chat-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 280px); 
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.message.sent {
    background: #4CAF50;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.received {
    background: #444;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #444;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px;
    border-radius: 20px;
    border: none;
    background: #333;
    color: white;
    font-size: 14px;
}

.send-button {
    background: #4CAF50;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    color: white;
}

.send-button:hover {
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .chat-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50vh;
        margin: 0;
        border-radius: 20px 20px 0 0;
        z-index: 1000;
        transform: translateY(calc(100% - 50px));
    }

    .chat-section.expanded {
        transform: translateY(0);
    }

    .chat-toggle {
        display: block;
    }

    .bar {
        display: block;
        width: 50px;
        height: 4px;
        background: #444;
        border-radius: 2px;
    }
    
    .site-header {
        padding: 15px 0;
    }

    .header-content {
        padding: 0 20px;
        gap: 15px;
        justify-content: flex-start;
    }

    .logo {
        height: 35px;
        padding: 6px;
    }

    .site-title {
        font-size: 20px;
    }
}

@media (min-width: 769px) {
    .app-layout {
        display: block;
    }

    .video-section {
        width: 100%;
        margin-bottom: 15px; 
    }

    .chat-section {
        width: 100%;
        height: calc(100vh - 660px);
        min-height: 200px;
    }

    .chat-messages {
        max-height: none;
    }
}

@media (min-width: 1400px) {
    .header-content {
        padding: 0 20px;
    }
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    margin-left: auto;
    padding: 10px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

body.light-mode {
    background-color: #f9f9f9;
    color: #1a1a1a;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body.light-mode .site-header {
    background: linear-gradient(to right, #ffffff, #e0e0e0);
    border-bottom: 1px solid #ccc;
}

body.light-mode .control-panel,
body.light-mode .chat-section {
    background: #ffffff;
    border: 1px solid #ccc;
}

body.light-mode .control-button,
body.light-mode .send-button {
    background: #e0e0e0;
    color: #1a1a1a;
}

body.light-mode .control-button:hover,
body.light-mode .send-button:hover {
    background: #ccc;
}

body.light-mode .message.sent {
    background: #4CAF50;
}

body.light-mode .message.received {
    background: #e0e0e0;
}

body.light-mode .video-wrapper {
    background: #d0d0d0;
}

body.light-mode .video-label {
    background: rgba(255, 255, 255, 0.7);
    color: #1a1a1a;
}

body.light-mode #remote-id {
    background: #e0e0e0;
    color: #1a1a1a;
    border: 1px solid #ccc;
}

body.light-mode .chat-input-area input {
    background: #e0e0e0;
    color: #1a1a1a;
    border: 1px solid #ccc;
}

.emoji-button {
    background: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    transition: background 0.2s;
}

.emoji-button:hover {
    background: #444;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    bottom: 70px;
    left: 15px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.emoji-picker.hidden {
    display: none;
}

.emoji {
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.emoji:hover {
    background: #444;
}
