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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #f0e6d2;           
    background-color: #2c2218; 
}


.topnav {
    background-color: #3c2f2a;          
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #d4a017;    
    padding: 0 10px;
    position: relative;
}

.topnav a {
    color: #e8d5b8;
    text-decoration: none;
    padding: 18px 26px;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.topnav a:hover {
    background-color: #4a3a34;
    color: #fff;
}

.topnav a.active {
    background-color: #d4a017;
    color: #2c2218;
    font-weight: 600;
}


.topnav a.active:hover {
    background-color: #d4a017;
    color: #2c2218;
}


.topnav .auth-link.active:hover {
    background-color: #e8b828;
    color: #2c2218;
}



.topnav-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.topnav-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.topnav-tools {
    display: flex;
    align-items: center;
    gap: 8px; 
}

.topnav-auth {
    display: flex;
    align-items: center;
    gap: 0; 
}

.topnav-auth a.auth-link {
    flex: 1; 
    text-align: center; 
}



.topnav .auth-link {
    padding: 18px 26px; 
    color: #d4a017;
    border-right: 1px solid #5c4638; 
}


.topnav-auth a.auth-link:last-child {
    border-right: none;
}

.topnav .auth-link:hover {
    background-color: #4a3a34;
    color: #e8b828;
}


.search-container {
    margin-left: auto;
    position: relative;
    padding: 10px 15px;
}

#searchInput {
    padding: 10px 15px;
    width: 260px;
    border: none;
    border-radius: 6px;
    background-color: #3c2f2a;
    color: #f0e6d2;
    font-size: 1rem;
}

#searchInput::placeholder {
    color: #c9aa8a;
}

.search-results {
    position: absolute;
    top: 55px;
    right: 15px;
    background-color: #3c2f2a;
    border: 1px solid #5c4638;
    border-radius: 8px;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
}

.search-results a {
    display: block;
    padding: 12px 15px;
    color: #e8d5b8;
    text-decoration: none;
    border-bottom: 1px solid #5c4638;
}

.search-results a:hover {
    background-color: #d4a017;
    color: #2c2218;
}

.search-results a:last-child {
    border-bottom: none;
}


.clock {
    color: #c9aa8a;
    font-size: 1.05rem;
    padding: 18px 12px;
    white-space: nowrap;
    letter-spacing: 1px;
    font-weight: bold;
}


.content {
    min-height: 70vh;
    padding: 40px 30px;
    background-color: #3c2f2a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 25px auto;
    max-width: 1200px;
    border-radius: 10px;
    border: 1px solid #5c4638;
}

.content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 25px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}


.footer {
    background-color: #2c2218;
    color: #c9aa8a;
    text-align: center;
    padding: 28px 20px;
    font-size: 0.95rem;
    margin-top: 30px;
}


h1, h2, h3, h4 {
    color: #f4d9a8;           
    margin-bottom: 16px;
}

p {
    margin-bottom: 14px;
    color: #e8d5b8;
}



@media (max-width: 768px) {
    .topnav {
        flex-direction: column;
        text-align: center;
    }
    
    .topnav a {
        padding: 16px 20px;
        width: 100%;
    }
    
    .content {
        margin: 15px 10px;
        padding: 25px 18px;
    }
    
    .search-container {
        width: 100%;
        padding: 10px 20px;
    }
    
    #searchInput {
        width: 100%;
    }
}


/*  chatti */
.chat-container {
    max-width: 900px;
    padding: 20px 5px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.chat-form {
    background-color: #3c2f2a;
    border: 1px solid #5c4638;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex: 0 0 35%;
    min-width: 280px;
}

.chat-form-row {
    margin-bottom: 15px;
}

.chat-form label {
    display: block;
    color: #f4d9a8;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.chat-form input[type="text"],
.chat-form textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: #2c2218;
    color: #f0e6d2;
    border: 1px solid #5c4638;
    border-radius: 6px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.chat-form input[type="text"]:focus,
.chat-form textarea:focus {
    outline: none;
    border-color: #d4a017;
    box-shadow: 0 0 5px rgba(212, 160, 23, 0.3);
}

.chat-form textarea {
    resize: vertical;
    min-height: 80px;
}

.chat-submit-btn {
    background-color: #d4a017;
    color: #2c2218;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-submit-btn:hover {
    background-color: #e8b828;
    box-shadow: 0 4px 10px rgba(212, 160, 23, 0.4);
}

.messages-list {
    flex: 1;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    background-color: #3c2f2a;
    border: 1px solid #5c4638;
    border-radius: 8px;
    padding: 12px 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #5c4638;
}

.message-username {
    color: #d4a017;
    font-weight: 700;
    font-size: 0.95rem;
}

.message-timestamp {
    color: #c9aa8a;
    font-size: 0.85rem;
    font-family: monospace, system-ui, sans-serif;
}

.message-body {
    color: #e8d5b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.chat-error {
    background-color: #5c2a2a;
    border: 1px solid #8a3a3a;
    color: #f4d9a8;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .chat-container {
        padding: 15px;
        flex-direction: column;
    }
    
    .chat-form {
        padding: 15px;
        flex: 1;
        min-width: auto;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .message-timestamp {
        font-size: 0.8rem;
    }
}


/* chatti login */
.chat-login-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.chat-login-card {
    background-color: #3c2f2a;
    border: 1px solid #5c4638;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.chat-login-card h3 {
    color: #f4d9a8;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.chat-login-card p {
    color: #c9aa8a;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.inline-btn {
    display: inline-block;
    margin: 0 8px;
}


/*admin napit */
.admin-tools {
    font-size: 0.75em;
    margin-left: 10px;
}

.admin-tools button {
    margin-right: 5px;
    cursor: pointer;
    background-color: #4a3a34;
    color: #e8d5b8;
    border: 1px solid #5c4638;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.admin-tools button:hover {
    background-color: #d4a017;
    color: #2c2218;
}


#welcomeMessage {
    display: none;
    color: #f4d9a8;
    font-weight: 600;
    padding: 18px 15px;
    font-size: 0.95rem;
}

#welcomeMessage strong {
    color: #d4a017;
}



#logoutBtn {
    display: none;
    padding: 18px 26px;
    color: #e8d5b8;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#logoutBtn:hover {
    background-color: #4a3a34;
    color: #d4a017;
}