@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #6e8efb;
    --secondary-color: #a777e3;
    --background-color: #fdfcff;
    --text-color: #4a4a4a;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
}

/* --- Header & Language Switcher --- */
header {
    /* The language switcher has been moved to the hero section */
    padding: 1rem 2rem;
}

.language-switcher {
    position: absolute;
    top: -0.5rem; /* Adjusted for overlap */
    right: 1rem;
    display: flex;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    z-index: 20; /* Ensure it's above other elements */
}

.lang-button {
    background-color: transparent;
    border: none;
    padding: 5px 16px; /* Adjusted to match SOS button height */
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.lang-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.lang-button:not(.active):hover {
    background-color: #e0e0e0;
}



/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative; /* Added for positioning children */
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    white-space: pre-wrap;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 0.5rem;
    opacity: 0.9;
    white-space: pre-wrap;
}



/* --- Content Wrapper for spacing --- */
.content-wrapper {
    max-width: 1200px;
    margin: -2rem auto 0 auto; /* Overlap with hero section */
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* --- Board Section --- */
#board-posts-display {
    margin-bottom: 2rem; /* Space between board and works gallery */
}

.board-post-item-main {
    background-color: var(--card-bg);
    border-radius: 15px; /* Changed to match other cards */
    border: none; /* Explicitly set to none to match other cards */
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease;
}

.board-post-item-main:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.board-post-item-main h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.board-post-item-main h4 small {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
    display: none;
}

.board-post-item-main p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.8rem;
}

/* --- Works Gallery --- */
#works-gallery {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: 2rem;
    margin-bottom: 2rem; /* Add gap below works gallery */
}

#ainews-list {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: 2rem; /* Assuming same gap as works-gallery */
    margin-top: -2rem; /* Adjusted as per user request */
}

#ainews-section {
    margin-bottom: 2rem;
    display: none;
}

.work-item {
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ainews-item {
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.work-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.work-item .image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.work-item:hover img {
    transform: scale(1.05);
}

.views {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    background-color: var(--primary-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem; /* Adjusted size */
    font-weight: 600;
    z-index: 1;
}

.work-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.work-info p {
    margin: 0; /* Remove margin for tight spacing */
    font-size: 0.9rem; /* Unified size for developer and date */
}

.work-info strong {
    color: var(--secondary-color);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    background-color: #f1f1f1;
    color: #777;
    font-size: 0.9rem;
    margin-top: -3rem; /* Overlap adjusted to -3rem */
}

footer p {
    margin: 0.5rem 0;
    white-space: pre-wrap;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* --- Media Queries for Responsive Design --- */
#works-gallery.list-view .work-item {
    display: block;
    padding: 0;
}

#works-gallery.list-view .image-container {
    width: 100%;
    height: auto;
    margin-bottom: 0;
}

#works-gallery.list-view .image-container img {
    width: 100%;
    height: auto;
    object-fit: unset;
}

#works-gallery.list-view .views {
    display: none;
}

#works-gallery.list-view .work-info p:not(:first-child) {
    display: none;
}

#works-gallery.list-view .work-info p:first-child strong {
    display: none;
}

#works-gallery.list-view .work-info {
    padding: 0.45rem;
}

#works-gallery.list-view .work-info p:first-child {
    font-size: 0.7rem;
    line-height: 1;
}

@media (min-width: 600px) {
    .hero-title { font-size: 3rem; }
    #works-gallery { grid-template-columns: repeat(2, 1fr); }
    #ainews-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    #works-gallery { grid-template-columns: repeat(3, 1fr); }
    #ainews-list { grid-template-columns: repeat(3, 1fr); }
}



/* --- Modal Styles --- */
.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 1001;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border: none;
    box-shadow: none;
    animation-name: animatetop;
    animation-duration: 0.4s
}

#g-man-iframe{width:200%;height:200%;border:none;transform:scale(0.5);transform-origin:top left}

.sos-button {
    background-color: #FF0066;
    color: white;
    padding: 5px 20px;
    border-radius: 25px; /* Makes it oval */
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap; /* Prevent text wrapping */
    display: inline-flex; /* Use flexbox for centering text */
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;

    /* Positioning relative to .hero */
    position: absolute;
    top: -0.5rem; /* Adjusted for overlap */
    left: 1rem; /* Move to the left */
}

.sos-button:hover {
    background-color: #CC0052; /* Slightly darker on hover */
}
/* View Toggle Buttons */
#view-toggle-buttons {
    text-align: right;
    margin-bottom: 10px;
}

.view-toggle-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
    border-radius: 5px;
    color: #555;
}

.view-toggle-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}



@media (max-width: 767px) { /* Adjust breakpoint as needed for typical mobile screens */
    #works-gallery.list-view {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Allow 3 items per row on smaller screens */
        gap: 2px; /* Reduce gap further for mobile */
    }
}

@media (min-width: 768px) { /* PC-specific list-view styles */
    #works-gallery.list-view {
        grid-template-columns: repeat(8, 1fr); /* 8 items per row on PC */
        gap: 5px; /* Adjust gap for PC */
    }
}

/* Floating Chatbot Icon */
#chatbot-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #FF0066; /* Match SOS button color */
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 100;
}

#chatbot-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Chatbot Panel */
#chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 360px;
  height: 540px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  /* Initial state for animation */
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

#chatbot-panel.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

#chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f1f1f1;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  color: var(--text-color);
}

#chatbot-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

#chatbot-iframe {
  flex-grow: 1;
  border: none;
}

@media (max-width: 480px) {
  #chatbot-panel {
    width: calc(100vw - 20px);
    height: 70vh;
    right: 10px;
    bottom: 80px;
  }
}

/* AI News Card Link Styling */
.ainews-card-link {
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit text color */
    display: block; /* Make the whole card area clickable */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ainews-card-link:hover {
    transform: translateY(-10px); /* Lift effect on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.ainews-card-link .card {
    border: none !important; /* Ensure no border from Bootstrap */
    border-radius: 15px !important;
    overflow: hidden;
    box-shadow: var(--shadow) !important;
}

.ainews-card-link .card-body {
    padding: 1.25rem;
}

.ainews-card-link .card-title {
    font-size: 0.9rem !important; /* Match program list content font size */
    font-weight: 400; /* Changed from 600 to 400 to remove bold */
    color: var(--text-color);
    margin-bottom: 0 !important; /* Match board post content margin */
}

/* AI News Section Title Styling */
#ainews-section h2 {
    font-size: 1.2rem !important; /* Match board post title font size */
    margin-bottom: 2.5rem; /* Adjusted for overlap effect */
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); /* Changed to gradient */
    padding: 1.5rem 1rem 1.5rem 1rem; /* Adjusted top and bottom padding to be equal */
    border-radius: 8px;
    display: block; /* Changed from inline-block to block */
    text-align: center; /* Center align text within the block */
    margin-top: 2.5rem !important; /* Added top margin, forced with !important */
    font-weight: 700; /* Added bold styling */
}