/* ===========================
   RESET & GLOBAL STYLES
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4CAF50;
  --primary-hover: #45a049;
  --bg-light: #f0f2f5;
  --bg-white: #ffffff;
  --text-dark: #1a1a1a;
  --text-gray: #65676b;
  --border-color: #e5e5ea;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===========================
   SCREEN / LAYOUT
   =========================== */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-light);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===========================
   LOGIN SCREEN
   =========================== */
#screen-login {
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-header {
  margin-bottom: 2rem;
}

.logo-login {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.slogan {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin: 0;
}

.login-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background-color: #fafafa;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .form-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.error-message {
  display: none;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.error-message.show {
  display: block;
}

.form-input.error {
  border-color: #dc3545;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

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

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: rgba(76, 175, 80, 0.1);
}

.btn-lg {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.login-divider::before {
  margin-right: 1rem;
}

.login-divider::after {
  margin-left: 1rem;
}

.login-footer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* ===========================
   REGISTER SCREEN
   =========================== */
#screen-register {
  justify-content: flex-start;
  padding-bottom: 2rem;
}

.register-container {
  width: 100%;
  max-width: 400px;
  margin: 2rem auto;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.btn-back {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 0;
  font-weight: 600;
  transition: var(--transition);
}

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

.register-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

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

/* ===========================
   FEED SCREEN
   =========================== */
#screen-feed {
  position: relative;
  padding-bottom: 70px;
}

.feed-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.top-bar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

/* Filter Chips */
.filter-chips-container {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background-color: var(--bg-white);
  color: var(--text-gray);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  border: none;
}

.chip:hover {
  background-color: var(--bg-light);
}

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

/* Highlights Banner */
#highlights-container {
  margin: 0 1rem;
  margin-bottom: 1rem;
}

.highlights-banner {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.highlights-banner::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.highlight-card {
  min-width: 280px;
  background-color: var(--bg-white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.highlight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.highlight-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.highlight-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.default-logo {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  font-weight: bold;
}

.highlight-info {
  flex: 1;
  min-width: 0;
}

.highlight-company-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.highlight-industry {
  color: var(--text-gray);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.highlight-post-preview {
  margin-bottom: 0.5rem;
}

.highlight-post-preview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.highlight-post-preview p {
  font-size: 0.8rem;
  color: var(--text-gray);
  margin: 0.25rem 0 0 0;
}

.highlight-badge {
  background-color: #FFD700;
  color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

/* Feed Container */
.feed-container {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Post Card */
.post-card {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.post-card:active {
  box-shadow: var(--shadow-md);
}

.post-card-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.post-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  margin-right: 1rem;
  flex-shrink: 0;
}

.post-card-company {
  flex: 1;
}

.post-company-name {
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.post-company-location {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin: 0;
}

.post-media {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.post-card-footer {
  padding: 1rem;
}

.post-description {
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.post-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-gray);
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.like-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #e73c7e;
}

.like-btn.liked {
  color: #e73c7e;
  background-color: rgba(231, 60, 126, 0.1);
}

.like-btn:active .like-heart {
  animation: likeScale 0.4s ease-out;
}

@keyframes likeScale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.whatsapp-btn {
  background-color: #25d366;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: var(--transition);
  flex: 1;
  text-align: center;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
}

.whatsapp-btn:hover {
  background-color: #20ba57;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

.loading-spinner.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===========================
   BOTTOM NAVIGATION
   =========================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 0;
  z-index: 200;
  height: 70px;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-gray);
  font-size: 0.75rem;
  transition: var(--transition);
  padding: 0.75rem 0.5rem;
  position: relative;
}

.nav-item:hover {
  color: var(--primary-color);
  background-color: rgba(76, 175, 80, 0.05);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary-color);
}

.nav-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===========================
   MODAL
   =========================== */
.modal {
  display: flex;
  position: fixed;
  z-index: 500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  align-items: flex-end;
}

.modal.hidden {
  display: none !important;
}

.modal:not(.hidden) {
  display: flex !important;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  z-index: 501;
}

.modal-content.modal-large {
  max-width: 100%;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 502;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

/* Upload Area */
.upload-area {
  margin-bottom: 1.5rem;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2rem;
  cursor: pointer;
  transition: var(--transition);
  background-color: #fafafa;
}

.upload-label:hover {
  border-color: var(--primary-color);
  background-color: rgba(76, 175, 80, 0.05);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.upload-label p {
  margin: 0.5rem 0;
  font-weight: 600;
  color: var(--text-dark);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* Preview Gallery */
.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.preview-gallery.hidden {
  display: none;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-light);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.preview-remove:active {
  transform: scale(1.1);
}

/* ===========================
   PROFILE SCREEN
   =========================== */
#screen-profile {
  padding-bottom: 70px;
}

.profile-container {
  flex: 1;
}

.profile-banner {
  height: 150px;
}

.profile-info {
  background-color: var(--bg-white);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: -40px auto 1rem;
  border: 4px solid var(--bg-light);
  box-shadow: var(--shadow-md);
}

.profile-info h1 {
  margin: 0.5rem 0;
  font-size: 1.5rem;
}

.profile-location,
.profile-whatsapp {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-top: 0.25rem;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem;
  cursor: pointer;
  color: var(--text-gray);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  padding: 1rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.grid-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--bg-light);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.grid-item:active img {
  transform: scale(0.95);
}

/* ===========================
   EXPLORE SCREEN
   =========================== */
#screen-explore {
  padding-bottom: 70px;
}

.explore-container {
  flex: 1;
  padding: 1rem;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.explore-item {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-light);
  cursor: pointer;
}

.explore-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.explore-item:active img {
  transform: scale(0.95);
}

/* ===========================
   POST DETAIL SCREEN
   =========================== */
#screen-post-detail {
  padding-bottom: 70px;
  overflow-y: auto;
}

.post-detail-container {
  max-width: 600px;
  margin: 0 auto;
}

.post-detail-media {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

.post-detail-info {
  background-color: var(--bg-white);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

.post-detail-company {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.post-detail-company-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.post-detail-company-name {
  font-weight: 600;
  color: var(--text-dark);
}

.post-detail-description {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.post-detail-actions .like-btn {
  flex: 0.5;
}

.post-detail-actions .whatsapp-btn {
  flex: 1;
}

/* Comments Section */
.comments-section {
  background-color: var(--bg-white);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

.comments-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.comments-list {
  margin-bottom: 1.5rem;
}

.comment {
  background-color: var(--bg-light);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin: 0;
}

.comment-form {
  display: flex;
  gap: 0.75rem;
}

.comment-form .form-input {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
}

.comment-form .btn {
  flex-shrink: 0;
  margin: 0;
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: var(--text-dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease-out;
  max-width: 300px;
}

.toast.error {
  background-color: #dc3545;
}

.toast.success {
  background-color: var(--primary-color);
}

.toast.info {
  background-color: #0066cc;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===========================
   CREATE POST FORM
   =========================== */
.create-post-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ===========================
   MEDIA QUERIES
   =========================== */
@media (min-width: 600px) {
  .modal-content {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 500px;
    border-radius: var(--radius);
    max-height: 90vh;
  }

  .modal-content.modal-large {
    max-width: 600px;
  }

  @keyframes slideUp {
    from {
      transform: translate(-50%, -55%);
      opacity: 0;
    }
    to {
      transform: translate(-50%, -50%);
      opacity: 1;
    }
  }

  .login-container {
    margin: 0 auto;
  }

  .register-container {
    margin: 0 auto;
  }

  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  body {
    font-size: 17px;
  }

  .feed-container {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    gap: 1.5rem;
  }

  .post-card {
    border-radius: 0;
  }

  .explore-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .explore-item {
    aspect-ratio: auto;
    height: 250px;
  }

  .top-bar {
    padding: 1rem 2rem;
  }

  .filter-chips-container {
    padding: 0.75rem 2rem;
  }
}

/* ===========================
   IMPROVED PROFILE SCREEN
   =========================== */
#screen-profile {
  padding-bottom: 70px;
  overflow-y: auto;
  background-color: var(--bg-light);
}

.profile-wrapper {
  flex: 1;
}

.profile-banner {
  height: 180px;
  width: 100%;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.profile-card {
  background-color: var(--bg-white);
  margin-top: -40px;
  margin: -40px 1rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0;
  position: relative;
  z-index: 10;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
}

.profile-avatar-large {
  position: relative;
  margin-bottom: 1.5rem;
}

.profile-avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--bg-white);
  box-shadow: var(--shadow-md);
  object-fit: cover;
  background-color: var(--bg-light);
}

.profile-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 3px solid white;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.profile-avatar-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.1);
}

.profile-header-info {
  text-align: center;
  flex: 1;
  width: 100%;
}

.profile-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--text-dark);
}

.profile-industry {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 600;
  margin: 0.25rem 0;
}

.profile-location {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin: 0.5rem 0;
}

.profile-edit-btn {
  align-self: center;
  margin-top: 1rem;
  min-width: 150px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stat {
  text-align: center;
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-top: 0.25rem;
}

/* Bio Section */
.profile-bio-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.profile-biography {
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Contact Section */
.profile-contact-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.contact-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.85rem;
  color: var(--text-gray);
  font-weight: 600;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-value {
  color: var(--text-dark);
  margin: 0;
  word-break: break-all;
}

/* Posts Section */
.profile-posts-section {
  padding: 1.5rem;
}

.profile-posts-section h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.grid-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--bg-light);
  transition: var(--transition);
}

.grid-item img,
.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.grid-item:active {
  transform: scale(0.95);
}

.grid-item:active img,
.grid-item:active video {
  transform: scale(1.05);
}

/* ===========================
   PROFILE EDIT MODAL
   =========================== */
.modal-large {
  max-width: 600px !important;
}

.edit-profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-image-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.profile-image-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  background-color: var(--bg-light);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5em;
  padding-right: 2.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group small {
  display: block;
  text-align: right;
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.form-actions .btn {
  margin: 0;
}

/* ===========================
   RESPONSIVE PROFILE
   =========================== */
@media (min-width: 768px) {
  .profile-card {
    margin: -40px 2rem 0;
    padding: 0;
    border-radius: var(--radius);
  }

  .profile-header {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .profile-header-info {
    flex: 1;
    text-align: left;
    margin: 0 2rem;
  }

  .profile-name {
    font-size: 2rem;
  }

  .profile-edit-btn {
    align-self: flex-start;
    margin-top: 0;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-large {
    max-width: 600px !important;
  }
}

/* ===========================
   MOBILE OPTIMIZATIONS
   =========================== */
@media (max-width: 480px) {
  /* Typography */
  body {
    font-size: 14px;
  }

  .logo-login {
    font-size: 2rem;
  }

  .top-bar-logo {
    font-size: 1.2rem;
  }

  /* Spacing */
  .login-container,
  .register-container {
    padding: 1.5rem 1rem;
  }

  .feed-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  /* Forms */
  .form-input,
  .form-textarea {
    padding: 14px 12px;
    font-size: 16px;
  }

  .btn {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .btn-lg {
    padding: 16px 16px;
    font-size: 1rem;
  }

  /* Buttons */
  .like-btn,
  .whatsapp-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .create-post-form textarea {
    font-size: 16px;
  }

  /* Post Card */
  .post-card-header {
    padding: 0.75rem;
  }

  .post-card-avatar {
    width: 36px;
    height: 36px;
    margin-right: 0.75rem;
    font-size: 1rem;
  }

  .post-company-name {
    font-size: 0.95rem;
  }

  .post-company-location {
    font-size: 0.8rem;
  }

  .post-card-footer {
    padding: 0.75rem;
  }

  .post-description {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  /* Profile */
  .profile-card {
    margin: -30px 0.5rem 0;
  }

  .profile-avatar-large {
    margin-bottom: 1rem;
  }

  .profile-avatar-img {
    width: 80px;
    height: 80px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-stats {
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .contact-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .contact-icon {
    font-size: 1.2rem;
    min-width: 30px;
  }

  .contact-label {
    font-size: 0.75rem;
  }

  .contact-value {
    font-size: 0.9rem;
  }

  /* Grid */
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
  }

  .explore-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  /* Modal */
  .modal-content {
    padding: 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .upload-label {
    padding: 1.5rem 1rem;
  }

  .upload-icon {
    font-size: 2rem;
  }

  .upload-label p {
    font-size: 0.9rem;
  }

  .upload-hint {
    font-size: 0.75rem;
  }

  /* Edit Profile Modal */
  .profile-image-preview {
    width: 100px;
    height: 100px;
  }

  .edit-profile-form {
    gap: 1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  /* Bottom Navigation */
  .bottom-nav {
    height: 65px;
  }

  .nav-icon {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
  }

  .nav-label {
    font-size: 0.65rem;
  }

  /* Feed Container */
  #screen-feed {
    padding-bottom: 65px;
  }

  #screen-profile {
    padding-bottom: 65px;
  }

  #screen-explore {
    padding-bottom: 65px;
  }

  #screen-post-detail {
    padding-bottom: 65px;
  }

  /* Comments */
  .comment {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .comment-author {
    font-size: 0.85rem;
  }

  .comment-text {
    font-size: 0.85rem;
  }

  /* Chips */
  .chip {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  /* Breadcrumb/Back Button */
  .btn-back {
    font-size: 0.9rem;
  }
}

/* ===========================
   TABLET OPTIMIZATIONS
   =========================== */
@media (min-width: 481px) and (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .form-input,
  .form-textarea {
    padding: 12px 14px;
    font-size: 16px;
  }

  .feed-container {
    padding: 1rem;
    max-width: 100%;
  }

  .post-card {
    margin: 0;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .modal-content {
    max-width: 95%;
  }

  .profile-card {
    margin: -35px 1rem 0;
  }
}