/* CAYLUX Admin CSS - Brand Compliant */
:root {
  /* Brand Colors */
  --brand-navy: #0a1628;
  --brand-navy-light: #1a365d;
  --brand-blue: #0066cc;
  --brand-cyan: #00D4FF;
  --brand-gray: #9E9D9B;

  /* Functional Colors */
  --primary-color: #0066cc;
  --primary-hover: #0052a3;
  --accent-color: #00D4FF;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --dark: #333;
  --gray: #6c757d;
  --light-gray: #f8f9fa;
  --border: #dee2e6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 50%, var(--brand-navy) 100%);
  min-height: 100vh;
  color: var(--dark);
  line-height: 1.6;
}

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

.login-box {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--dark);
  font-size: 28px;
}

.login-box p {
  text-align: center;
  color: var(--gray);
  margin-bottom: 30px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
  color: #000 !important;
  background-color: #fff !important;
  -webkit-text-fill-color: #000 !important;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  color: #000 !important;
}

.form-group input::placeholder {
  color: #ccc !important;
  opacity: 0.5;
  font-style: italic;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: var(--gray);
  cursor: not-allowed;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-secondary {
  background: var(--gray);
  color: white;
}

.alert {
  padding: 12px 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Dashboard */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  color: var(--dark);
  font-size: 24px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

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

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.stat-card .value {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
}

.charters-grid {
  display: grid;
  gap: 20px;
}

.charter-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  transition: transform 0.3s;
}

.charter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.charter-image {
  width: 200px;
  height: 150px;
  object-fit: cover;
  background: var(--light-gray);
}

.charter-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.charter-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.charter-title {
  flex: 1;
}

.charter-title h3 {
  font-size: 20px;
  margin-bottom: 5px;
  color: var(--dark);
}

.charter-title p {
  color: var(--gray);
  font-size: 14px;
}

.charter-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--gray);
  font-size: 14px;
}

.charter-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

/* Form */
.form-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.form-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row.full {
  grid-template-columns: 1fr;
}

textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  cursor: text !important;
  background-color: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff !important;
  color: #000 !important;
}

textarea::placeholder {
  color: #ccc !important;
  opacity: 0.5;
  font-style: italic;
}

textarea:disabled,
textarea[readonly] {
  background-color: #e9ecef !important;
  cursor: not-allowed;
  color: #666 !important;
}

select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.image-upload {
  border: 2px dashed var(--border);
  border-radius: 5px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.image-upload:hover {
  border-color: var(--primary-color);
}

.image-upload input {
  display: none;
}

.image-preview {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.preview-item {
  position: relative;
  width: 150px;
  height: 150px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px 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); }
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .charter-card {
    flex-direction: column;
  }

  .charter-image {
    width: 100%;
    height: 200px;
  }

  .header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

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

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.includes-list {
  margin-bottom: 20px;
}

.include-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.include-item input {
  flex: 1;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  width: auto !important;
}

.btn-primary.btn-small,
.btn-secondary.btn-small,
.btn-danger.btn-small {
  width: auto !important;
}

.btn-icon {
  padding: 8px 12px;
}
