/* Modern Design System for PicoShare */
:root {
  /* Color Palette */
  --primary: #6366f1; /* Indigo 500 */
  --primary-hover: #4f46e5; /* Indigo 600 */
  --primary-light: #e0e7ff; /* Indigo 100 */
  
  --success: #10b981; /* Emerald 500 */
  --success-hover: #059669; /* Emerald 600 */
  
  --danger: #ef4444; /* Red 500 */
  --danger-hover: #dc2626; /* Red 600 */
  --danger-light: #fee2e2; /* Red 100 */
  
  --info: #3b82f6; /* Blue 500 */
  
  --background: #f8fafc; /* Slate 50 */
  --surface: #ffffff;
  --surface-alt: #f1f5f9; /* Slate 100 */
  
  --text-main: #1e293b; /* Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  --text-on-primary: #ffffff;
  
  --border: #e2e8f0; /* Slate 200 */
  --border-focus: #6366f1;
  
  /* Spacing & Sizing */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--background);
  background-image: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

h1 { font-size: 2.25rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.875rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout */
.container {
  width: 100%;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

p, ul, article, form {
  max-width: 70ch;
}

.content {
  padding: 2rem 0;
}

/* Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
}

.navbar-brand a {
  color: var(--text-main);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-start, .navbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-item {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.navbar-item:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.navbar-item.has-dropdown {
  position: relative;
  cursor: pointer;
}

.navbar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  margin-top: 0.5rem;
}

.navbar-dropdown::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.navbar-item.has-dropdown:hover .navbar-dropdown {
  display: flex;
}

.navbar-burger {
  display: none; /* Hidden on desktop by default */
}

/* Mobile Nav (Simple override for now) */
@media (max-width: 768px) {
  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  
  .navbar-menu.is-active {
    display: flex;
  }
  
  .navbar-burger {
    display: block;
    cursor: pointer;
    height: 3.25rem;
    width: 3.25rem;
    position: relative;
    margin-left: auto;
  }
  
  .navbar-burger span {
    background-color: currentColor;
    display: block;
    height: 1px;
    left: calc(50% - 8px);
    position: absolute;
    transform-origin: center;
    transition-duration: 86ms;
    width: 16px;
  }
  .navbar-burger span:nth-child(1) { top: calc(50% - 6px); }
  .navbar-burger span:nth-child(2) { top: calc(50% - 1px); }
  .navbar-burger span:nth-child(3) { top: calc(50% + 4px); }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  line-height: 1.5;
  gap: 0.5rem;
}

.button:hover {
  border-color: var(--text-muted);
  background-color: var(--surface-alt);
}

.button.is-primary {
  background-color: var(--primary);
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-color: transparent;
  color: var(--text-on-primary);
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.1);
}
.button.is-primary:hover {
  background-image: linear-gradient(135deg, var(--primary-hover) 0%, #4338ca 100%); /* Indigo 700 */
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4), 0 4px 6px -2px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.button.is-success {
  background-color: var(--success);
  border-color: var(--success);
  color: white;
}
.button.is-success:hover {
  background-color: var(--success-hover);
}

.button.is-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: white;
}
.button.is-danger:hover {
  background-color: var(--danger-hover);
}

.button.is-link {
  background-color: transparent;
  border-color: transparent;
  color: var(--primary);
}
.button.is-link:hover {
  background-color: var(--primary-light);
  text-decoration: none;
}

.button.is-light {
  background-color: var(--surface-alt);
  border-color: transparent;
  color: var(--text-main);
}

/* Forms */
.field {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.control {
  position: relative;
}

.input, .textarea, .select select {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.input:focus, .textarea:focus, .select select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.select {
  position: relative;
  display: inline-block;
  width: 100%;
}
.select::after {
  content: "↓";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checkbox {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.help {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

/* File Upload Component (Bulma replacement) */
.file {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface-alt);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 600px;
}

.file-label:hover, .file.accepting-drop .file-label {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.file-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
}
.file-label:hover .file-icon {
  color: var(--primary);
}

.file-label span.file-label {
  /* The text inside */
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  padding: 0;
  background: none;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
}

.table th, .table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background-color: var(--surface-alt);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: var(--surface-alt);
}

.is-vcentered {
  vertical-align: middle;
}

/* Messages / Alerts */
.message {
  background-color: var(--surface-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.message.is-primary {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary-hover);
}

.message.is-danger {
  background-color: var(--danger-light);
  border-color: var(--danger-light);
  color: var(--danger-hover);
}

.message-header {
  padding: 0.75rem 1rem;
  background-color: rgba(0,0,0,0.05);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-body {
  padding: 1rem;
}

/* Utilities */
.is-hidden { display: none !important; }
.is-invisible { visibility: hidden !important; }
.is-block { display: block !important; }
.is-flex { display: flex !important; }
.is-flex-direction-row { flex-direction: row !important; }

.mt-3 { margin-top: 0.75rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.mt-6 { margin-top: 3rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
.my-5 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-6 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }

.field.is-grouped {
  display: flex;
  gap: 0.5rem;
}
.is-justify-content-flex-end {
  justify-content: flex-end;
}

/* Specific Page Overrides */
#default-expiration {
  max-width: 9ch;
}

/* Progress Bar */
.progress {
  width: 100%;
  height: 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-alt);
  border: none;
  overflow: hidden;
}
.progress::-webkit-progress-bar {
  background-color: var(--surface-alt);
}
.progress::-webkit-progress-value {
  background-color: var(--primary);
  transition: width 0.2s;
}
.progress::-moz-progress-bar {
  background-color: var(--primary);
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltip-text {
  position: absolute;
  top: -9px;
  left: 150%;
  visibility: hidden;
  width: max-content;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
}

/* Delete button */
.delete {
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(10, 10, 10, 0.2);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-block;
  flex-grow: 0;
  flex-shrink: 0;
  font-size: 0;
  height: 20px;
  max-height: 20px;
  max-width: 20px;
  min-height: 20px;
  min-width: 20px;
  outline: none;
  position: relative;
  vertical-align: top;
  width: 20px;
}
.delete::before, .delete::after {
  background-color: white;
  content: "";
  display: block;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  transform-origin: center center;
}
.delete::before { height: 2px; width: 50%; }
.delete::after { height: 50%; width: 2px; }
.delete:hover { background-color: rgba(10, 10, 10, 0.3); }

/* Specific overrides for Picoshare */
#pastebox {
  width: 100%;
  min-height: 100px;
  border: 2px dashed var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius);
  resize: vertical;
}
#pastebox:focus {
  border-color: var(--primary);
  background: var(--surface);
}

/* Icons */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  width: 1.5rem;
}

.icon.is-small {
  height: 1rem;
  width: 1rem;
  font-size: 0.75rem;
}

/* Utility Additions */
.has-text-right {
  text-align: right !important;
}

.is-align-items-center {
  align-items: center !important;
}

.ml-2 { margin-left: 0.5rem !important; }
.mr-auto { margin-right: auto !important; }

.field.has-addons {
  display: flex;
  justify-content: flex-start;
}

.field.has-addons .control:not(:last-child) {
  margin-right: -1px;
}

.field.has-addons .control:first-child .input,
.field.has-addons .control:first-child .button,
.field.has-addons .control:first-child .select select {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.field.has-addons .control:last-child .input,
.field.has-addons .control:last-child .button,
.field.has-addons .control:last-child .select select {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}

.field.has-addons .control .button,
.field.has-addons .control .input,
.field.has-addons .control .select select {
  z-index: 1;
}
.field.has-addons .control .button:hover,
.field.has-addons .control .input:focus,
.field.has-addons .control .select select:focus {
  z-index: 2;
}

.button.is-static {
  background-color: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: none;
  pointer-events: none;
  cursor: default;
}

.button.is-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Box / Card */
.box {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Guest Links Table Styles */
.deleted-entry {
  text-decoration: line-through;
  color: var(--text-muted);
  visibility: collapse;
  opacity: 0;
}

.table tr {
  transition: all 0.3s ease-out;
}

.table .inactive {
  background-color: var(--surface-alt);
  opacity: 0.7;
}

.table .inactive [aria-label="Copy"] {
  display: none;
}

/* Button Tooltips (from guest-link-index.html) */
.table button[aria-label]:hover::after {
  content: attr(aria-label);
  position: absolute;
  background: var(--text-main);
  color: var(--surface);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

.table button {
  position: relative;
}

/* File Info Styles */
.content section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.content section h2 {
  font-size: 1.2em;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.content section .value {
  font-size: 1.1rem;
  font-weight: 500;
}

.text-muted {
  color: var(--text-muted) !important;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Notification */
.notification {
  background-color: var(--surface-alt);
  border-radius: var(--radius);
  padding: 1.25rem 2.5rem 1.25rem 1.5rem;
  position: relative;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.notification.is-info {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary-light);
}

.notification.is-light {
  background-color: var(--surface-alt);
  color: var(--text-main);
}

.notification .delete {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.has-text-info {
  color: var(--info) !important;
}

/* Typography Utilities */
.title {
  color: var(--text-main);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}
