/* ============================================
   Cloud Hidden Treasures — CSS Design System
   Dark tech / cloud-punk aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  /* Color palette */
  --primary: #1A6FD4;
  --primary-dark: #0D47A1;
  --accent-gold: #F5A623;
  --accent-cyan: #00B4D8;

  --bg-dark: #0A0A0F;
  --bg-card: #111827;
  --bg-surface: #1C2536;

  --text-primary: #FFFFFF;
  --text-muted: #94A3B8;
  --border: #2D3E57;

  --success: #10B981;
  --error: #EF4444;

  /* Effects */
  --glow-primary: 0 0 20px rgba(26, 111, 212, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Base Styles
   ============================================ */

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

html, body {
  height: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 3rem;
  text-shadow: 0 0 20px rgba(26, 111, 212, 0.5);
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.app-title-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  text-align: right;
  margin-bottom: 1rem;
  letter-spacing: 0;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ============================================
   Layout Containers
   ============================================ */

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0D1520 100%);
  position: relative;
  overflow-x: hidden;
}

.page-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(26, 111, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 180, 216, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: backgroundShift 20s ease-in-out infinite;
}

.page-container::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(0deg, transparent 24%, rgba(26, 111, 212, 0.05) 25%, rgba(26, 111, 212, 0.05) 26%, transparent 27%, transparent 74%, rgba(26, 111, 212, 0.05) 75%, rgba(26, 111, 212, 0.05) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, rgba(26, 111, 212, 0.05) 25%, rgba(26, 111, 212, 0.05) 26%, transparent 27%, transparent 74%, rgba(26, 111, 212, 0.05) 75%, rgba(26, 111, 212, 0.05) 76%, transparent 77%, transparent);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
  animation: gridMove 8s linear infinite;
  opacity: 0.3;
}

/* Tech Particles */
.page-container .particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: rgba(26, 111, 212, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 10px rgba(26, 111, 212, 0.8);
}

/* Floating orbs */
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(-50px, -50px) scale(1.5); opacity: 0.6; }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  50% { transform: translate(60px, 40px) scale(1.3); opacity: 0.5; }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
  50% { transform: translate(-40px, 50px) scale(1.4); opacity: 0.55; }
}

@keyframes float4 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  50% { transform: translate(50px, -40px) scale(1.3); opacity: 0.5; }
}

/* Grid animation */
@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* Background shift */
@keyframes backgroundShift {
  0%, 100% {
    background-image:
      radial-gradient(circle at 20% 50%, rgba(26, 111, 212, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(0, 180, 216, 0.05) 0%, transparent 50%);
  }
  50% {
    background-image:
      radial-gradient(circle at 80% 30%, rgba(26, 111, 212, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 20% 70%, rgba(0, 180, 216, 0.08) 0%, transparent 50%);
  }
}

/* Pulsing glow orbs */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(26, 111, 212, 0.4), 0 0 40px rgba(26, 111, 212, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(26, 111, 212, 0.8), 0 0 80px rgba(26, 111, 212, 0.4);
  }
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 4s ease-in-out infinite;
}

.glow-orb-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  left: 10%;
  background: radial-gradient(circle, rgba(26, 111, 212, 0.2) 0%, transparent 70%);
  animation: float1 8s ease-in-out infinite, pulseGlow 4s ease-in-out infinite;
}

.glow-orb-2 {
  width: 250px;
  height: 250px;
  top: 50%;
  right: 5%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.15) 0%, transparent 70%);
  animation: float2 10s ease-in-out infinite, pulseGlow 5s ease-in-out infinite;
}

.glow-orb-3 {
  width: 200px;
  height: 200px;
  bottom: -100px;
  left: 50%;
  background: radial-gradient(circle, rgba(26, 111, 212, 0.15) 0%, transparent 70%);
  animation: float3 12s ease-in-out infinite, pulseGlow 6s ease-in-out infinite;
}

.glow-orb-4 {
  width: 280px;
  height: 280px;
  top: 30%;
  left: 5%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.1) 0%, transparent 70%);
  animation: float4 9s ease-in-out infinite, pulseGlow 7s ease-in-out infinite;
}

.content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow-lg), var(--glow-primary);
  max-width: 600px;
  width: 100%;
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 40px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-email {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

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

/* ============================================
   Form Elements
   ============================================ */

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.input-field,
textarea,
input[type="email"],
input[type="tel"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-field:focus,
textarea:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.1);
  background: var(--bg-surface);
}

.input-field:disabled,
input:disabled {
  background: #0F1419;
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-field::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

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

.char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: right;
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.show {
  display: block;
}

.input-field.error,
textarea.error,
input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--glow-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(26, 111, 212, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #0D2654;
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover {
  background: rgba(26, 111, 212, 0.1);
  border-color: var(--primary);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
}

.btn-full {
  width: 100%;
}

.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   File Upload
   ============================================ */

.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(26, 111, 212, 0.02);
}

.file-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(26, 111, 212, 0.05);
}

.file-upload-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 180, 216, 0.1);
}

.file-upload-zone input {
  display: none;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
  color: var(--success);
}

.file-info-name {
  flex: 1;
}

.file-info-size {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-gold {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ============================================
   Notifications
   ============================================ */

.notification {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: none;
}

.notification.show {
  display: block;
}

.notification-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.notification-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.notification-warning {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================
   Modals & Dialogs
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-body {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.4s ease;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Submission Cards
   ============================================ */

.submission-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.submission-card:hover {
  box-shadow: var(--glow-primary);
  border-color: var(--primary);
}

.submission-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.submission-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.submission-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.submission-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.submission-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================
   Edit Panel
   ============================================ */

.edit-panel {
  background: rgba(26, 111, 212, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  display: none;
  animation: slideUp 0.3s ease;
}

.edit-panel.show {
  display: block;
}

.edit-panel-section {
  margin-bottom: 1.5rem;
}

.edit-panel-section:last-child {
  margin-bottom: 0;
}

.edit-panel-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 10;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }

  .content {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  .submission-header {
    flex-direction: column;
  }

  .submission-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-content {
    max-width: 90%;
  }
}
