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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

a {
  color: #0a66c2;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========== LAYOUT ========== */
.container {
  max-width: 600px;
  margin: 20px auto;
  padding: 0 15px;
}

/* ========== NAVBAR ========== */
.navbar {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 10px;
}

.navbar h1 {
  font-size: 20px;
  font-weight: bold;
  white-space: nowrap;
}

.navbar .search-form {
  flex: 1;
  min-width: 120px;
}

.navbar .search-form input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
}

.navbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.navbar-right a,
.navbar-right button {
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.btn-login {
  background: #e4e6eb;
  color: #050505;
}

.btn-signup {
  background: #0a66c2;
  color: white;
}

.btn-logout {
  background: #e4e6eb;
  color: #050505;
}

/* ========== ALERTS ========== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}

.alert-error {
  background: #fee;
  color: #c00;
  border-left: 4px solid #c00;
}

.alert-success {
  background: #efe;
  color: #060;
  border-left: 4px solid #060;
}

/* ========== CARDS & POSTS ========== */
.card {
  background: white;
  padding: 15px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.post-composer {
  margin-bottom: 15px;
}

.post-composer textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  font-size: 15px;
}

.post-composer .composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.post-composer .composer-actions button,
.post-composer .composer-actions .image-btn {
  padding: 8px 14px;
  background: #e4e6eb;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

.post-composer .composer-actions .image-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-composer .composer-actions .image-btn:hover {
  background: #d0d2d7;
}

.post-composer .composer-actions button.publish-btn {
  background: #0a66c2;
  color: white;
  margin-left: auto;
}

.post-composer .album-select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 13px;
  flex: 1;
  min-width: 100px;
}

.composer-album-name {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 13px;
  width: 100%;
  margin-top: 5px;
}

/* Post header */
.post-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
}

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

.post-author {
  font-weight: bold;
  color: #0a66c2;
  word-break: break-word;
}

.post-time {
  font-size: 12px;
  color: #65676b;
}

.post-content {
  margin-bottom: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-image-link {
  display: block;
}

.post-image {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

.album-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 13px;
  color: #0a66c2;
  font-weight: bold;
}

.album-link:hover {
  text-decoration: underline;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

.post-actions button {
  padding: 6px 12px;
  background: #e4e6eb;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.post-actions button:hover {
  background: #d0d2d7;
}

.post-actions button.danger-btn {
  background: #fee;
  color: #c00;
}

.post-actions button.danger-btn:hover {
  background: #fdd;
}

.comment {
  background: #f0f2f5;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
  position: relative;
  word-wrap: break-word;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author {
  font-weight: bold;
  font-size: 13px;
}

.comment-delete {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.comment-delete:hover {
  background: #ddd;
  color: #c00;
}

.comment-form {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.comment-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  min-width: 0;
}

.comment-form button {
  padding: 8px 16px;
  background: #e4e6eb;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.user-profile {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-profile a {
  color: #0a66c2;
  font-size: 13px;
}

/* ========== PROFILE HEADER ========== */
.header {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 20px 15px;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 15px;
  align-items: center;
}

.header-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
}

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

.header-info h1 {
  font-size: 24px;
  margin-bottom: 5px;
  word-break: break-word;
}

.header-info .username {
  color: #65676b;
  font-size: 14px;
  margin-bottom: 10px;
}

.header-info .bio {
  margin-bottom: 10px;
  color: #050505;
  word-wrap: break-word;
}

.header-stats {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #65676b;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-weight: bold;
  color: lightblue !important;
  font-size: 16px;
}

/* ========== PROFILE TABS ========== */
.tabs {
  display: flex;
  gap: 8px;
  margin: 15px auto;
  max-width: 600px;
  padding: 0 15px;
}

.tab-link {
  padding: 8px 16px;
  border-radius: 20px;
  color: #0a66c2;
  background: #e4e6eb;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

.tab-link.active {
  background: #0a66c2;
  color: white;
}

/* ========== PHOTOS TAB (ALBUMS) ========== */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.album-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.album-card:hover {
  transform: scale(1.02);
}

.album-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.album-card .album-name {
  padding: 8px;
  font-weight: bold;
  font-size: 13px;
  word-break: break-word;
}

.empty-state {
  text-align: center;
  padding: 30px 15px;
  color: #65676b;
}

.empty-state p {
  font-size: 16px;
}

/* ========== ALBUM VIEWER ========== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.album-grid .grid-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #e4e6eb;
  cursor: pointer;
  transition: transform 0.2s;
}

.album-grid .grid-item:hover {
  transform: scale(1.02);
}

.album-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.grid-item .caption {
  padding: 8px;
  font-size: 13px;
  color: #050505;
  word-break: break-word;
}

/* ========== FORMS (login, register, settings) ========== */
.form-container {
  background: white;
  padding: 30px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.form-container h1 {
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: bold;
}

.subtitle {
  color: #65676b;
  margin-bottom: 25px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #050505;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0a66c2;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.1);
}

button {
  padding: 10px 20px;
  background: #0a66c2;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap;
}

button:hover {
  background: #084ba0;
}

button.danger {
  background: #d32f2f;
}

button.danger:hover {
  background: #b71c1c;
}

.footer {
  text-align: center;
  margin-top: 20px;
  color: #65676b;
  font-size: 14px;
}

.footer a {
  color: #0a66c2;
  display: block;
  margin-top: 8px;
}

/* ========== SETTINGS SPECIFIC ========== */
.settings-wrapper {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 15px;
  max-width: 800px;
  margin: 15px auto;
  padding: 0 15px;
}

.sidebar {
  background: white;
  padding: 15px;
  border-radius: 8px;
  height: fit-content;
}

.sidebar a {
  display: block;
  padding: 10px 12px;
  color: #0a66c2;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 5px;
  font-size: 14px;
}

.sidebar a:hover {
  background: #f0f2f5;
}

.sidebar a.active {
  background: #dbeafe;
  font-weight: bold;
}

.content {
  background: white;
  padding: 25px;
  border-radius: 8px;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  display: block;
}

.two-fa-status {
  padding: 15px;
  background: #f0f2f5;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.two-fa-status.enabled {
  background: #efe;
}

.two-fa-status.disabled {
  background: #fee;
}

.delete-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.delete-section h3 {
  color: #d32f2f;
  margin-bottom: 15px;
}

.checkbox-group {
  margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
}

.checkbox-group label {
  display: inline;
  margin-bottom: 0;
}

/* ========== SETUP PAGE ========== */
.setup-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.setup-avatar-grid .avatar-option {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  text-align: center;
  padding: 5px;
  transition: border-color 0.2s;
}

.setup-avatar-grid .avatar-option:hover {
  border-color: #0a66c2;
}

.setup-avatar-grid .avatar-option.selected {
  border-color: #0a66c2;
  background: #dbeafe;
}

.setup-avatar-grid img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
}

.setup-avatar-grid .avatar-name {
  font-size: 10px;
  margin-top: 4px;
  word-break: break-all;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 600px) {
  .container {
    margin: 10px auto;
    padding: 0 10px;
  }
  
  .navbar {
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  
  .navbar h1 {
    font-size: 18px;
  }
  
  .navbar .search-form {
    order: 3;
    flex-basis: 100%;
  }
  
  .navbar-right {
    gap: 5px;
  }
  
  .navbar-right a,
  .navbar-right button {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .card {
    padding: 12px;
    margin-bottom: 10px;
  }
  
  .post-composer textarea {
    min-height: 60px;
    font-size: 14px;
  }
  
  .post-composer .composer-actions {
    gap: 5px;
  }
  
  .post-composer .composer-actions button,
  .post-composer .composer-actions .image-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .post-composer .album-select {
    font-size: 12px;
    min-width: 80px;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .header-avatar {
    width: 80px;
    height: 80px;
  }
  
  .header-info h1 {
    font-size: 20px;
  }
  
  .settings-wrapper {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: flex;
    gap: 5px;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }
  
  .sidebar a {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .content {
    padding: 15px;
  }
  
  .form-container {
    padding: 20px 15px;
    max-width: 100%;
  }
  
  .form-container h1 {
    font-size: 24px;
  }
  
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
  
  .album-card img {
    height: 100px;
  }
  
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .album-grid img {
    height: 120px;
  }
  
  .post-actions button {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  .tabs {
    gap: 5px;
  }
  
  .tab-link {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .navbar h1 {
    font-size: 16px;
  }
  
  .navbar-right a,
  .navbar-right button {
    padding: 5px 8px;
    font-size: 11px;
  }
  
  .user-profile a {
    font-size: 12px;
  }
  
  .header-avatar {
    width: 60px;
    height: 60px;
  }
  
  .header-info h1 {
    font-size: 18px;
  }
  
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  
  .album-card img {
    height: 80px;
  }
}
/* ========== LIKE & REPOST BUTTONS ========== */
.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 10px;
    border-radius: 15px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.like-btn:hover {
    background: #fee;
}

.like-btn.liked {
    color: #e0245e;
}

.like-btn .like-count {
    font-size: 13px;
    font-weight: bold;
}

.repost-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 10px;
    border-radius: 15px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.repost-btn:hover {
    background: #e8f5e9;
}

.repost-indicator {
    font-size: 12px;
    color: #65676b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.repost-indicator a {
    color: #0a66c2;
    font-weight: bold;
}

/* ========== FOLLOW BUTTON ========== */
.follow-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.follow-btn.follow {
    background: #0a66c2;
    color: white;
}

.follow-btn.follow:hover {
    background: #084ba0;
}

.follow-btn.following {
    background: #e4e6eb;
    color: #050505;
}

.follow-btn.following:hover {
    background: #d0d2d7;
}

.follow-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.follow-stat {
    font-size: 14px;
    color: #65676b;
}

.follow-stat a {
    color: #0a66c2;
    text-decoration: none;
}

.follow-stat a:hover {
    text-decoration: underline;
}

.follow-stat strong {
    color: #050505;
}

/* ========== HASHTAG SIDEBAR ========== */
.layout-with-sidebar {
    display: flex;
    gap: 20px;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
    align-items: flex-start;
}

.hashtag-sidebar {
    width: 250px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 15px;
    position: sticky;
    top: 70px;
    flex-shrink: 0;
}

.hashtag-sidebar h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #050505;
}

.hashtag-sidebar .tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.hashtag-sidebar .tag-item:last-child {
    border-bottom: none;
}

.hashtag-sidebar .tag-item a {
    color: #0a66c2;
    text-decoration: none;
    font-weight: bold;
}

.hashtag-sidebar .tag-item a:hover {
    text-decoration: underline;
}

.tag-unfollow-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
}

.tag-unfollow-btn:hover {
    color: #c00;
}

.follow-tag-form {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

.follow-tag-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 13px;
}

.follow-tag-form button {
    padding: 8px 14px;
    background: #0a66c2;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.main-feed {
    flex: 1;
    min-width: 0;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
}

@media (max-width: 768px) {
    .layout-with-sidebar {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .hamburger-btn {
        display: block;
    }
    
    .hashtag-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 300;
        transition: left 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
        padding-top: 20px;
    }
    
    .hashtag-sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .main-feed {
        width: 100%;
    }
}

/* ========== FLOATING TAG BUTTON (MOBILE) ========== */
.floating-tag-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0a66c2;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 150;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.floating-tag-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .floating-tag-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hamburger-btn {
        display: block !important;
    }
}