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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 5px;
}

header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 20px;
}

header nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

header nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background 0.3s;
}

header nav a:hover,
header nav a.active {
  background: rgba(255,255,255,0.2);
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  border: 1px solid white;
  color: white;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.3);
}

/* Main Content */
main {
  padding: 40px 0;
  min-height: calc(100vh - 300px);
}

/* Intro Section */
.intro {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.intro h2 {
  color: #667eea;
  margin-bottom: 15px;
}

.intro p {
  color: #666;
  font-size: 1.1rem;
}

/* Cases Section */
.cases-section h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.case-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.case-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.case-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.case-card .no-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.case-card .case-content {
  padding: 20px;
}

.case-card .case-title {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 10px;
}

.case-card .case-position {
  color: #667eea;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.case-card .case-description {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.case-card .case-treatment {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 5px;
  font-size: 0.9rem;
  color: #555;
}

.case-card .case-treatment strong {
  color: #667eea;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 1.2rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

/* Login Section */
.login-section {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.login-section h2 {
  text-align: center;
  color: #667eea;
  margin-bottom: 30px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
}

.login-form .btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.login-form .btn-primary:hover {
  transform: scale(1.02);
}

.login-form .hint {
  text-align: center;
  margin-top: 15px;
  color: #999;
  font-size: 0.9rem;
}

/* Admin Panel */
.admin-panel {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.panel-header h2 {
  color: #333;
}

.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-danger {
  padding: 6px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-edit {
  padding: 6px 12px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 5px;
}

.btn-edit:hover {
  background: #218838;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  color: #667eea;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.current-image {
  margin-top: 10px;
}

.current-image img {
  max-width: 200px;
  border-radius: 5px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

/* Admin Cases List */
.admin-cases-list {
  display: grid;
  gap: 20px;
}

.admin-case-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: center;
}

.admin-case-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
  background: #ddd;
}

.admin-case-item .no-image {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.admin-case-item .case-info {
  flex: 1;
}

.admin-case-item .case-info h4 {
  color: #333;
  margin-bottom: 8px;
}

.admin-case-item .case-info p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.admin-case-item .case-actions {
  display: flex;
  gap: 10px;
}

/* Footer */
footer {
  background: #333;
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}

footer p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

  .admin-case-item {
    flex-direction: column;
    text-align: center;
  }

  .admin-case-item .case-actions {
    justify-content: center;
  }

  .panel-header {
    flex-direction: column;
    gap: 15px;
  }
}
