/* ================================
   Concept2 Submit Page — Dark Theme Form Layout
   ================================ */

:root {
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --main-mono-color: var(--border-default, #333333);
}

.submit-article,
.submit_page {
  max-width: var(--container-max, 1400px);
  margin: 0 auto;
  padding: var(--space-8, 3rem) var(--container-padding, 2rem) var(--space-12, 5rem);
}

.submit-article .container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.submit-article h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #f5f5f5);
  margin: 0;
  line-height: 1.4;
}

/* Row & Column Grid */
.submit-article .row,
.submit_page .row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.submit-article .form-section > .row {
  margin: 0 auto;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-default, #2a2a2a);
}

.submit-article .form-section > .row:first-child {
  border-top: none;
  padding-top: 0;
}

.submit-article .col-2,
.submit_page .col-2 {
  flex: 0 0 calc(16.666667% - var(--spacing-lg) * 0.833333);
  max-width: calc(16.666667% - var(--spacing-lg) * 0.833333);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-4,
.submit_page .col-4 {
  flex: 0 0 calc(33.333333% - var(--spacing-lg) * 0.666667);
  max-width: calc(33.333333% - var(--spacing-lg) * 0.666667);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-5,
.submit_page .col-5 {
  flex: 0 0 calc(41.666667% - var(--spacing-lg) * 0.583333);
  max-width: calc(41.666667% - var(--spacing-lg) * 0.583333);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-6,
.submit_page .col-6 {
  flex: 0 0 calc(50% - var(--spacing-lg) * 0.5);
  max-width: calc(50% - var(--spacing-lg) * 0.5);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-8,
.submit_page .col-8 {
  flex: 0 0 calc(66.666667% - var(--spacing-lg) * 0.333333);
  max-width: calc(66.666667% - var(--spacing-lg) * 0.333333);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-10,
.submit_page .col-10 {
  flex: 0 0 calc(83.333333% - var(--spacing-lg) * 0.166667);
  max-width: calc(83.333333% - var(--spacing-lg) * 0.166667);
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .col-12,
.submit_page .col-12 {
  flex: 0 0 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.submit-article .right-align,
.submit_page .right-align {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Form Elements */
.form-group {
  position: relative;
  margin-bottom: 0;
}

.form-group-inner {
  position: relative;
  padding-bottom: 1.5rem;
}

.form-group-inner.row {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary, #f5f5f5);
}

.form-label span {
  color: var(--color-primary, #B5D12F);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-default, #333333);
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  background-color: var(--bg-elevated, #1a1a1a);
  color: var(--text-primary, #f5f5f5);
  transition: border-color 0.25s ease;
  min-height: 48px;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary, #B5D12F);
}

.form-input[readonly] {
  background-color: var(--bg-surface, #141414);
  color: var(--text-secondary, #cccccc);
}

.select-group select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-elevated, #1a1a1a);
  color: var(--text-primary, #f5f5f5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.select-group select.form-input option,
.select-group select.form-input optgroup {
  background-color: var(--bg-surface, #181818);
  color: var(--text-primary, #f5f5f5);
}

.form-group-inner.error .form-input {
  border-color: var(--color-primary, #B5D12F);
  box-shadow: 0 0 0 2px rgba(181, 209, 47, 0.15);
}

.form-group-inner.error .form-label {
  color: var(--color-primary, #B5D12F);
}

.form-error {
  color: var(--color-primary, #B5D12F);
  visibility: visible;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 12px;
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
}

.input-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted, #888888);
  margin-top: 5px;
}

/* Custom File Upload (Dark Theme) */
.custom-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.custom-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed var(--border-default, #3a3a3a);
  border-radius: 0;
  background: var(--bg-elevated, #1a1a1a);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 160px;
}

.custom-file-label:hover {
  border-color: var(--color-primary, #B5D12F);
  background: rgba(181, 209, 47, 0.06);
}

.custom-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-surface, #262626);
  border: 1px solid var(--border-default, #3a3a3a);
  color: var(--text-primary, #ffffff);
  transition: all 0.3s ease;
}

.custom-file-label:hover .custom-file-icon {
  background: var(--color-primary, #B5D12F);
  border-color: var(--color-primary, #B5D12F);
  transform: scale(1.08);
}

.custom-file-icon .material-symbols-outlined {
  font-size: 30px;
  color: #fff;
}

.custom-file-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary, #f5f5f5);
}

.custom-file-hint {
  font-size: 12px;
  color: var(--text-muted, #888888);
  margin-top: -6px;
}

.uploaded-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-default, #333333);
  background: var(--bg-elevated, #1a1a1a);
  flex-wrap: wrap;
}

.uploaded-image {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary, #cccccc);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-change-file {
  padding: 8px 16px;
  font-size: 14px;
  min-width: auto;
  white-space: nowrap;
}

.form-file-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ef4444;
  border: 1px solid #ef4444;
  background: transparent;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.form-file-delete:hover {
  background: #ef4444;
  color: #fff;
}

.thumb-img-box {
  height: 100%;
  min-height: 200px;
  border: 1px solid var(--border-default, #333333);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface, #141414);
  position: relative;
  overflow: hidden;
}

.thumb-img-box .material-symbols-outlined {
  font-size: 48px;
  color: var(--text-muted, #555555);
}

.thumb-img-box img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.thumb-img-box img[src]:not([src=""]) {
  display: block;
}

.form-file-box p {
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-secondary, #cccccc);
}

.form-group-inner2 {
  margin-bottom: 10px;
}

.form-group-inner2:last-child {
  margin-bottom: 0;
}

/* Designer Inputs */
.designer-list-box {
  gap: var(--spacing-sm) !important;
}

.designer-input-container {
  margin-bottom: 0;
}

.designer-input-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.designer-input-item input {
  flex: 1;
  min-width: 0;
}

.btn-designer-add {
  padding: 10px 18px;
  background: var(--bg-elevated, #1a1a1a);
  border: 1px solid var(--border-default, #3a3a3a);
  font-size: 14px;
  color: var(--text-primary, #f5f5f5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  margin-top: 10px;
}

.btn-designer-add:hover {
  border-color: var(--color-primary, #B5D12F);
  color: var(--color-primary, #B5D12F);
}

.btn-designer-remove {
  padding: 8px 14px;
  min-width: 40px;
  background: #dc3545;
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.btn-designer-remove:hover {
  background: #c82333;
  color: #fff;
}

/* Bottom Action Buttons */
.btn-wrap {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--border-default, #2a2a2a);
}

/* Read-only View (entry-view.php) */
.form-group-inner .form-readonly {
  min-height: 2.75em;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: default;
  user-select: text;
}

.form-group-inner .form-readonly.form-textarea {
  resize: none;
  overflow-y: auto;
}

.form-readonly-link {
  color: var(--color-primary, #B5D12F);
  text-decoration: underline;
  word-break: break-all;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--color-primary, #B5D12F);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 1139px) {
  .submit-article .form-section > .row {
    flex-direction: column;
    gap: 20px;
  }

  .submit-article .form-section > .row > h3,
  .submit-article .form-section > .row > .right-align {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .submit-article,
  .submit_page {
    padding: 2rem 1rem 3.5rem;
  }

  .submit-article .col-2,
  .submit-article .col-4,
  .submit-article .col-5,
  .submit-article .col-6,
  .submit-article .col-8,
  .submit-article .col-10,
  .submit-article .col-12,
  .submit_page .col-2,
  .submit_page .col-4,
  .submit_page .col-5,
  .submit_page .col-6,
  .submit_page .col-8,
  .submit_page .col-10,
  .submit_page .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 12px;
  }

  .submit-article .form-group-inner.row {
    flex-direction: column;
  }

  .thumb-img-box {
    height: 200px;
    margin-bottom: 15px;
  }

  .btn-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .btn-wrap .btn {
    width: 100%;
  }

  .submit-article .designer-input-item {
    flex-direction: column;
    align-items: stretch;
  }
}
