@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth !important;
    background-image: url(../img/background_exe.png);
    background-size: cover;
    background-attachment: fixed;
}

::-webkit-scrollbar {
    width: 4px;
    background-color: #f4f5fb;
    border: 2px solid #f4f5fb;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-image: -webkit-gradient(linear,
        left bottom,
        left top,
        color-stop(0.30, #d5b86d),
        color-stop(0.86, #004217));
}


/* ============================================
   HEADER / TOP SECTION
   ============================================ */
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: relative;
    z-index: 100;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.3, #004217), color-stop(12, #1B8A42));
}

.top .logo-left {
    display: flex;
    align-items: center;
}

.top .logo-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.elo_logo {
    height: 60px;
    width: auto;
}

.kifah_logo, .logo {
    height: 80px;
    width: auto;
}

/* Navigation */
.aes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.aes li {
    display: inline-block;
    position: relative;
    padding: 15px 0;
}

.aes a {
    color: #d5b86d;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.15em;
    z-index: 10;
    display: inline-block;
    padding: 15px 20px;
    position: relative;
    font-size: 14px;
}

.aes a:after {
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    left: 50%;
    position: absolute;
    background: #d5b86d;
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0;
}

.aes a:hover:after {
    width: 100%;
    left: 0;
}

/* Mobile Menu */
#menuToggle {
    display: none;
    position: relative;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
}

#menuToggle input {
    display: block;
    width: 40px;
    height: 32px;
    position: absolute;
    top: -7px;
    left: -5px;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
}

#menuToggle span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    position: relative;
    background: #d5b86d;
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0px;
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
        background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
        opacity 0.55s ease;
}

#menuToggle input:checked ~ span {
    opacity: 1;
    transform: rotate(45deg) translate(-2px, -1px);
    background: #d5b86d;
}

#menuToggle input:checked ~ span:nth-last-child(3) {
    opacity: 0;
    transform: rotate(0deg) scale(0.2, 0.2);
}

#menuToggle input:checked ~ span:nth-last-child(2) {
    transform: rotate(-45deg) translate(0, -1px);
}

#menu {
    position: absolute;
    width: 200px;
    margin: -100px 0 0 -50px;
    padding: 50px;
    padding-top: 125px;
    right: -50px;
    background: #282b3a;
    list-style-type: none;
    -webkit-font-smoothing: antialiased;
    transform-origin: 0% 0%;
    transform: translate(100%, 0);
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
}

#menu li {
    padding: 10px 0;
    font-size: 18px;
}

#menu li a {
    color: #d5b86d;
}

#menuToggle input:checked ~ ul {
    transform: none;
}

/* ============================================
   FOOTER / BOTTOM SECTION
   ============================================ */
.bottom {
    width: 100%;
    padding: 30px 0;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.3, #004217), color-stop(12, #1B8A42));
    text-align: center;
}

.bottom p {
    color: white;
    margin: 5px 0;
}

/* ============================================
   HOMEPAGE TRIANGLES
   ============================================ */
.tri {
    height: 30vh;
    background-color: transparent;
    position: relative;
}

.tri * {
    position: absolute;
    inset: 0;
    width: 100%;
}

.centerTriangle {
    clip-path: polygon(0 0, 50% 95%, 100% 0);
    background-image: url(../img/eot.png);
    position: relative;
    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: top;
    background-color: #fff;
    background-size: 25pc;
}

.leftTriangle {
    clip-path: polygon(0 5%, 0% 100%, 50% 100%);
    background-image: url(../img/nh.png);
    position: relative;
    background-repeat: no-repeat;
    background-position-x: left;
    background-position-y: bottom;
    background-color: #fff;
    background-size: 20pc;
}

.rightTriangle {
    clip-path: polygon(100% 5%, 100% 100%, 50% 100%);
    background-image: url(../img/vn.png);
    position: relative;
    background-repeat: no-repeat;
    background-position-x: right;
    background-position-y: bottom;
    background-color: #fff;
    background-size: 20pc;
}

.leftTriangle::before,
.centerTriangle::before,
.rightTriangle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.15);
    z-index: 1;
    transition: background-color 0.3s ease;
}

.leftTriangle:hover::before,
.centerTriangle:hover::before,
.rightTriangle:hover::before {
    background-color: rgba(213, 183, 109, 0.14);
    z-index: 2;
    cursor: pointer;
}

.cta {
    clip-path: polygon(0 0, 50% 95%, 100% 0);
}

.rta {
    clip-path: polygon(100% 5%, 100% 100%, 50% 100%);
}

.lta {
    clip-path: polygon(0 5%, 0% 100%, 50% 100%);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content {
    margin-top: 15pc;
    flex-grow: 1;
}

.sec1, .sec2, .sec3, .sec4 {
    width: 100%;
    min-height: 30pc;
    background-color: #f4f5fb;
    box-shadow: 0 -4px 6px rgba(40, 43, 58, 0.2), 0 4px 6px rgba(40, 43, 58, 0.2);
    margin-bottom: 7pc;
    position: relative;
    padding: 20px;
}

.title {
    font-size: 3pc;
    color: #000000;
    display: inline;
}

.titlee {
    font-size: 3pc;
    color: #000000;
    border-bottom: #282b3a solid;
    border-bottom-left-radius: 1pc;
    display: inline;
}

.descripe {
    color: #000000;
    line-height: 1.8;
}

.sec1 img, .sec3 img {
    float: right;
    height: 30pc;
    width: 40pc;
    object-fit: cover;
}

.sec1 video {
    float: right;
    width: 40pc;
    margin-top: 3pc;
}

.sec2 img, .sec4 img {
    float: left;
    height: 30pc;
    width: 40pc;
    object-fit: cover;
}

.brk-btn {
    position: absolute;
    bottom: 20px;
    background: none;
    color: #282b3a;
    text-decoration: none;
    border: 0.2em solid #282b3a;
    border-radius: 2pc;
    padding: 0.5em 1em;
    z-index: 1;
    transition: all 0.3s ease;
}

.sec1 .brk-btn, .sec3 .brk-btn {
    right: 40.5pc;
}

.sec2 .brk-btn, .sec4 .brk-btn {
    right: 20px;
}

.brk-btn:hover {
    border: 0.2em solid #d5b86d;
    color: #d5b86d;
}

/* ============================================
   AUTH FORMS (LOGIN/SIGNUP)
   ============================================ */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.auth-box {
    background: #f4f5fb;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-bottom: 5px solid #d5b86d;
}

.auth-box h2 {
    text-align: center;
    color: #282b3a;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #282b3a;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #d5b86d;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #282b3a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #d5b86d;
    color: #282b3a;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #d5b86d;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

/* ============================================
   CHAT INTERFACE
   ============================================ */
.chat-container {
    display: flex;
    height: calc(100vh - 80px);
    background: #f4f5fb;
}

/* Sidebar */
.chat-sidebar {
    width: 280px;
    background: #282b3a;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3a3d4d;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #3a3d4d;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 20px;
    background: #d5b86d;
    color: #282b3a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: #e5c87d;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.conversation-item:hover {
    background: #3a3d4d;
}

.conversation-item.active {
    background: #d5b86d;
    color: #282b3a;
}

.conversation-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.conversation-actions {
    display: none;
    gap: 5px;
}

.conversation-item:hover .conversation-actions {
    display: flex;
}

.conversation-actions button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
}

.conversation-actions button:hover {
    opacity: 1;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #3a3d4d;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #d5b86d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #282b3a;
    font-weight: 600;
}

.user-name {
    flex: 1;
    font-size: 14px;
}

.logout-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
}

.logout-btn:hover {
    color: #d5b86d;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #282b3a;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: #d5b86d;
    color: #282b3a;
}

.message.user .message-avatar {
    background: #282b3a;
    color: white;
}

.message-content {
    padding: 15px 20px;
    border-radius: 15px;
    line-height: 1.6;
}

.message.assistant .message-content {
    background: white;
    color: #282b3a;
    border-bottom-left-radius: 5px;
}

.message.user .message-content {
    background: #282b3a;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.message-content pre {
    background: #1e1e1e;
    color: #ddd;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
}

.chat-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    resize: none;
    max-height: 150px;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: #d5b86d;
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #d5b86d;
    color: #282b3a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #282b3a;
    color: #d5b86d;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.welcome-screen h1 {
    font-size: 32px;
    color: #282b3a;
    margin-bottom: 15px;
}

.welcome-screen p {
    color: #666;
    font-size: 18px;
    max-width: 500px;
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #d5b86d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* ============================================
   COMING SOON PAGE
   ============================================ */
.coming-soon-container {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.coming-soon-container h1 {
    font-size: 48px;
    color: #282b3a;
    margin-bottom: 20px;
}

.coming-soon-container p {
    font-size: 20px;
    color: #666;
    max-width: 600px;
}

.coming-soon-icon {
    font-size: 80px;
    color: #d5b86d;
    margin-bottom: 30px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .sec1 img, .sec2 img, .sec3 img, .sec4 img {
        width: 30pc;
        height: 25pc;
    }
    
    .sec1 .brk-btn, .sec3 .brk-btn {
        right: 31pc;
    }
}

@media (max-width: 890px) {
    .aes {
        display: none;
    }
    
    #menuToggle {
        display: block;
    }
    
    .chat-sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        height: calc(100vh - 80px);
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .chat-sidebar.open {
        left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .centerTriangle, .leftTriangle, .rightTriangle {
        width: 20pc;
        height: 20pc;
        clip-path: none;
        margin: 10px auto;
    }
    
    .tri {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 20px;
    }
    
    .tri * {
        position: relative;
    }
    
    .cta, .rta, .lta {
        clip-path: none;
    }
    
    .sec1 img, .sec2 img, .sec3 img, .sec4 img {
        float: none;
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    .sec1, .sec2, .sec3, .sec4 {
        text-align: center;
    }
    
    .brk-btn {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
        display: inline-block;
    }
    
    .descripe br {
        display: none;
    }
}

@media (max-width: 768px) {
    .message {
        max-width: 95%;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
    }
    
    .send-btn {
        width: 100%;
        border-radius: 25px;
        height: 50px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .top {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .elo_logo {
        height: 40px;
    }
    
    .kifah_logo, .logo {
        height: 50px;
    }
    
    .welcome-screen h1 {
        font-size: 24px;
    }
    
    .coming-soon-container h1 {
        font-size: 32px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}


/* ============================================
   FILE UPLOAD STYLES
   ============================================ */

/* Upload button in chat input */
.upload-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn:hover {
    color: #d5b86d;
}

.upload-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* File preview container */
.file-preview-container {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 10px 15px;
    max-height: 150px;
    overflow-y: auto;
}

.file-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 10px;
    max-width: 200px;
    position: relative;
}

.file-preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.file-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    flex-shrink: 0;
}

.file-preview-icon i {
    font-size: 20px;
    color: #666;
}

.file-preview-name {
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    max-width: 100px;
}

.file-preview-remove {
    background: #ff4444;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.file-preview-remove:hover {
    background: #cc0000;
}

/* Drag and drop overlay */
.chat-main.drag-over {
    position: relative;
}

.chat-main.drag-over::after {
    content: 'Drop files here';
    position: absolute;
    inset: 0;
    background: rgba(213, 184, 109, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #282b3a;
    z-index: 100;
    border: 3px dashed #282b3a;
    border-radius: 10px;
    margin: 10px;
}

/* Message attachments */
.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid #e0e0e0;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Attachment badge in messages */
.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.attachment-badge i {
    color: #d5b86d;
}

/* Image modal */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-close:hover {
    color: #d5b86d;
}

/* Update chat input wrapper for upload button */
.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    background: white;
    border-radius: 25px;
    padding: 5px 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness for file upload */
@media (max-width: 600px) {
    .file-preview-item {
        max-width: 150px;
    }
    
    .file-preview-name {
        max-width: 60px;
    }
    
    .message-image {
        max-width: 150px;
        max-height: 150px;
    }
}
