/* ========================= GLOBAL RESET ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #e6efff, #ffffff);
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
}

/* ========================= HEADER ========================= */
header {
  background: linear-gradient(90deg, #1e40af, #2563eb);
  color: white;
  text-align: center;
  padding: 35px 20px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

header h1 {
  font-size: 2.4rem;
  letter-spacing: 0.5px;
}

header p {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-top: 5px;
}

/* ========================= MAIN LAYOUT ========================= */
#main-section {
  display: flex;
  gap: 25px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.left-panel,
.right-panel {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.left-panel:hover,
.right-panel:hover {
  transform: translateY(-3px);
}

/* ========================= FORM ELEMENTS ========================= */
form label {
  display: block;
  margin-top: 18px;
  font-weight: 600;
  color: #1e3a8a;
}

input[type="text"],
textarea,
select,
input[type="datetime-local"] {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #f9fafb;
}

input[type="text"]:focus,
textarea:focus,
select:focus,
input[type="datetime-local"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.3);
  outline: none;
  background: #ffffff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ========================= MODERN DROPDOWN ========================= */
.group-dropdown {
  position: relative;
  margin-top: 8px;
}

.dropdown-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f1f5fb;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  color: #1e3a8a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}

.dropdown-btn:hover {
  background: #e0ebff;
}

.dropdown-btn i {
  transition: transform 0.3s ease;
}

.group-dropdown.show .dropdown-btn i {
  transform: rotate(180deg);
}

/* ========================= DROPDOWN CONTENT ========================= */
.dropdown-content {
  display: none;
  position: absolute;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  width: 100%;
  margin-top: 8px;
  z-index: 10;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  max-height: 240px;
  overflow-y: auto;
}

.dropdown-content::-webkit-scrollbar {
  width: 6px;
}
.dropdown-content::-webkit-scrollbar-thumb {
  background: #2563eb;
  border-radius: 10px;
}

/* ========================= CHECKBOX STYLING ========================= */
.platform-group strong {
  display: block;
  margin: 10px 0 6px;
  color: #2563eb;
  font-size: 0.95rem;
}

.platform-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
  background: #f9fafb;
  transition: all 0.2s;
}

.platform-group label:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.platform-group input[type="checkbox"] {
  accent-color: #2563eb;
  transform: scale(1.2);
}

/* ========================= TAG CHIPS ========================= */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tag-chip {
  background: #2563eb;
  color: #fff;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.3s ease;
}

.tag-chip i {
  cursor: pointer;
  font-style: normal;
  font-weight: bold;
  opacity: 0.8;
  transition: 0.2s;
}

.tag-chip i:hover {
  opacity: 1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ========================= FILE UPLOAD ========================= */
input[type="file"] {
  display: block;
  margin-top: 8px;
  padding: 6px;
}

/* ========================= BUTTON ========================= */
.submit-btn {
  background: linear-gradient(90deg, #2563eb, #1e3a8a);
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 14px;
  width: 100%;
  border-radius: 12px;
  margin-top: 20px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:hover {
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.4);
}

/* ========================= RIGHT PANEL ========================= */
#text {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  resize: vertical;
}

/* ========================= PREVIEW PANEL ========================= */
.panel-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 15px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel-section h2 {
  margin-bottom: 10px;
  color: #1e3a8a;
}

#preview img,
#preview video {
  width: 100%;
  max-height: 300px;
  border-radius: 10px;
  margin-top: 10px;
  object-fit: cover;
}

/* ========================= DASHBOARD ========================= */
#dashboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#dashboard thead {
  background: #2563eb;
  color: #fff;
}

#dashboard th,
#dashboard td {
  padding: 10px;
  border: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.95rem;
}

#dashboard tbody tr:nth-child(even) {
  background: #f1f5fb;
}

#dashboard tbody tr:hover {
  background: #e0ebff;
  transition: 0.2s;
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 992px) {
  #main-section {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    width: 100%;
  }
}



/* ========================= API SECTION STYLES ========================= */
#api-section {
  margin-top: 30px;
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===== Grid layout for inputs ===== */
.api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

/* ===== Individual input field ===== */
.api-field {
  display: flex;
  flex-direction: column;
}

.api-field label {
  font-weight: 600;
  margin-bottom: 4px;
}

.api-field input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border 0.2s ease;
}

.api-field input:focus {
  border-color: #4a90e2;
}

/* ===== Connection status text ===== */
.api-status {
  font-size: 0.9em;
  margin-top: 4px;
}

.api-status.connected {
  color: green;
}

.api-status.disconnected {
  color: red;
}

/* ===== Buttons (Save, Clear) ===== */
.api-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.api-buttons button {
  background-color: #4a90e2;
  color: #fff;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.api-buttons button:hover {
  background-color: #357abd;
}

/* ===== Danger button (Clear All) ===== */
.danger-btn {
  background-color: #e63946;
  color: #fff;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.danger-btn:hover {
  background-color: #d62828;
}

/* ========================= COMPLETELY HIDE API SECTION ========================= */
#api-section {
  display: none !important;       /* Fully removes from layout */
  visibility: hidden !important;  /* Makes it invisible */
  opacity: 0 !important;          /* Ensures it's transparent */
  height: 0 !important;           /* Removes space */
  overflow: hidden !important;    /* Prevents any content overflow */
  pointer-events: none !important;/* Disables all interaction */
}
