/* Dark Mode Styles - Default */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --error: #ff6b6b;
    --success: #51cf66;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-form {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow);
    width: 100%;
    max-width: 420px;
}

.auth-form h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.8rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

button {
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.password-requirements small {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.password-requirements ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.password-requirements li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.25rem;
}

.password-requirements li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.auth-toggle {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-toggle button {
    background: transparent;
    color: var(--accent);
    padding: 0.5rem 1rem;
    width: auto;
    font-size: 0.9rem;
}

.auth-toggle button:hover {
    background: rgba(74, 158, 255, 0.1);
    transform: none;
}

/* Dashboard Styles */
.dashboard {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
}

.logout-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    width: auto;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: var(--bg-secondary);
}

/* Lists Container */
.lists-container {
    margin-top: 2rem;
}

.lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.lists-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.lists-header button {
    width: auto;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.list-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.list-card-content {
    flex: 1;
}

.list-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.list-card .priority {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.list-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Forms */
.create-form-container {
    max-width: 500px;
    margin: 2rem auto;
}

.create-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow);
}

.create-form h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.button-group button[type="button"] {
    background: var(--bg-tertiary);
}

.button-group button[type="button"]:hover {
    background: var(--bg-primary);
}

/* Tag Manager */
.tag-manager {
    margin-top: 2rem;
}

.tag-manager-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tag-manager-header h2 {
    font-size: 1.5rem;
}

.back-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    width: auto;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: var(--bg-secondary);
}

.tags-header {
    margin-bottom: 1.5rem;
}

.tags-header button {
    width: auto;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tag-item {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tag-info {
    flex: 1;
    min-width: 0;
}

.tag-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag-name code {
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

.tag-url a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    word-break: break-all;
}

.tag-url a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.tag-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Scan Status Badges */
.scan-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.scan-pending {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.scan-scanning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.scan-safe {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.scan-malicious {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.scan-failed {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Action Buttons */
.btn-edit,
.btn-delete {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
}

.btn-edit {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-edit:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: none;
    box-shadow: none;
}

.btn-delete {
    background: transparent;
    color: var(--error);
    border-color: var(--error);
}

.btn-delete:hover:not(:disabled) {
    background: var(--error);
    color: white;
    transform: none;
    box-shadow: none;
}

/* Search Tags Styles */
.search-tags {
    margin-top: 2rem;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.search-header h2 {
    font-size: 1.5rem;
}

.search-form {
    margin-bottom: 2rem;
}

.search-form .form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.search-input {
    flex: 1;
}

.search-form button {
    width: auto;
    padding: 0.875rem 1.5rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-item {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.search-result-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-tag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.result-tag code {
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

.result-url a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    word-break: break-all;
}

.result-url a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.result-list {
    margin-top: 0.25rem;
}

.result-list small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    width: auto;
    font-size: 0.9rem;
}

.search-btn:hover {
    background: var(--bg-secondary);
}

/* List Drag and Drop Styles */
.list-card.dragging {
    opacity: 0.5;
    cursor: move;
}

.list-card.drag-over {
    border-color: var(--accent);
    border-style: dashed;
    background: rgba(74, 158, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .lists-grid {
        grid-template-columns: 1fr;
    }

    .tag-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .tag-actions,
    .list-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .tag-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-form .form-group {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }
}
