:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent: #00d4ff;
  --accent-hover: #00b8e6;
  --border: #333;
  --shadow: rgba(0, 0, 0, 0.5);
  --success: #00ff88;
  --error: #ff4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Header */
header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.admin-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Login Screen */
.login-container {
  max-width: 450px;
  margin: 6rem auto;
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: center;
  animation: fadeIn 0.8s ease;
}

.login-container h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.login-container p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.admin-panel {
  animation: fadeIn 0.8s ease;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.user-details {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.user-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.user-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Upload Section */
.upload-section {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 3rem;
}

.upload-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  cursor: pointer;
}

.file-input-wrapper input[type="file"]::file-selector-button {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.file-input-wrapper input[type="file"]::file-selector-button:hover {
  background: var(--accent-hover);
}

.preview-container {
  margin-top: 1rem;
  text-align: center;
  display: none;
}

.preview-container img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.upload-progress {
  margin-top: 1rem;
  display: none;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: #cc0000;
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

/* GIF Management */
.gif-management h2 {
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.gif-list {
  display: grid;
  gap: 1.5rem;
}

.gif-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.3s ease;
}

.gif-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gif-thumbnail {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.gif-item-info h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.gif-item-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.gif-item-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

.gif-item-link:hover {
  text-decoration: underline;
}

.gif-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

/* Loading & Empty States */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.spinner {
  border: 3px solid var(--bg-secondary);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
}

.success-message {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 12px var(--shadow);
  animation: slideInRight 0.3s ease;
  z-index: 1000;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .gif-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .gif-thumbnail {
    margin: 0 auto;
  }
  
  .gif-item-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .toast {
    left: 1rem;
    right: 1rem;
  }
}