/**
 * Main app styles - mobile-friendly, responsive
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 0;
  margin: 0;
}

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

header {
  background-color: #2c3e50;
  color: white;
  padding: 1rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

header .user-info {
  font-size: 0.9rem;
  opacity: 0.9;
}

header .api-url-toggle {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group select,
.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  min-height: 44px; /* Touch target size */
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-height: 36px;
}

.btn-save {
  background-color: #27ae60;
  color: white;
}

.btn-save:hover {
  background-color: #229954;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-top: 1rem;
}

thead {
  background-color: #34495e;
  color: white;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: 600;
}

tbody tr:hover {
  background-color: #f8f9fa;
}

/* Mobile: horizontal scroll for tables */
@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }
}

/* Roster table specific */
.roster-table select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Messages */
.error {
  background-color: #fee;
  color: #c33;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  border-left: 4px solid #c33;
}

.success {
  background-color: #efe;
  color: #3c3;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  border-left: 4px solid #3c3;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.empty {
  text-align: center;
  padding: 2rem;
  color: #999;
}

/* Upload summary */
.upload-summary,
.import-summary {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.upload-summary details,
.import-summary details {
  margin-top: 1rem;
}

.upload-summary summary,
.import-summary summary {
  cursor: pointer;
  font-weight: 500;
  padding: 0.5rem;
}

.upload-summary ul,
.import-summary ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.upload-summary li,
.import-summary li {
  margin-bottom: 0.25rem;
  color: #c33;
}

/* Admin panels */
.admin-panel {
  margin-bottom: 2rem;
}

.admin-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }

  header h1 {
    font-size: 1.25rem;
  }

  .card {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}
