/**
 * Minimalist CSS for Story Contribution Hub
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
               'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
  overflow-x: hidden;
}

/* Page Management */
.page {
  display: none;
  min-height: 100vh;
  padding: 20px;
  padding-bottom: 60px;
}

.page.active {
  display: block;
}

/* Splash Page */
.splash-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.splash-title {
  font-size: 3rem;
  font-weight: 300;
  color: #000;
  margin-bottom: 60px;
  letter-spacing: 0.05em;
}

.splash-enter {
  background: transparent;
  border: 1px solid #000;
  color: #000;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.splash-enter:hover {
  background: #000;
  color: white;
}

.splash-enter:active {
  transform: scale(0.97);
}

#splash-page .page {
  padding: 0;
}

@media (min-width: 768px) {
  .splash-title {
    font-size: 4rem;
  }
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Header Styles */
.page-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 1px solid #e0e0e0;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 400;
  color: #000;
  margin-bottom: 10px;
}

.page-header .subtitle {
  font-size: 1rem;
  color: #666;
  font-weight: 300;
}

/* Intro Section */
.intro {
  background: white;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #e0e0e0;
}

.intro p {
  margin-bottom: 10px;
  color: #666;
  line-height: 1.7;
}

.intro p:last-child {
  margin-bottom: 0;
  color: #333;
}

/* Options Grid */
.options-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.option-card {
  background: white;
  padding: 24px;
  border: 1px solid #e0e0e0;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.option-card:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .option-card:hover {
    border-color: #999;
  }
}

.option-icon {
  display: none;
}

.option-card h2 {
  font-size: 1.3rem;
  color: #000;
  margin-bottom: 10px;
  font-weight: 400;
}

.option-desc {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.6;
}

.option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.meta-item {
  font-size: 0.85rem;
  color: #666;
  background: #f5f5f5;
  padding: 5px 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  border: 1px solid #000;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  background: white;
  color: #000;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #000;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #333;
}

.btn-primary:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f5f5f5;
  color: #000;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-back {
  background: transparent;
  border: none;
  color: #666;
  font-size: 1rem;
  padding: 10px 0;
  margin-bottom: 20px;
  cursor: pointer;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:active {
  opacity: 0.7;
}

/* Forms */
.form-container {
  background: white;
  padding: 24px;
  border: 1px solid #e0e0e0;
}

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

.form-group label {
  display: block;
  font-weight: 400;
  margin-bottom: 8px;
  color: #000;
  font-size: 1rem;
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  background: white;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  outline: none;
  border-color: #666;
}

textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.6;
}

#story-content {
  min-height: 300px;
  font-size: 16px;
}

/* Character Counter */
.char-counter {
  text-align: right;
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
}

/* File Input */
input[type="file"] {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  cursor: pointer;
  -webkit-appearance: none;
}

input[type="file"]::-webkit-file-upload-button {
  padding: 10px 20px;
  background: #000;
  color: white;
  border: none;
  font-weight: 400;
  cursor: pointer;
  margin-right: 10px;
}

/* File List */
.file-list {
  margin-top: 15px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  margin-bottom: 8px;
}

.file-icon {
  display: none;
}

.file-name {
  flex: 1;
  font-size: 0.9rem;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}

/* Radio and Checkbox */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.radio-label input,
.checkbox-label input {
  width: auto;
  margin-right: 10px;
  cursor: pointer;
  min-width: 20px;
  min-height: 20px;
}

.radio-label span,
.checkbox-label span {
  flex: 1;
}

/* Consent Box */
.consent-box {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin-bottom: 24px;
}

.consent-box h3 {
  color: #000;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 400;
}

.consent-box p {
  color: #666;
  margin-bottom: 10px;
  line-height: 1.6;
}

.consent-box ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.consent-box li {
  color: #666;
  margin-bottom: 8px;
  line-height: 1.5;
}

.consent-box .checkbox-label {
  margin-top: 15px;
  padding: 12px;
  background: white;
  border: 1px solid #e0e0e0;
  font-weight: 400;
}

/* Upload Info */
.upload-info {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin-bottom: 24px;
}

.upload-info h3 {
  color: #000;
  margin-bottom: 12px;
  font-weight: 400;
}

.upload-info ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

.upload-info li {
  margin-bottom: 5px;
  color: #666;
}

.upload-info p {
  margin-top: 10px;
  color: #666;
}

/* Upload Progress */
.upload-progress {
  text-align: center;
  padding: 30px 0;
}

.progress-bar {
  width: 100%;
  height: 2px;
  background: #e0e0e0;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  background: #000;
  animation: progress 1.5s ease-in-out infinite;
  width: 100%;
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  color: #666;
  font-weight: 400;
}

/* Phone Number Display */
.phone-number-display {
  text-align: center;
  padding: 40px 20px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  margin-bottom: 30px;
}

.phone-icon {
  display: none;
}

.phone-number-display h2 {
  color: #000;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 400;
}

.phone-number {
  display: inline-block;
  font-size: 2rem;
  font-weight: 400;
  color: #000;
  text-decoration: none;
  background: white;
  padding: 15px 30px;
  border: 1px solid #e0e0e0;
  margin-bottom: 10px;
  transition: background 0.2s ease;
}

.phone-number:active {
  background: #f5f5f5;
}

.phone-note {
  font-size: 0.9rem;
  color: #666;
  margin-top: 10px;
}

/* Instructions and Tips */
.instructions,
.tips-box {
  background: white;
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin-bottom: 20px;
}

.instructions h3,
.tips-box h3 {
  color: #000;
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: 400;
}

.instructions ol {
  margin-left: 20px;
}

.instructions li,
.tips-box li {
  color: #666;
  margin-bottom: 12px;
  line-height: 1.6;
}

.instructions strong {
  color: #000;
}

.tips-box ul {
  margin-left: 20px;
}

/* Consent Note */
.consent-note {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  padding: 15px;
  margin-top: 20px;
}

.consent-note p {
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-message h2 {
  color: #000;
  margin-bottom: 15px;
  font-weight: 400;
}

.success-message p {
  color: #666;
  margin-bottom: 25px;
  line-height: 1.6;
}

/* Form Actions */
.form-actions {
  margin-top: 30px;
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
  .page {
    padding: 40px;
  }
  
  .page-header h1 {
    font-size: 2.5rem;
  }
  
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .form-container {
    padding: 40px;
  }
  
  .radio-group {
    flex-direction: row;
  }
}

/* Large Desktop */
@media (min-width: 1024px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
  .page {
    min-height: -webkit-fill-available;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: max(16px, 1rem);
  }
}

/* Accessibility: Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Admin Styles */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border: 1px solid #e0e0e0;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #000;
  font-weight: 400;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: white;
  padding: 10px;
  border: 1px solid #e0e0e0;
  overflow-x: auto;
}

.admin-tab {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid #e0e0e0;
  font-weight: 400;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  border-color: #000;
  color: #000;
}

.admin-tab.active {
  background: #000;
  border-color: #000;
  color: white;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #000;
  padding: 24px;
  color: white;
  border: 1px solid #000;
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 400;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 300;
  margin: 0;
}

.admin-list {
  background: white;
  padding: 20px;
  border: 1px solid #e0e0e0;
}

.admin-item {
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin-bottom: 15px;
  transition: border-color 0.2s ease;
}

.admin-item:hover {
  border-color: #999;
}

.admin-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-item-date {
  font-size: 0.9rem;
  color: #666;
  font-weight: 400;
}

.admin-item-id {
  font-size: 0.75rem;
  color: #999;
  font-family: monospace;
}

.admin-item-content {
  margin-bottom: 15px;
}

.admin-item-content p {
  margin: 8px 0;
  line-height: 1.6;
}

.story-preview {
  color: #000;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  font-size: 0.85rem;
  color: #666;
}

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

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.2s ease;
}

.btn-small.btn-secondary {
  background: #f5f5f5;
  color: #000;
}

.btn-small.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-small.btn-export {
  background: #000;
  color: white;
  border-color: #000;
}

.btn-small.btn-export:hover {
  background: #333;
}

.status-badge {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  color: #666;
}

.status-pending {
  background: #fafafa;
  color: #666;
}

.status-contacted {
  background: #f5f5f5;
  color: #333;
}

.status-scheduled {
  background: #e0e0e0;
  color: #000;
}

.status-completed {
  background: #000;
  color: white;
  border-color: #000;
}

.status-declined {
  background: #fafafa;
  color: #999;
}

.file-type-badge {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  background: #fafafa;
  color: #666;
  border: 1px solid #e0e0e0;
}

.empty-message {
  text-align: center;
  color: #666;
  padding: 40px 20px;
  font-style: italic;
}

.loading-message {
  text-align: center;
  color: #666;
  padding: 40px 20px;
}

.error-message {
  background: #fafafa;
  color: #333;
  padding: 12px 16px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
}

/* Links */
a {
  color: #000;
}

a:hover {
  color: #666;
}

.terms-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Print Styles */
@media print {
  .btn-back,
  .form-actions {
    display: none;
  }
}
