:root {
    --background-color: linear-gradient(135deg, #fff, #ccc);
    --text-color: #333;
    --button-bg: #4a90e2;
    --button-text: white;
    --input-border: #ccc;
    --modal-bg: #fff;
    --alert-bg: #f8d7da;
    --alert-text: #721c24;
    --result-bg: #e0ffe0;
}

.dark-mode {
    --background-color: linear-gradient(135deg, #000, #001);
    --text-color: #eee;
    --button-bg: #a66cff;
    --button-text: white;
    --input-border: #555;
    --modal-bg: #665581;
    --alert-bg: #f8d7da;
    --alert-text: #721c24;
    --result-bg: #665581;
}

body {
    font-family: sans-serif;
    background-image: var(--background-color);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-color);
    padding: 1rem;
    max-width: 700px;
    margin: auto;
    transition: background-image 0.3s ease, color 0.3s ease;
}

h1 {
    text-align: center;
    color: var(--text-color);
}

textarea,
input,
button {
    padding: 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    box-sizing: border-box;
}

textarea,
input {
    width: 100%;
}

.btn-copy-modal {
    width: 100%;
}

.btn-copy-link {
    width: 25%;
}

textarea {
    resize: vertical;
    margin-bottom: 1rem;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.row input {
    flex: 1;
}

.row button {
    width: 100%;
}

button {
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.hidden {
    display: none !important;
}

button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #00f;
    outline-offset: 2px;
}

#result {
    background: var(--result-bg);
    padding: 1rem;
    word-break: break-word;
    margin-top: 1rem;
    border-radius: 6px;
}

#link-section {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#link-input {
    flex: 1;
}

.modal {
    position: fixed;
    z-index: 3;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.modal-content {
    background-color: var(--modal-bg);
    margin: auto;
    margin-top: 10%;
    padding: 1rem;
    border: 1px solid var(--input-border);
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    color: var(--text-color);
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
}

#modal-message {
    white-space: pre-wrap;
}

.modal textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    margin-bottom: 1rem;
    color: var(--text-color);
    background: var(--background-color);
}

.modal-alert {
    background: var(--alert-bg);
    color: var(--alert-text);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

@media (min-width: 600px) {
    .row {
        flex-direction: row;
        align-items: center;
    }

    .row button {
        width: auto;
    }

    #link-section {
        flex-direction: row;
        align-items: center;
    }
}

.footer {
    margin-top: 4rem;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* #toggle-theme-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1;
} */

.top-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.top-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}


.top-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.top-bar button,
.top-bar a {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  box-sizing: border-box;
}

.top-bar button:hover,
.top-bar a:hover {
  background: #5e2dbb;
}


