*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

:root{
    --neon-blue:#1f3cff;
    --neon-glow:rgba(31,60,255,.35);
    --glass:rgba(255,255,255,.65);
    --border:rgba(31,60,255,.25);
}

html, body{
    width:100%;
    height:100%;
    overflow:hidden;
    background:#ffffff;
    color:#000000;
    font-size:18px;
}

/* ==========================================================
   APP LAYOUT
   ========================================================== */
.app{
    display:flex;
    height:100dvh;
    width:100%;
    gap:20px;
    padding:20px;
}

/* SIDEBAR */
.sidebar{
    width:300px;
    background:#ffffff;
    color:#000000;
    backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
    border:1px solid rgba(31,60,255,.15);
    border-radius:25px;
    display:flex;
    flex-direction:column;
    box-shadow:0 20px 50px rgba(0,0,0,.08);
}

.sidebar, .sidebar *{
    color:#000000;
}

/* Undtagelse: avatar bogstaver skal altid være hvide */
.avatar, .avatarSmall{
    color:white;
}

.users h6, .sidebarFooter{
    color:#555555;
}

.channelBox{
    padding:20px;
}

.channelBox label{
    color:#cbd5e1;
    display:block;
    margin-bottom:8px;
}

.channelBox input{
    width:100%;
    padding:15px 18px;
    border-radius:18px;
    border:2px solid rgba(31,60,255,.25);
    background:#ffffff;
    color:#000000;
    outline:none;
    font-size:16px;
    transition:.25s;
}

.channelBox input:focus{
    border-color:#1f3cff;
    box-shadow:0 0 20px rgba(31,60,255,.25);
}

.themeButton{
    margin-top:15px;
    width:100%;
    padding:15px;
    border-radius:18px;
    border:2px solid #1f3cff;
    background:#ffffff;
    color:#000000;
    cursor:pointer;
    font-size:16px;
    font-weight:600;
}

.themeButton:hover{
    background:#1f3cff;
    color:white;
    box-shadow:0 10px 30px rgba(31,60,255,.35);
}

/* USERS */
.users{
    flex:1;
    padding:20px;
    overflow-y:auto;
}

.user{
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:15px;
}

.avatar{
    width:42px;
    height:42px;
    border-radius:50%;
    background:#007aff;
    display:flex;
    justify-content:center;
    align-items:center;
    font-weight:bold;
    font-size:20px;
    text-transform:uppercase;
}

.sidebarFooter{
    padding:20px;
    text-align:center;
    font-size:13px;
}

/* KANAL-MENU */
.schoolTitle{
    cursor:pointer;
    padding:12px;
    border-radius:12px;
    transition:.2s;
    font-weight:600;
}

.schoolTitle:hover{
    background:rgba(255,255,255,.1);
}

.schoolMenu .schoolClasses{
    display:none;
    padding-left:20px;
}

.schoolMenu .schoolClasses.open{
    display:block;
}

.schoolClasses div{
    padding:8px;
    border-radius:10px;
    cursor:pointer;
}

.schoolClasses div:hover{
    background:#1f3cff;
    color:white;
}

/* ==========================================================
   CHAT OMRÅDE
   ========================================================== */
.chatArea{
    flex:1;
    display:flex;
    flex-direction:column;
    gap:15px;
    min-height:0;
}

.chatHeader{
    height:80px;
    flex-shrink:0;
    background:var(--glass);
    backdrop-filter:blur(20px);
    border:1px solid rgba(31,60,255,.15);
    border-radius:25px;
    display:flex;
    align-items:center;
    padding:0 30px;
    box-shadow:0 15px 40px rgba(0,0,0,.08);
}

.chatHeader h4{
    font-size:22px;
}

.chatbox{
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding:30px;
    background:#f8f9ff;
    border-radius:25px;
    border:1px solid rgba(31,60,255,.12);
}

/* BESKEDER */
.chatRow{
    display:flex;
    margin-bottom:18px;
    align-items:flex-end;
}

.chatRow.me{
    justify-content:flex-end;
}

.chatRow.other{
    justify-content:flex-start;
}

.avatarSmall{
    width:40px;
    height:40px;
    border-radius:50%;
    background:#007aff;
    display:flex;
    justify-content:center;
    align-items:center;
    margin-right:10px;
    flex-shrink:0;
}

.bubble{
    max-width:75%;
    padding:16px 20px;
    font-size:17px;
    border-radius:24px;
    box-shadow:0 8px 25px rgba(0,0,0,.08);
}

.bubbleMe{
    background:#1f3cff;
    color:white;
    border-radius:24px 24px 6px 24px;
    box-shadow:0 10px 30px rgba(31,60,255,.35);
}

.bubbleOther{
    background:white;
    color:#000;
    border-radius:24px 24px 24px 6px;
    border:1px solid rgba(0,0,0,.06);
}

.bubbleTop{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
}

.bubbleName{
    font-weight:700;
    font-size:14px;
}

.bubbleTime{
    font-size:11px;
    opacity:.55;
}

.bubbleText{
    margin-top:8px;
    line-height:1.45;
}

.chatGif{
    max-width:220px;
    border-radius:15px;
    display:block;
}

/* MESSAGE BAR / INPUT */
.messageBar{
    flex-shrink:0;
    background:var(--glass);
    backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
    border-radius:25px;
    border:1px solid rgba(31,60,255,.15);
    box-shadow:0 15px 40px rgba(0,0,0,.08);

    padding:12px;

    display:flex;
    gap:10px;
    align-items:center;

    position:relative;
}

.iconButton{
    width:48px;
    height:48px;
    border:none;
    border-radius:15px;
    background:#eef2ff;
    color:#000;
    font-size:20px;
    cursor:pointer;
    flex-shrink:0;
}

.iconButton:hover{
    background:#dfe6ff;
}

.messageInput{
    flex:1;
    width:auto;
    height:48px;
    padding:0 18px;

    border-radius:24px;
    border:2px solid rgba(31,60,255,.15);

    background:white;
    color:black;

    font-size:16px;
    outline:none;

    transition:.25s;
    min-width:0;
}

.messageInput:focus{
    border-color:#1f3cff;
    box-shadow:0 0 20px rgba(31,60,255,.20);
}

.sendButton{
    height:48px;
    padding:0 22px;

    font-size:16px;
    border:none;
    border-radius:16px;

    background:#1f3cff;
    color:white;

    cursor:pointer;

    box-shadow:0 8px 20px rgba(31,60,255,.30);
    transition:.25s;

    flex-shrink:0;
}

.sendButton:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 25px rgba(31,60,255,.40);
}

button{
    transition:.25s;
}

button:hover{
    transform:translateY(-2px);
}

/* ==========================================================
   EMOJI / GIF PICKER
   ========================================================== */
.emojiContainer{
    position:relative;
    display:flex;
    gap:8px;
    align-items:center;
    flex-shrink:0;
}

.emojiPicker{
    position:absolute;
    bottom:62px;
    left:0;

    width:275px;
    max-width:90vw;

    background:white;

    padding:15px;

    border-radius:18px;

    display:none;

    box-shadow:0 15px 40px rgba(0,0,0,.2);

    z-index:1000;
}

.emojiPicker.show{
    display:block;
}

#gifPicker{
    flex-direction:column;
}

#gifPicker.show{
    display:flex;
}

.emojiPicker span{
    width:42px;
    height:42px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:24px;
    cursor:pointer;
    border-radius:10px;
}

.emojiPicker span:hover{
    background:#eef2ff;
}

.emojiTabs{
    display:flex;
    gap:5px;
    margin-bottom:10px;
    width:100%;
}

.emojiTabs button{
    width:45px;
    height:40px;
    border:none;
    background:#eef2ff;
    border-radius:10px;
    cursor:pointer;
    font-size:22px;
}

.emojiContent{
    display:none !important;
    grid-template-columns:repeat(5, 42px);
    gap:8px;
    width:100%;
}

.emojiContent.active{
    display:grid !important;
}

#gifResults{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;

    margin-top:12px;

    max-height:350px;
    overflow-y:auto;

    padding:4px;
}

#gifResults img{
    width:100%;
    height:110px;

    object-fit:cover;

    border-radius:14px;

    cursor:pointer;

    transition:.2s;
}

#gifResults img:hover{
    transform:scale(1.04);
}

#gifResults img{
    width:90px;
    height:90px;
    object-fit:cover;
    border-radius:12px;
    cursor:pointer;
}

#gifResults img:hover{
    transform:scale(1.05);
}

/* ==========================================================
   BESKED-MENU (rediger/slet) + MODAL
   ========================================================== */
.messageMenu{
    cursor:pointer;
    margin-left:10px;
    font-weight:bold;
    font-size:20px;
}

.messageMenu:hover{
    opacity:.7;
}

.messageMenuBox{
    position:absolute;
    display:none;
    background:white;
    border-radius:12px;
    box-shadow:0 10px 30px rgba(0,0,0,.2);
    overflow:hidden;
    z-index:9999;
}

.messageMenuBox div{
    padding:12px 18px;
    cursor:pointer;
    white-space:nowrap;
}

.messageMenuBox div:hover{
    background:#f3f4f6;
}

.editModal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:10000;
}

.editBox{
    width:450px;
    max-width:95%;
    background:white;
    border-radius:20px;
    padding:25px;
}

.editButtons{
    margin-top:20px;
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

.onlineDot{
    width:10px;
    height:10px;
    background:#1f3cff;
    border-radius:50%;
    box-shadow:0 0 15px #1f3cff;
}

/* ==========================================================
   DARK MODE
   ========================================================== */
body.dark{
    background:#000000;
}

body.dark .chatHeader,
body.dark .messageBar{
    background:#000000;
    color:white;
}

body.dark .chatbox{
    background:#000000;
}

body.dark .messageInput{
    background:#111111;
    color:white;
}

body.dark .bubbleOther{
    background:#1c1c1e;
    color:white;
}

body.dark .sidebar,
body.dark .sidebar *{
    color:white;
}

body.dark .sidebar{
    background:#000000;
}

body.dark .sidebarFooter{
    color:#aaaaaa;
}

body.dark .channelBox input,
body.dark .themeButton{
    background:#111111;
    color:white;
    border:1px solid #1f3cff;
}

body.dark .schoolClasses div:hover{
    color:white;
}

/* ==========================================================
   RESPONSIVE — ét samlet sæt breakpoints
   Desktop (default) -> Tablet (<=1100px) -> Mobil (<=700px) -> Lille telefon (<=400px)
   ========================================================== */

/* TABLET / IPAD */
@media (max-width:1100px){

    .app{
        height:100dvh;
    }

    .sidebar{
        width:240px;
    }

    .messageInput{
        font-size:18px;
    }

    .sendButton{
        padding:15px 25px;
    }
}

/* MOBIL */
@media (max-width:700px){

    html, body{
        overflow:hidden;
        height:100dvh;
    }

    .app{
        flex-direction:column;
        height:100dvh;
        padding:10px;
        gap:10px;
    }

    /* TOP BAR (kanal-valg + dark mode) */
    .sidebar{
        width:100%;
        height:auto;
        min-height:70px;
        border-radius:20px;
        flex-shrink:0;
    }

    .channelBox{
        padding:10px;
        display:flex;
        align-items:center;
        gap:8px;
    }

    .channelBox label{
        display:none;
    }

    .channelBox input{
        flex:1;
        height:50px;
        padding:0 15px;
        font-size:16px;
    }

    .themeButton{
        width:110px;
        height:50px;
        margin-top:0;
        padding:0;
        font-size:13px;
    }

    /* skjul brugerliste + footer for at spare plads */
    .users,
    .sidebarFooter{
        display:none;
    }

    /* CHAT */
    .chatArea{
        flex:1;
        min-height:0;
        gap:10px;
    }

    .chatHeader{
        height:55px;
        border-radius:18px;
        padding:0 15px;
    }

    .chatHeader h4{
        font-size:18px;
    }

    .chatbox{
        padding:15px;
        border-radius:20px;
    }

    .chatRow{
        margin-bottom:12px;
    }

    .avatarSmall{
        width:32px;
        height:32px;
        font-size:14px;
    }

    .bubble{
        max-width:85%;
        padding:12px 15px;
        font-size:15px;
        border-radius:20px;
    }

    .bubbleName{
        font-size:12px;
    }

    .bubbleTime{
        font-size:10px;
    }

    .iconButton{
        width:42px;
        height:42px;
        border-radius:50%;
        font-size:20px;
    }

    .messageInput{
        height:45px;
        padding:0 15px;
        font-size:15px;
    }

    .sendButton{
        height:45px;
        padding:0 15px;
        border-radius:15px;
        font-size:15px;
    }
}

/* MEGET SMÅ TELEFONER */
@media (max-width:400px){

    .app{
        padding:5px;
    }

    .themeButton{
        width:90px;
        font-size:12px;
    }

    .sendButton{
        padding:0 10px;
    }

    .messageInput{
        font-size:14px;
    }

    .iconButton{
        width:38px;
        height:38px;
    }

    .emojiPicker{
        width:320px;
    }
}

#tutorialBox{

height:100vh;
display:flex;
justify-content:center;
align-items:center;

}


.tutorialPage{

display:none;
text-align:center;

}


.tutorialPage.active{

display:block;

}


.tutorialPage img{

    width:min(90vw,1000px);

    max-height:70vh;

    object-fit:contain;

    border-radius:25px;

    box-shadow:0 20px 60px rgba(0,0,0,.25);

    margin-bottom:30px;

}


.tutorialPage button{

background:#1f3cff;
color:white;
border:none;
padding:15px 40px;
border-radius:20px;
font-size:18px;

}

/* ===============================
   WELCOME
================================= */

.welcomeScreen{
    width:100%;
    height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:#f4f7ff;
}

.welcomeBox{

    width:450px;
    max-width:90%;

    background:white;

    border-radius:30px;

    padding:50px;

    text-align:center;

    border:1px solid rgba(31,60,255,.15);

    box-shadow:0 20px 50px rgba(0,0,0,.08);

}

.welcomeBox h1{

    margin-bottom:15px;

    color:#1f3cff;

    font-size:38px;

}

.welcomeBox p{

    color:#666;

    margin-bottom:35px;

}

.welcomeInput{

    width:100%;

    height:60px;

    border-radius:18px;

    border:2px solid rgba(31,60,255,.2);

    padding:0 20px;

    font-size:18px;

    outline:none;

}

.welcomeInput:focus{

    border-color:#1f3cff;

    box-shadow:0 0 20px rgba(31,60,255,.25);

}

.welcomeButton{

    width:100%;

    margin-top:20px;

    height:60px;

    border:none;

    border-radius:18px;

    background:#1f3cff;

    color:white;

    font-size:20px;

    font-weight:bold;

    cursor:pointer;

}

.homeButtonBox{
    padding:15px;
    border-bottom:1px solid #ddd;
}

.homeButton{
    display:block;
    width:100%;
    text-align:center;
    background:#0d6efd;
    color:#fff;
    text-decoration:none;
    padding:10px 12px;
    border-radius:8px;
    font-weight:bold;
    transition:.2s;
}

.homeButton:hover{
    background:#0b5ed7;
    color:#fff;
}

.gifSearch{
    width:100%;
    height:42px;

    padding:0 12px;

    border:1px solid #ddd;
    border-radius:12px;

    outline:none;

    font-size:15px;
}

.gifSearch:focus{
    border-color:#1f3cff;
}

#gifResults{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;

    margin-top:10px;

    max-height:300px;
    overflow-y:auto;
}

#gifResults img{
    width:100%;
    height:90px;

    object-fit:cover;

    border-radius:10px;

    cursor:pointer;

    transition:.15s;
}

#gifResults img:hover{
    transform:scale(1.04);
}


.channelHeader{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
}

.clearChannelButton{
    border:none;
    border-radius:14px;
    padding:10px 16px;

    background:#ffe5e5;
    color:#c62828;

    font-size:14px;
    font-weight:600;

    cursor:pointer;
    transition:.2s;
}

.clearChannelButton:hover{
    background:#dc3545;
    color:white;
    transform:translateY(-1px);
}

body.dark .clearChannelButton{
    background:#2a1515;
    color:#ff6b6b;
}

body.dark .clearChannelButton:hover{
    background:#dc3545;
    color:white;
}


/* Mobil */
@media (max-width:700px){

    .clearChannelButton{
        padding:8px 11px;
        font-size:12px;
    }

}

.channelHeader h4{
    margin:0;
}

.privacyButton{
    border:none;
    border-radius:14px;
    padding:10px 16px;
    background:#eef2ff;
    color:#000;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.privacyButton:hover{
    background:#dfe6ff;
    transform:translateY(-1px);
}

body.dark .privacyButton{
    background:#1c1c1e;
    color:white;
}

.channelRequests{
    position: fixed;
    top: 75px;
    right: 20px;

    width: 300px;

    background: white;
    border: 1px solid #ddd;
    border-radius: 14px;

    padding: 12px;

    box-shadow: 0 8px 30px rgba(0,0,0,.15);

    z-index: 9999;
}

.requestsTitle{
    font-weight: 700;
    font-size: 15px;

    padding: 6px 8px 12px;

    border-bottom: 1px solid #eee;
}

.channelRequest{
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 12px 6px;

    border-bottom: 1px solid #eee;
}

.channelRequest:last-child{
    border-bottom: none;
}

.requestText{
    font-size: 14px;
    line-height: 1.3;
}

.requestButtons{
    display: flex;
    gap: 6px;
}

.requestButtons button{
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 9px;

    font-size: 17px;
    font-weight: bold;

    cursor: pointer;

    transition: .15s;
}

.approveRequest{
    background: #e7f8ed;
    color: #1d9b50;
}

.approveRequest:hover{
    background: #d1f1dc;
    transform: scale(1.05);
}

.denyRequest{
    background: #fdeaea;
    color: #d64545;
}

.denyRequest:hover{
    background: #f8d4d4;
    transform: scale(1.05);
}