/* ========== GLOBAL STYLES ========== */
:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --accent: #0ea5e9;
  --text: #e2e8f0;
  --error: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  text-align: center;
}

/* ========== THREE.JS BACKGROUND ========== */
#threeCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#pagesChart,
#submissionChart,
#visitorChart,
#three-container,
#sphere-container,
#torus-container {
  width: 100% !important;
  height: 100% !important;
  background: var(--bg-dark);
  border-radius: 4px;
}

/* ========== LAYOUT STRUCTURE ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== HEADER & NAVIGATION ========== */

header, main, form, footer {
  position: relative;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin-left: 2rem;
}

.profile-info {
  flex: 1;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-img {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
  }
  
  .profile-info {
    width: 100%;
  }
  
  .admin-container {
    grid-template-columns: 1fr;
  }
  
  .analytics-container {
    grid-template-columns: 1fr;
  }
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: slideDown 1s ease-out;
}

p {
  font-size: 1.2rem;
  margin: auto;
  animation: fadeIn 1s ease-out 0.5s forwards;
  opacity: 0;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.btn {
  margin-top: 2rem;
  background: linear-gradient(to right, var(--success), var(--accent));
  padding: 1rem 2rem;
  font-size: 1rem;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s;
}

.btn:hover {
  transform: scale(1.05);
}

canvas {
  display: block;
  margin: auto;
  height: 500px;
}

/* ========== MAIN CONTENT SECTIONS ========== */

section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  color: var(--text);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

section h2 {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

section h2 i {
  margin-right: 0.75rem;
  color: var(--accent);
}

/* ========== FORM STYLES ========== */

form {
  margin: 2rem auto;
  padding: 2rem;
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

form h2 {
  margin-bottom: 1.5rem;
}

form input, form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--text);
}

form button[type="submit"] {
  background: linear-gradient(to right, var(--success), var(--accent));
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

footer {
  padding: 2rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.summary-content {
  line-height: 1.7;
  text-align: left;
  padding-left: 1.5rem;
}

.summary-content p {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.summary-content p::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.skills ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.skills li {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.75rem;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.skills li:hover {
  transform: translateY(-3px);
}

.experience-item, .education-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.experience-item:last-child, .education-item:last-child {
  border-bottom: none;
}

.experience-item h3, .education-item h3 {
  color: #f8fafc;
  margin-bottom: 0.25rem;
}

.experience-date, .education-date {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.experience-description, .education-description {
  color: #e2e8f0;
  line-height: 1.6;
}

.certification-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.certification-item:last-child {
  border-bottom: none;
}

.certification-item h3 {
  color: #f8fafc;
  margin-bottom: 0.25rem;
}

.certification-date {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ========== ADMIN PANEL STYLES ========== */
/* Header & Navigation */
.header {
  background: var(--bg-card);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 60px);
}

.sidebar {
  background: var(--bg-card);
  padding: 1.5rem;
}

.main-content {
  padding: 1.5rem;
}

/* Cards & Widgets */
.card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: calc(100% - 3rem);
}

/* Dashboard */
.dashboard-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

/* Analytics */
.analytics-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.chart-container {
  position: relative;
  min-height: 300px;
  height: 300px; /* Fixed height */
  width: 100%;
  /* background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px; */
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-img {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
  }
  
  .admin-container {
    grid-template-columns: 1fr;
  }
  
  .analytics-container,
  .dashboard-container {
    grid-template-columns: 1fr;
  }
    
  .card {
      width: calc(100% - 2rem);
  }
}

/* ========== ANALYTICS SPECIFIC STYLES ========== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: rgba(14, 165, 233, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.metric-label {
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Chart container adjustments */
.chart-container {
  position: relative;
  min-height: 300px;
}

/* ========== ADMIN SIDEBAR STYLES ========== */
.sidebar {
  background: var(--bg-card);
  padding: 1.5rem;
  height: 100%;
  position: sticky;
  top: 60px;
}

.nav-links {
  list-style: none;
  display: block;
  padding: 0.5rem 0;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-links li a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.nav-links li a:hover {
  background: rgba(14, 165, 233, 0.2);
}

.nav-links li a.active {
  background: rgba(14, 165, 233, 0.3);
  font-weight: 600;
}

.nav-links li a i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

.logout-btn {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.logout-btn:hover {
  text-decoration: underline;
}

/* ========== UTILITY CLASSES ========== */
.error-message {
  color: var(--error);
  margin-bottom: 1rem;
}

.success-message {
  color: var(--success);
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
