/* Application Page Styles */

/* Main Content Container */
.application-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  margin-top: 100px;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
}

.download-btn {
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.8;
  margin: 0.5rem 0;
}

/* Download Modal */
.download-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.download-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-modal-content {
  background-color: var(--text-inverse);
  border-radius: 25px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.download-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 30px;
  border-radius: 25px 25px 0 0;
  position: relative;
}

.download-modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.download-modal-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

.download-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.download-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.download-modal-body {
  padding: 30px;
}

.download-notice {
  margin-bottom: 25px;
  padding: 20px;
  background: #fef3c7;
  border: 1px solid var(--warning);
  border-radius: 12px;
}

.download-notice h3 {
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 15px;
}

.download-notice ul {
  font-size: 14px;
  color: #92400e;
  line-height: 1.8;
  padding-left: 20px;
  list-style: disc;
}

.download-notice ul li {
  margin-bottom: 8px;
}

.download-email-box {
  margin-top: 15px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  text-align: center;
}

.download-email-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 5px;
}

.download-email {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.download-links {
  margin-bottom: 20px;
}

.download-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 15px;
  margin-top: 20px;
}

.download-link {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.3s, box-shadow 0.3s;
}

.download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(30, 58, 95, 0.4);
}

.download-link.secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.download-link.secondary:hover {
  background: var(--bg-light);
  box-shadow: 0 4px 15px rgba(30, 58, 95, 0.2);
}

.download-info {
  padding: 15px;
  background: var(--bg-light);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  text-align: center;
}

.download-info p {
  margin: 0.5rem 0;
}

/* Form Styles */
.application-form {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.required {
  color: var(--error);
  margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background: #f9fafb;
  transition: all 0.3s;
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: #f3f4f6;
}

.file-input {
  display: none;
}

.file-upload-label {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.file-upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-info {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
}

.file-name {
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-muted);
  margin-left: 1rem;
  margin-right: 1rem;
}

.file-remove {
  background: var(--error);
  color: white;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.3s;
}

.file-remove:hover {
  background: var(--error);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.btn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Noto Sans KR', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

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

.btn-secondary:hover {
  background: var(--text-light);
}

/* Application List */
.application-list-section {
  margin-top: 3rem;
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.list-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.table-container {
  overflow-x: auto;
}

.application-table {
  width: 100%;
  border-collapse: collapse;
}

.application-table thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.application-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
}

.application-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.application-table tbody tr:hover {
  background: #f9fafb;
}

.application-table td {
  padding: 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

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

.application-table tbody tr {
  cursor: pointer;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .modal-content {
  background-color: var(--text-inverse);
  border-radius: 25px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 30px;
  border-radius: 25px 25px 0 0;
  position: relative;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Edit Form Section */
#editFormSection {
  margin-top: 1rem;
}

#editFileList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .application-container {
    padding: 1rem;
    margin-top: 80px;
  }

  .title-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .download-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .application-form {
    padding: 1.5rem;
  }

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

  .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
  }

  .application-list-section {
    padding: 1.5rem;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .list-title {
    font-size: 1.5rem;
  }

  .application-table {
    font-size: 0.85rem;
  }

  .application-table th,
  .application-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .download-modal-content {
    width: 95%;
    margin: 1rem;
  }

  .modal .modal-content {
    width: 95%;
    margin: 1rem;
  }
}