/* Dark Mode Styles with Theme Support */
:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2a2a2a;
    --accent-bg: #3a3a3a;
    --highlight-color: #007bff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: #e0e0e0;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #ffffff;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.link-form {
    background-color: var(--secondary-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    transition: background-color 0.3s ease;
}

.form-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-control {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    background-color: var(--accent-bg);
    color: #e0e0e0;
    border: 2px solid #4a4a4a;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--highlight-color);
    background-color: #404040;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
    color: #888;
}

.btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    background-color: var(--highlight-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background-color: #155724;
    color: #d4edda;
    border: 1px solid #28a745;
}

.alert-error {
    background-color: #721c24;
    color: #f8d7da;
    border: 1px solid #dc3545;
}

.links-list {
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.links-list h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.link-item {
    background-color: var(--accent-bg);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid var(--highlight-color);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.link-item:hover {
    background-color: #404040;
    transform: translateX(5px);
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-item a {
    color: #66b3ff;
    text-decoration: none;
    word-break: break-all;
    font-size: 1.1em;
}

.link-item a:hover {
    color: #99ccff;
    text-decoration: underline;
}

.link-date {
    color: #888;
    font-size: 0.9em;
    margin-top: 5px;
}

.no-links {
    text-align: center;
    color: #888;
    padding: 30px;
    font-style: italic;
}

/* Scrollbar styling for dark mode */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Theme Selector Styles */
.theme-selector {
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    transition: background-color 0.3s ease;
}

.theme-selector h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 40px));
    gap: 10px;
    justify-content: start;
}

.theme-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.theme-option.active {
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--secondary-bg), 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Action Buttons Styles */
.link-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-edit,
.btn-delete {
    padding: 8px 15px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-edit {
    background-color: #28a745;
}

.btn-edit:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-cancel {
    background-color: #6c757d;
}

.btn-cancel:hover {
    background-color: #5a6268;
}