/* ==========================================================================
   RIA E-Approval Dashboard - Component Styles
   ========================================================================== */

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header__left,
.header__center,
.header__right {
  display: flex;
  align-items: center;
}

.header__left {
  flex: 0 0 auto;
}

.header__center {
  flex: 1;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.header__right {
  flex: 0 0 auto;
  gap: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.header__logo:hover {
  background-color: var(--color-bg-secondary);
}

.header__logo-icon {
  width: 36px;
  height: 36px;
}

.header__company {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-primary);
}

/* Search */
.header__search {
  position: relative;
  width: 100%;
  max-width: 280px;
}

.header__search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.header__search-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4) 0 var(--space-10);
  background: var(--color-bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.header__search-input::placeholder {
  color: var(--color-text-muted);
}

.header__search-input:hover {
  border-color: var(--color-border);
}

.header__search-input:focus {
  background: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Notification */
.header__notification {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.header__notification:hover {
  background-color: var(--color-bg-secondary);
}

.header__notification svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-secondary);
}

.header__notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User */
.header__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.header__user:hover {
  background-color: var(--color-bg-secondary);
}

.header__avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 12px;
  font-weight: 600;
}

.header__username {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.header__dropdown-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-4) 0;
  overflow-y: auto;
  z-index: 900;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-3);
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar__item:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.sidebar__item--active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.sidebar__item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}

.sidebar__item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Quick Links */
.sidebar__quick-links {
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  margin-top: auto;
}

.sidebar__section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-3);
}

.sidebar__quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sidebar__quick-link:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
}

.sidebar__quick-link svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* ==========================================================================
   Gallery / Carousel
   ========================================================================== */
.gallery {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  box-shadow: var(--shadow-md);
}

.gallery__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease-in-out, visibility 400ms ease-in-out;
}

.gallery__slide--active {
  opacity: 1;
  visibility: visible;
}

.gallery__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.gallery__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
}

.gallery__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-8);
  color: var(--color-white);
}

.gallery__badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.gallery__badge--leader { background: var(--color-primary); }
.gallery__badge--news { background: var(--color-accent-blue); }
.gallery__badge--promo { background: var(--color-accent-orange); }

.gallery__title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-3);
  max-width: 600px;
}

.gallery__stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.gallery__stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  opacity: 0.9;
}

.gallery__stat svg {
  width: 16px;
  height: 16px;
}

.gallery__date {
  font-size: 12px;
  opacity: 0.7;
}

/* Gallery Navigation */
.gallery__indicators {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
}

.gallery__indicator {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.4);
  transition: all var(--transition-fast);
}

.gallery__indicator:hover {
  background: rgba(255, 255, 255, 0.7);
}

.gallery__indicator--active {
  width: 24px;
  background: var(--color-white);
}

.gallery__counter {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-6);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Section (Content Cards)
   ========================================================================== */
.section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.section__tabs {
  display: flex;
  gap: var(--space-2);
}

.section__tab {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.section__tab:hover:not(.section__tab--active) {
  background: var(--color-border);
}

.section__tab--active {
  background: var(--color-primary);
  color: var(--color-white);
}

.section__posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ==========================================================================
   Post Card
   ========================================================================== */
.post-card {
  position: relative;
  padding: var(--space-4);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--color-white);
}

.post-card__badge {
  display: inline-block;
  padding: 2px var(--space-2);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.post-card__badge--leader { background: var(--color-primary-light); color: var(--color-primary); }
.post-card__badge--news { background: rgba(59, 130, 246, 0.1); color: var(--color-accent-blue); }
.post-card__badge--promo { background: rgba(245, 158, 11, 0.1); color: var(--color-accent-orange); }
.post-card__badge--policy { background: rgba(139, 92, 246, 0.1); color: var(--color-accent-purple); }
.post-card__badge--security { background: rgba(107, 114, 128, 0.1); color: var(--color-text-secondary); }
.post-card__badge--company { background: rgba(8, 145, 178, 0.1); color: #0891B2; }

.post-card__date {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 11px;
  color: var(--color-text-muted);
}

.post-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-2);
  padding-right: var(--space-16);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__stats {
  display: flex;
  gap: var(--space-4);
}

.post-card__stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.post-card__stat svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Sharing Section
   ========================================================================== */
.sharing {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.sharing__header {
  margin-bottom: var(--space-5);
}

.sharing__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.sharing__feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-2);
  margin-bottom: var(--space-4);
}

.sharing__item {
  display: flex;
  gap: var(--space-3);
}

.sharing__avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-accent-blue) 0%, #1E40AF 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sharing__content {
  flex: 1;
  min-width: 0;
}

.sharing__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.sharing__author {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}

.sharing__time {
  font-size: 12px;
  color: var(--color-text-muted);
}

.sharing__text {
  font-size: 14px;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.sharing__input-wrapper {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.sharing__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text-primary);
  resize: none;
  min-height: 44px;
  transition: all var(--transition-fast);
}

.sharing__input::placeholder {
  color: var(--color-text-muted);
}

.sharing__input:focus {
  background: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.sharing__submit {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.sharing__submit:hover {
  background: var(--color-primary-hover);
}

.sharing__submit svg {
  width: 18px;
  height: 18px;
  color: var(--color-white);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) 0;
  margin-top: var(--space-8);
  border-top: 1px solid var(--color-border-subtle);
}

.footer__link {
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__copyright {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 1023px) {
  .header__company {
    display: none;
  }

  .header__username {
    display: none;
  }

  .gallery {
    height: 300px;
  }

  .gallery__title {
    font-size: 20px;
  }

  .gallery__content {
    padding: var(--space-6);
  }

  .section {
    padding: var(--space-4);
  }

  .sharing {
    padding: var(--space-4);
  }
}

@media (max-width: 767px) {
  .header {
    padding: 0 var(--space-4);
  }

  .header__search {
    max-width: 200px;
  }

  .gallery {
    height: 250px;
  }

  .gallery__title {
    font-size: 18px;
  }

  .section__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section__tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: var(--space-2);
  }

  .footer {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
}