/* ===========================
   PROFILE PAGE - MODERN UI
   Priodemy Learning Platform
   =========================== */

:root {
  --primary: #d1039e;
  --primary-dark: #7a0060;
  --primary-light: rgba(209, 3, 158, 0.1);
  --primary-glow: rgba(209, 3, 158, 0.25);
  --html-color: #e34c26;
  --css-color: #264de4;
  --js-color: #f0db4f;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* Profile Main */
.profile-main {
  min-height: calc(100vh - 90px);
  background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 25%, #fdf2f8 50%, #f5f3ff 75%, #fafbff 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  padding: 0;
  position: relative;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Loading State */
.profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 24px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-right-color: rgba(209, 3, 158, 0.3);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login Required */
.login-required {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--card-shadow);
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.login-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 24px;
}

.login-card h2 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.login-card p {
  color: #666;
  margin-bottom: 32px;
  line-height: 1.6;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.3s ease;
}

.google-signin-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.google-signin-btn img {
  width: 24px;
  height: 24px;
}

/* Profile Container */
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Profile Header Section */
.profile-header-section {
  position: relative;
  margin-bottom: 40px;
  background: white;
  border-radius: 0 0 24px 24px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.profile-cover-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.profile-header-content {
  padding: 0 40px 40px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: flex-end;
}

/* Profile Avatar */
.profile-avatar-section {
  margin-top: -80px;
  position: relative;
  z-index: 2;
}

.profile-avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: white;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.profile-avatar-large {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
}

.profile-avatar-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  border: 4px solid white;
}

.change-avatar-btn {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(209, 3, 158, 0.3);
}

.profile-avatar-section:hover .change-avatar-btn {
  opacity: 1;
  bottom: -8px;
}

/* Profile Header Info */
.profile-header-info h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.profile-header-info p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 16px;
}

.profile-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.profile-badge.member {
  background: var(--primary-light);
  color: var(--primary);
}

.profile-badge.streak {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
}

/* Quick Stats */
.profile-quick-stats {
  display: flex;
  gap: 32px;
  padding: 24px 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  align-self: center;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.quick-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.quick-stat-label {
  font-size: 0.875rem;
  color: #666;
  white-space: nowrap;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 8px;
  padding: 0 40px;
  margin-bottom: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.profile-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.profile-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(209, 3, 158, 0.3);
}

.profile-tab i {
  font-size: 1rem;
}

/* Tab Content */
.profile-tab-content {
  padding: 0 40px 40px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.profile-grid .full-width {
  grid-column: 1 / -1;
}

/* Profile Card */
.profile-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.profile-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.profile-card-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-card-header h3 i {
  color: var(--primary);
  font-size: 1.25rem;
}

.edit-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-btn:hover {
  background: var(--primary);
  color: white;
}

.view-all-link {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.view-all-link:hover {
  opacity: 0.7;
}

/* About Content */
.about-content {
  color: #666;
  line-height: 1.8;
}

.about-empty {
  color: #999;
  font-style: italic;
}

/* Info Rows */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-size: 0.9375rem;
  font-weight: 500;
}

.info-label i {
  color: var(--primary);
  width: 20px;
}

.info-value {
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.9375rem;
}

.info-id {
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  color: #999;
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--glass-bg);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: var(--primary-light);
  transform: translateX(4px);
}

.activity-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.activity-icon.html {
  background: rgba(227, 76, 38, 0.1);
  color: var(--html-color);
}

.activity-icon.css {
  background: rgba(38, 77, 228, 0.1);
  color: var(--css-color);
}

.activity-icon.js {
  background: rgba(240, 219, 79, 0.2);
  color: #c29d00;
}

.activity-details {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.activity-meta {
  font-size: 0.875rem;
  color: #666;
}

/* Course Progress List */
.course-progress-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.course-progress-item {
  padding: 20px;
  background: var(--glass-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.course-progress-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(209, 3, 158, 0.1);
}

.course-progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.course-progress-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.course-progress-icon.html {
  background: rgba(227, 76, 38, 0.1);
  color: var(--html-color);
}

.course-progress-icon.css {
  background: rgba(38, 77, 228, 0.1);
  color: var(--css-color);
}

.course-progress-icon.javascript {
  background: rgba(240, 219, 79, 0.2);
  color: #c29d00;
}

.course-progress-info h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.course-progress-meta {
  font-size: 0.875rem;
  color: #666;
}

.course-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.course-progress-fill.html {
  background: linear-gradient(90deg, #e34c26 0%, #c43516 100%);
}

.course-progress-fill.css {
  background: linear-gradient(90deg, #264de4 0%, #1a3bb8 100%);
}

.course-progress-fill.javascript {
  background: linear-gradient(90deg, #f0db4f 0%, #c2af00 100%);
}

.course-progress-percent {
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--glass-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.875rem;
  color: #666;
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--glass-bg);
  border-radius: 16px;
  border: 2px solid var(--glass-border);
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.achievement-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.achievement-item.locked .achievement-icon {
  background: #e5e7eb;
  color: #9ca3af;
}

.achievement-name {
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  font-size: 0.9375rem;
}

.achievement-desc {
  font-size: 0.8125rem;
  color: #666;
  line-height: 1.4;
}

/* Settings */
.setting-group {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-size: 0.9375rem;
}

.settings-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.settings-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.settings-input:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.setting-group small {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: #666;
}

.save-settings-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.save-settings-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(209, 3, 158, 0.3);
}

/* Setting Item */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.setting-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.setting-info p {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e7eb;
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Danger Zone */
.danger-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.danger-btn {
  width: 100%;
  padding: 14px 24px;
  background: white;
  color: var(--danger);
  border: 2px solid var(--danger);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.danger-btn:hover {
  background: var(--danger);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}

.empty-state i {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 1rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .profile-header-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 24px 32px;
  }

  .profile-quick-stats {
    justify-content: space-between;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .profile-tabs {
    padding: 0 24px;
  }

  .profile-tab-content {
    padding: 0 24px 32px;
  }
}

@media (max-width: 768px) {
  .profile-cover {
    height: 160px;
  }

  .profile-avatar-wrapper {
    width: 120px;
    height: 120px;
  }

  .profile-avatar-section {
    margin-top: -60px;
  }

  .profile-header-info h1 {
    font-size: 1.5rem;
  }

  .profile-quick-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .profile-tabs {
    padding: 0 16px;
    gap: 6px;
  }

  .profile-tab {
    padding: 10px 16px;
    font-size: 0.875rem;
  }

  .profile-tab-content {
    padding: 0 16px 24px;
  }

  .profile-card {
    padding: 20px;
  }

  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .profile-header-content {
    padding: 0 16px 24px;
  }

  .profile-avatar-wrapper {
    width: 100px;
    height: 100px;
  }

  .profile-avatar-section {
    margin-top: -50px;
  }

  .profile-header-info h1 {
    font-size: 1.25rem;
  }

  .profile-quick-stats {
    padding: 16px 20px;
  }

  .quick-stat-value {
    font-size: 1.5rem;
  }

  .quick-stat-label {
    font-size: 0.75rem;
  }

  .profile-tab {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }

  .profile-card-header h3 {
    font-size: 1rem;
  }
}
