/* ===================================================
  Google Fonts
=================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================================================
  Base Styles
=================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: #f8f9fa;
  font-family: 'Inter', sans-serif;
}
a {
  text-decoration: none;
  outline: none;
  user-select: none;
}

/* ===================================================
  Header
=================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #3498db, #3498db);
  padding: 15px;
}
.header .title {
  font-size: 28px;
  font-weight: 700;
}
.title a {
  color: #fff;
}
.add-btn {
  background: #fff;
  color: #3498db;
  font-size: 22px;
  border: none;
  border-radius: 5px;
  width: 35px;
  height: 35px;
  cursor: pointer;
  font-weight: 700;
}

/* ===================================================
   Popup Modal Styles
   Used for centered overlay popup with button options
=================================================== */

.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-box {
  position: relative;
  background: #ffffff;
  width: 320px;
  padding: 25px 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease;
}

.popup-box h3 {
  margin-top: 0;
  font-size: 22px;
  color: #4a90e2;
}

.popup-box .popup-close {
  position: absolute;
  top: 12px;
  right: 15px;
  font-size: 22px;
  color: #ff0000;
  cursor: pointer;
  font-weight: bold;
}

.popup-box .action-button {
  background-color: #4a90e2;
  color: #fff;
  border: none;
  padding: 12px 20px;
  margin-top: 15px;
  width: 100%;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.popup-box .action-button:hover {
  background-color: #357bd8;
}

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

/* ===================================================
  Container
=================================================== */
.container,
.container-body {
  width: 100%;
  max-width: 750px;
  margin: auto;
  background: #fff;
  padding: 15px;
  box-shadow: 0 1px 1px 1px rgba(0, 0, 0, .12);
}
.container {
  margin-top: 70px;
}
.container-body {
  margin-top: 10px;
}
.container-body h2,
.container-body h3 {
  color: #1a3b5d;
  font-weight: 700;
  margin: 10px 0;
}
.container-body h2 {
  font-size: 22px;
  border-bottom: 2px solid #dbe2ef;
  padding-bottom: 10px;
}
.container-body h3 {
  font-size: 20px;
}
.container-body p{
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.container-body li {
  font-size: 15px;
  margin-bottom: 6px;
}
.container-body ul {
  padding-left: 30px;
  margin-bottom: 20px;
  list-style-type: disc;
}
.container-body a {
  color: #2a75f3;
}
.container-body a:hover {
  text-decoration: underline;
}

/* ===================================================
  Input & URL Section
=================================================== */
.url-input {
  display: flex;
  align-items: stretch;
  margin-bottom: 12px;
}

.url-input input[type="url"],
.url-input input[type="text"] {
  flex: 1 1 auto;
  padding: 15px 12px;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.url-input input:focus {
  outline: none;
}

.url-input button {
  white-space: nowrap;
  background-color: #4a90e2;
  color: white;
  border: 1px solid #4a90e2;
  border-left: none;
  padding: 0 16px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  flex-shrink: 0;
  height: auto;
}

.url-input button:hover {
  background-color: #357bd8;
}

/* ===================================================
  Utility Elements
=================================================== */
.rrg-title {
  text-align: center;
  font-size: 25px;
  max-width: 500px;
  margin: 0 auto 25px auto;
}
.list-group {
  display: flex;
  list-style: none;
  margin-bottom: 10px;
}
.list-group-item {
  flex: 1;
  border: 1px solid #ced4da;
  padding: 10px;
}
.flex-fill {
  flex: 1;
}
.error-message {
  background-color: #ffe0e0;
  color: #b30000;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 5px solid #b30000;
}

/* ===================================================
  Shortened URL Display
=================================================== */
.short-url-box {
  background: #ecf0f1;
  border: 1px solid #bdc3c7;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}
.short-url-box input {
  border: none;
  background: transparent;
  font-size: 16px;
  flex: 1;
  outline: none;
}
.copy-btn {
  cursor: pointer;
  font-size: 18px;
  color: #2c3e50;
  margin-left: 10px;
}
.copy-btn:hover {
  color: #27ae60;
}

/* ===================================================
  Mode Toggle
=================================================== */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}
.mode-toggle label {
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}

/* ===================================================
  Spinner
=================================================== */
.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#loading {
  text-align: center;
  margin-top: 15px;
}
#loading span {
  font-size: 16px;
  color: #333;
  display: block;
}

/* ===================================================
  Lock Result Box
=================================================== */
#lockResult {
  display: none;
  background-color: #f4f7fd;
  border: 1px solid #cbdaf3;
  border-radius: 6px;
  padding: 10px;
  color: #2a2a2a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-top: 15px;
}
#lockResult #secretCodeText {
  font-size: 14px;
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.5;
  margin-bottom: 8px;
}
#lockResult button#copyBtn {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
#lockResult button#copyBtn:hover {
  background-color: #3b78c4;
}
#lockResult button#copyBtn i {
  margin-right: 4px;
  font-size: 13px;
}

/* ===================================================
  Message & Card Styles
=================================================== */
.message {
  font-size: 18px;
  padding: 10px;
  background-color: #f8d7da;
  color: #721c24;
  border-left: 5px solid #dc3545;
  margin-bottom: 20px;
}
.url-box {
  margin-top: 25px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #ddd;
}
.url-info {
  margin-bottom: 20px;
  text-align: center;
}
.visit-btn {
  padding: 10px 15px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  background-color: #2ecc71;
  color: #fff;
  width: 300px;
  cursor: pointer;
}
.url-meta {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}
.url-card {
  background: linear-gradient(135deg, #e0f7fa, #ffffff);
  border-left: 5px solid #00acc1;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  flex: 1;
  min-width: 220px;
  transition: transform 0.3s ease;
}
.url-card p {
  margin: 0;
  font-size: 16px;
  color: #333;
}
.url-card i {
  color: #00acc1;
  margin-right: 8px;
}

/* ===================================================
  Footer
=================================================== */
.x-footer {
  background-color: #fff;
  color: #657786;
  padding: 20px 0;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 15px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}
.footer-links a {
  color: #666;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: #1da1f2;
}
.footer-copy a {
  color: #007864;
}
