/* --- General Body --- */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f0f4f8;
  }
  
  /* --- Header --- */
  header {
    background-color: #2f3439;
    color: white;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  
  header button {
    background-color: #ff5c5c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
  }
  
  header button:hover {
    background-color: #e14141;
    transform: translateY(-1px);
  }
  
  /* --- Main Content --- */
  .main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* ---------------- LOGIN ---------------- */
  #login-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    width: 320px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #login-section h2 {
    margin-bottom: 24px;
  }
  
  #login-section label {
    display: block;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
  }
  
  #login-section input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  
  #login-section button {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background-color .2s ease, transform .1s ease;
  }
  
  #login-section button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
  }

  /* Login form tweaks */
#login-form {
  display: flex;
  flex-direction: column;
  width: 300px; /* opcionalno, fiksna širina forme */
  margin: 0 auto; /* centriranje */
}

#login-form input {
  width: 100%; /* input polja pune širine forme */
  padding: 8px;
  box-sizing: border-box;
}

#login-form button {
  width: 100%; /* dugme iste širine kao input polja */
  padding: 10px;
  cursor: pointer;
}
  
  /* ---------------- DASHBOARD ---------------- */
  #dashboard-section {
    display: none;
  }
  
  #dashboard-section h2 {
    margin-bottom: 10px;
  }
  
  #add-campaign-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color .2s ease, transform .1s ease;
  }
  
  #add-campaign-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
  }
  
  /* --- TABLE --- */
  table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 12px rgba(0,0,0,.08);
  }
  
  table th {
    background: #007BFF;
    color: white;
    padding: 12px;
  }
  
  table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;
  }
  
  table tr:hover {
    background: #f4f9ff;
  }
  
  /* Buttons inside table */
  table button {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    margin: 2px 4px;
    color: white;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
  }
  
  table button:hover {
    filter: brightness(95%);
    transform: translateY(-1px);
  }
  
  table button:nth-child(1) {
    background-color: #17a2b8;
  }
  
  table button:nth-child(2) {
    background-color: #dc3545;
  }
  
  /* ---------------- ADD NEW CAMPAIGN ---------------- */
  #add-section {
    display: none;
    max-width: 520px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
    position: relative;
  }
  
  #add-section h2 {
    margin-bottom: 16px;
  }
  
  #add-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 13px;
  }
  
  #add-section input[type="text"],
  #add-section input[type="number"],
  #add-section select,
  #add-section input[type="file"] {
    width: 100%;
    padding: 7px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 12px;
  }
  
  /* Remove heavy file border */
  #add-section input[type="file"] {
    padding: 4px;
  }
  
  /* FIRE button */
  #add-section button {
    background-color: #ff6f00;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color .2s ease, transform .1s ease;
  }
  
  #add-section button:hover {
    background-color: #e66000;
    transform: translateY(-1px);
  }
  
  
  /* LEFT ALIGN text columns */
  #campaigns-table th:nth-child(2),
  #campaigns-table th:nth-child(3),
  #campaigns-table td:nth-child(2),
  #campaigns-table td:nth-child(3) {
  text-align: left;
}

/* --- Add Campaign form footer buttons --- */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

#back-to-dashboard {
  font-size: 13px;
  color: #007BFF;
  cursor: pointer;
  text-decoration: underline;
}

#add-section button {
  background-color: #ff6f00;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
}

/* --- CSV Upload Styling --- */

.csv-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.csv-btn {
  background-color: #007BFF;
  color: white;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

.csv-btn:hover {
  background-color: #0056b3;
}

#csv-file-name {
  font-size: 13px;
  color: #555;
}

/* --- postojeći CSS ostaje isti --- */

/* --- Modal Styling --- */
.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-content {
    background-color: white;
    margin: 80px auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
    position: relative;
}

.close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

/* Clicks table */
#clicks-table {
  width: 100%;
  border-collapse: collapse;
}

#clicks-table th, #clicks-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

#clicks-table th {
  background-color: #007BFF;
  color: white;
  position: sticky;
  top: 0;
}

#clicks-table-container::-webkit-scrollbar {
  width: 8px;
}

#clicks-table-container::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 4px;
}

#clicks-table th,
#clicks-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
  text-align: left; /* <- lijevo poravnanje */
}

/* Badge za status */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
  }
  
  .status-running { background-color: #28a745; }
  .status-stopped { background-color: #dc3545; }
  .status-completed { background-color: #007bff; }


  #campaign-filters label {
    font-size: 14px;
  }
  
  #campaign-filters select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  
  #campaign-pagination button {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  #campaign-pagination button:hover:not(:disabled) {
    background-color: #0056b3;
  }
  
  #campaign-pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
  }

  .progress-wrap {
    width: 100%;
    height: 18px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
  }
  
  #uploadProgress {
    width: 0%;
    height: 100%;
    background: #4caf50;
    transition: width .15s ease;
  }
  
  #uploadPct {
    text-align: center;
    font-size: 12px;
    margin-top: 4px;
  }
  
  /* -------- Spinner ---------- */

.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 14px;
  color: #333;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #ddd;
  border-top: 3px solid #ff6f00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

  