/* Mobile-First Social Media Profile CSS */

/* CSS Variables for Mobile-First Design */
:root {
  --primary-color: #1DA1F2;
  --primary-dark: #1a91da; /* Added for hover states */
  --secondary-color: #657786;
  --accent-color: #FF6B6B;
  --success-color: #1DB954;
  --warning-color: #FFB020;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --text-primary: #14171a;
  --text-secondary: #536471;
  --text-muted: #8b98a5;
  --border-color: #e1e8ed;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 60px;
  --bottom-nav-height: 70px;
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);
}

/* Dark Mode Variables */
.dark {
  --bg-primary: #000000;
  --bg-secondary: #16181c;
  --bg-tertiary: #1e2328;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #8b98a5;
  --text-muted: #6e767d;
  --border-color: #2f3336;
  --shadow-sm: 0 1px 3px rgba(255, 255, 255, 0.1);
  --shadow-md: 0 4px 12px rgba(255, 255, 255, 0.15);
  --shadow-lg: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden;
  padding-top: calc(var(--header-height) + var(--safe-area-top));
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  min-height: 100vh;
  transition: var(--transition);
}

/* Mobile Header */
.header {
  position: fixed;
  top: var(--safe-area-top);
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.logo {
  height: 28px;
  width: auto;
}

.profile-menu-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.profile-menu-button:hover { /* Added hover for consistency */
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

.profile-menu-button:active {
  background: var(--bg-tertiary);
  transform: scale(0.95);
}

/* Profile Dropdown Menu (Kebab Menu) */
.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px); /* Below the header */
    right: 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color); /* Use variable */
    border-radius: var(--radius-md); /* Use variable */
    box-shadow: var(--shadow-lg); /* Use variable */
    z-index: 1001;
    min-width: 240px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0s linear 0.2s;
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s; /* Show instantly */
}

/* Remove unused dropdown-card related styles */
/* .profile-dropdown-menu .dropdown-card { ... } */
/* .profile-dropdown-menu.show .dropdown-card { ... } */
/* .dropdown-handle { ... } */

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px; /* Adjusted padding */
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px; /* Adjusted font size */
  font-weight: 500;
}

.profile-dropdown-item:hover { /* Added hover state */
    background: var(--bg-secondary);
}

.profile-dropdown-item:active {
  background: var(--bg-secondary);
}

.profile-dropdown-item i {
  width: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0; /* Adjusted margin */
}

.logout {
  color: var(--accent-color);
}

.logout i {
  color: var(--accent-color);
}

/* Main Content */
main {
  padding: 0 16px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notification (Re-aligned to global.css common elements) */
/* The .app-notification, #notification-message, .notification-close-btn are
   expected to be defined in global.css and use variables.
   Removed specific inline styles here if they are already in global.css. */


/* Mobile Profile Header (YouTube-Style) */
.profile-section-yt {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a91da 100%);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md); /* Added shadow for depth */
}

.profile-section-yt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1), transparent 50%);
  pointer-events: none;
}

.profile-header-content-yt {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.profile-pic-yt-container {
  position: relative;
  flex-shrink: 0;
}

.profile-pic-label-yt {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: block;
  transition: var(--transition);
}

.profile-pic-label-yt:hover .camera-icon-overlay-yt { /* Show camera on hover */
    opacity: 1;
}
.profile-pic-label-yt:active {
  transform: scale(0.95);
}

.profile-pic-yt {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
background: white;
}

.camera-icon-overlay-yt {
  position: absolute;
  top: 0; /* Cover the whole image */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Darker overlay */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px; /* Larger icon */
  border-radius: var(--radius-full);
  opacity: 0; /* Initially hidden */
  transition: opacity 0.2s ease;
}

.spinner-overlay-yt {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.spinner-yt {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile-text-details-yt {
  color: white;
  flex: 1;
  min-width: 0;
  text-align: left; /* Ensure text aligns left */
}

.profile-text-details-yt h2 {
  font-size: 22px; /* Slightly larger for display name */
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-text-details-yt p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 2px;
}

#userStatsYT {
  font-size: 13px; /* Slightly larger for stats */
  opacity: 0.8;
}

/* Main Profile Content (Bio, DOB, Social Links) */
.profile-content-main {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.profile-info-block h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.profile-info-block p {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.profile-page-actions-block {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center; /* Center buttons */
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  min-height: 44px;
}

.btn:hover { /* Added hover state */
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: scale(0.98);
}

.btn.edit-main {
  background: var(--primary-color);
  color: white;
}
.btn.edit-main:hover {
    background: var(--primary-dark);
}

.btn.share-main {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn.share-main:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

/* Social Links */
.social-links-list {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: flex-start; /* Default for a list, can be centered if needed */
}

.social-links-list a { /* Renamed from .social-link to .social-links-list a */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.social-links-list a:hover { /* Added hover state */
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.social-links-list a:active {
  background: var(--bg-tertiary);
  transform: scale(0.98);
}

/* Mobile Follow Stats Section */
.follow-stats-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.follow-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.follow-btn { /* This targets the follower/following count buttons */
  flex: 1;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.follow-btn:hover { /* Added hover state */
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.follow-btn:active {
  background: var(--bg-tertiary);
  transform: scale(0.98);
}

.follow-btn span {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

/* Remove unused .follow-btn-text */
/* .follow-btn-text { ... } */

/* Follow Lists */
.follow-list {
  margin-top: 16px; /* Adjusted margin */
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

.follow-list.hide {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.follow-list h4 {
  padding: 16px 20px 8px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  margin: 0;
}

.follow-list-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}

.follow-list-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.follow-list-item:last-child {
  border-bottom: none;
}

.follow-list-item:hover {
  background: var(--bg-tertiary);
}

.follow-list-item:active {
  background: var(--bg-tertiary);
}

.follow-list-item img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin-right: 12px;
  background-color: var(--bg-tertiary);
  flex-shrink: 0;
}

/* For the <a> tag inside follow-list-item */
.follow-user-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.follow-user-link .display-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-user-link .user-handle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: -4px;
}

/* Remove unused .follow-user-info and .follow-user-action */
/* .follow-user-info { ... } */
/* .follow-user-action { ... } */

/* Mobile Articles Section */
.articles-section {
  margin: 16px 0;
}

.articles-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding: 0 4px;
}

.articles-container {
  display: grid; /* Use grid for consistency with home page */
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Article Card Styling */
.article-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); /* Consistent with other cards */
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.article-card:active {
  transform: translateY(0);
}

.article-card .card-img {
  width: 100%;
  height: 190px; /* Consistent height */
  object-fit: cover;
  display: block;
  background: var(--bg-tertiary);
}

.article-card .card-body {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-body h4 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  align-items: center;
}

.article-card .badge {
  background: var(--secondary-color);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  text-transform: capitalize;
  font-weight: 500;
}

.article-card .badge.public {
  background-color: var(--success-color);
}

.article-card .badge.private {
  background-color: var(--accent-color);
}

/* Article Card Stats (Views and Comments) */
.article-card .card-stats {
    display: flex;
    justify-content: flex-end; /* Push counts to the right */
    gap: 12px; /* Space between view and comment count */
    margin-top: 12px; /* Space from card-meta */
    font-size: 0.85em;
    color: var(--text-secondary);
}

.article-card .card-stats .view-count,
.article-card .card-stats .comment-count {
    display: inline-flex;
    align-items: center;
    gap: 5px; /* Space between icon and number */
    background: var(--bg-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    color: var(--text-secondary); /* Ensure text color */
}
.article-card .card-stats .view-count i,
.article-card .card-stats .comment-count i {
    color: var(--text-muted); /* Icon color */
}
.article-card .card-stats .count-number {
    font-weight: 600;
}


/* Article Card Menu */
.article-card .card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.article-card .menu-toggle-btn {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.article-card .menu-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.article-card .menu-toggle-btn:active {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
}

.article-card .menu-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 150px;
  z-index: 11;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0s linear 0.2s;
}

.article-card .menu-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.article-card .menu-dropdown.hide {
  display: none;
}

.article-card .menu-dropdown .menu-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.article-card .menu-dropdown .menu-btn i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.article-card .menu-dropdown .menu-btn:hover {
  background: var(--bg-secondary);
}

.article-card .menu-dropdown .menu-btn:active {
  background: var(--bg-secondary);
}

.article-card .menu-dropdown hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

/* Share Overlay Styles (Copied into this file for consistency) */
.share-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 1005; opacity: 0; visibility: hidden; transition: opacity 0.3s ease-out, visibility 0s linear 0.3s; padding: 15px; box-sizing: border-box;
}
.share-overlay.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.share-content {
  background: var(--bg-primary); color: var(--text-primary); padding: 30px 25px; border-radius: var(--radius-xl); text-align: center; max-width: 95%; width: 400px; box-shadow: var(--shadow-lg); position: relative; transform: translateY(20px); opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease-out; overflow: hidden;
}
.share-overlay.show .share-content { transform: translateY(0); opacity: 1; }
body.dark .share-content { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-lg); }
.close-share-btn {
  position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 1.8em; cursor: pointer; color: var(--text-secondary); transition: color 0.2s ease, transform 0.2s ease; line-height: 1; padding: 5px; border-radius: var(--radius-full);
}
.close-share-btn:hover { color: var(--primary-color); transform: rotate(90deg); }
.close-share-btn:active { transform: scale(0.9); }
body.dark .close-share-btn { color: var(--text-secondary); }
body.dark .close-share-btn:hover { color: var(--primary-color); }
#qrCodeContainer {
  margin: 10px auto 20px auto; width: 160px; height: 160px; padding: 10px; background-color: #ffffff; border-radius: var(--radius-md); box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 3px 8px rgba(0,0,0,0.25); display: flex; justify-content: center; align-items: center; overflow: hidden; cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#qrCodeContainer:hover { transform: scale(1.05); box-shadow: inset 0 0 10px rgba(0,0,0,0.15), 0 6px 15px rgba(0,0,0,0.35); }
#qrCodeContainer img, #qrCodeContainer canvas { display: block !important; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; border-radius: 4px; object-fit: contain; }
#qrCodeContainer p { color: var(--text-muted); font-size: 0.8em; margin: auto; }
.share-profile-url-text {
  background: var(--bg-secondary); color: var(--text-secondary); padding: 12px; border-radius: var(--radius-lg); font-size: 0.85em; word-break: break-all; text-align: center; margin-bottom: 16px; border: 1px solid var(--border-color); font-family: 'Courier New', Courier, monospace; line-height: 1.4;
}
body.dark .share-profile-url-text { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border-color); }
.share-action-btn {
  width: 100%; padding: 14px; margin-bottom: 12px; border: none; border-radius: var(--radius-lg); font-weight: 600; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1em; min-height: 48px;
}
.share-action-btn { background: var(--primary-color); color: white; }
.share-action-btn:hover { background: var(--primary-dark); }
body.dark .share-action-btn { background: var(--primary-color); color: white; }
body.dark .share-action-btn:hover { background: var(--primary-dark); }
#copyLinkBtn { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); }
#copyLinkBtn:hover { background: var(--bg-tertiary); border-color: var(--primary-color); }
body.dark #copyLinkBtn { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border-color); }
body.dark #copyLinkBtn:hover { background: var(--bg-tertiary); border-color: var(--primary-color); }
.share-action-btn:active { transform: scale(0.98); }
.share-action-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.social-share-options {
  margin-top: 20px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; width: 100%;
}
.share-social-icon { font-size: 1.6em; color: white; text-decoration: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); transition: transform 0.2s ease, opacity 0.2s ease; }
.share-social-icon:hover { transform: translateY(-2px); opacity: 0.9; }
.share-social-icon:active { transform: scale(0.9); opacity: 1; }
.social-share-options .whatsapp { background: #25D366; }
.social-share-options .facebook { background: #1877F2; }
.social-share-options .twitter { background: #1DA1F2; }
.social-share-options .linkedin { background: #0A66C2; }
.social-share-options .telegram { background: #0088CC; }
.social-share-options .email { background: #EA4335; }
button.share-social-icon { border: none; padding: 0; background: #6c757d; }
button.share-social-icon:hover { background: #5a6268; }
body.dark button.share-social-icon { background: #555; }
body.dark button.share-social-icon:hover { background: #666; }


/* Loading States */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
  color: transparent;
  user-select: none;
}

/* Skeleton for Article Card Image */
.skeleton-img {
  background-color: var(--bg-tertiary);
  width: 100%;
  height: 190px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Skeleton for general text lines */
.skeleton-text {
  background-color: var(--bg-tertiary);
  height: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.skeleton-text.long { width: 95%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.short { width: 40%; }
.skeleton-text.very-short { width: 25%; }

/* Skeleton for round profile pics */
.skeleton-text.small-round {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    background-color: var(--bg-tertiary);
}


/* Skeleton for card body content */
.article-card.skeleton .card-body {
    padding: 16px;
}

/* Skeleton for card meta (date, visibility badge) */
.article-card.skeleton .card-meta {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    align-items: center;
    margin-top: 0; /* Remove default margin from skeleton-text */
    margin-bottom: 8px; /* Add margin below meta */
}
.article-card.skeleton .card-meta .skeleton-text { /* Specific text lines within meta */
    height: 12px;
    width: 50px;
}


/* Skeleton for views/comments stats */
.article-card.skeleton .card-stats-skeleton {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}
.article-card.skeleton .card-stats-skeleton .skeleton-text {
    width: 60px;
    height: 24px;
    border-radius: var(--radius-lg);
}


/* Utility Classes */
.hide {
  display: none !important;
}

.text-center {
  text-align: center;
}

.btn {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.98);
}

/* Safe Area Adjustments for iOS */
@supports (padding: max(0px)) {
  .header {
    padding-top: max(12px, var(--safe-area-top));
  }
  
  body { /* Adjusted for correct header height calculation with safe area */
    padding-top: calc(var(--header-height) + max(0px, var(--safe-area-top)));
    padding-bottom: calc(var(--bottom-nav-height) + max(0px, var(--safe-area-bottom)));
  }

  .bottom-nav {
    padding-bottom: max(8px, var(--safe-area-bottom));
  }

  .app-notification { /* Adjust notification position based on bottom nav and safe area */
      bottom: calc(var(--bottom-nav-height) + max(0px, var(--safe-area-bottom)) + 16px); /* 16px margin from nav */
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
button:focus,
a:focus,
input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
  }
  
  .dark {
    --border-color: #ffffff;
  }
}

/* Responsive Design - Tablet and Desktop */
@media (min-width: 768px) {
  main {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
  }
  
  /* Profile Section - Layout change for larger screens */
  .profile-section {
    flex-direction: row;
    text-align: left;
    padding: 32px 24px;
  }
  
  .profile-section .profile-info {
    align-items: flex-start;
  }

  .profile-section .profile-pic {
    margin-right: 20px;
  }

  .profile-info h2, .profile-info p {
    text-align: left;
  }
  
  .social-links { /* The element is .social-links-list */
    justify-content: flex-start;
  }

  .profile-actions-buttons {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  
  .follow-stats-section {
    padding: 24px;
  }
  
  .articles-container {
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .article-card .card-body {
    padding: 20px;
  }
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0; /* No bottom nav, so remove padding */
  }
  
  main {
    max-width: 900px;
  }

  .articles-container {
      grid-template-columns: repeat(3, 1fr);
  }
}