/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f0f2f5;
    color: #333;
    padding: 20px;
}

/* Navbar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #004080;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
}

.navbar .logo h1 {
    margin-bottom: 5px;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 15px;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.navbar ul li a:hover {
    text-decoration: underline;
}

/* Layout Container */
.layout-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 30px;
    position: relative;
}

/* Avatar Full-Size Display */
.avatar-fullsize {
    width: 45%;
    min-height: 400px;
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 5%;
    top: 20%;
}

.avatar-fullsize h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.avatar-fullsize img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Chatbot Section */
.chatbot-widget {
    width: 300px;
    height: 400px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    padding: 20px;
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.message {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    max-width: 85%;
}

.message.bot {
    background-color: #e0f0ff;
    align-self: flex-start;
}

.message.user {
    background-color: #d1ffd1;
    align-self: flex-end;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.input-area {
    display: flex;
    gap: 8px;
}

.input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    outline: none;
    font-size: 0.95rem;
}

.input-area button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.input-area button:hover {
    background-color: #0056b3;
}

/* Avatar page image alignment and sizing - ENFORCED for avatar_frontpage.php */
.avatar-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  margin: 40px auto;
  max-width: 900px;
}
.avatar-image-section, .avatar-result-section {
  flex: 1 1 320px;
  min-width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(33,150,243,0.08);
  padding: 28px 18px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.avatar-image-preview, .avatar-preview-area {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 18px 0 10px 0;
  width: 100%;
}
.avatar-image-preview img, .avatar-preview-area img {
  width: 220px !important;
  height: 220px !important;
  object-fit: contain !important;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(33,150,243,0.10);
  background: #a3fc70;
  display: block;
  margin: 0 auto;
  border: 2px solid #2196f3;
}
.avatar-info-text {
  color: #888;
  font-size: 1.08em;
  margin: 12px 0;
  text-align: center;
}
.avatar-btn-row {
  display: flex;
  gap: 16px;
  margin: 18px 0 8px 0;
  justify-content: center;
}
.avatar-action-btn {
  background: linear-gradient(90deg, #21f336 0%, #2196f3 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(33,150,243,0.08);
  transition: background 0.2s, transform 0.2s;
}
.avatar-action-btn:hover {
  background: linear-gradient(90deg, #2196f3 0%, #21f336 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}
.avatar-hint-text {
  color: #2196f3;
  font-size: 1em;
  margin-top: 8px;
  text-align: center;
}
@media (max-width: 900px) {
  .avatar-container {
    flex-direction: column;
    gap: 18px;
    max-width: 98vw;
  }
  .avatar-image-section, .avatar-result-section {
    min-width: unset;
    width: 100%;
  }
}

/* Avatar image responsive and user-friendly for avatar_frontpage.php */
.avatar-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 60px auto 0 auto;
  max-width: 350px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(33,150,243,0.10);
  padding: 32px 18px 28px 18px;
}
.avatar-preview-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 18px 0 10px 0;
  width: 100%;
}
.avatar-img.avatar-img-responsive {
  width: 320px !important;
  height: 320px !important;
  object-fit: contain !important;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(33,150,243,0.10);
  background: #f8f8f8;
  display: block;
  margin: 0 auto;
  border: 2px solid #2196f3;
  transition: box-shadow 0.2s, transform 0.2s;
}
.avatar-img.avatar-img-responsive:hover {
  box-shadow: 0 6px 24px rgba(33,150,243,0.18);
  transform: scale(1.04);
}
.avatar-action-btn {
  margin-top: 24px;
}
.avatar-info-text {
  color: #888;
  font-size: 1.08em;
  margin: 12px 0;
  text-align: center;
}

.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  max-width: 350px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(33,150,243,0.10);
  padding: 32px 18px 28px 18px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .avatar-fullsize {
        width: 90%;
        position: relative;
        left: auto;
        top: auto;
        margin: auto;
    }

    .chatbot-widget {
        right: 10px;
        bottom: 10px;
        width: 90%;
    }

    .layout-container {
        flex-direction: column;
        align-items: center;
    }
}
