:root {
    --bg-color: rgba(26, 26, 26, 0.85);
    --text-color: #ffffff;
    --input-bg: rgba(45, 45, 45, 0.7);
    --input-border: rgba(51, 51, 51, 0.3);
    --item-bg: rgba(45, 45, 45, 0.7);
    --hover-bg: rgba(51, 51, 51, 0.8);
    --primary-color: rgba(76, 175, 80, 0.8);
    --primary-hover: rgba(69, 160, 73, 0.9);
    --danger-color: rgba(244, 67, 54, 0.8);
    --danger-hover: rgba(218, 25, 11, 0.9);
    --scrollbar-track: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.6);
    --font-size: 14px;
    --theme-green: #4CAF50;
}

[data-theme="light"] {
    --bg-color: rgba(220, 220, 220, 0.95);
    --text-color: #333333;
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: rgba(0, 0, 0, 0.2);
    --item-bg: rgba(255, 255, 255, 0.95);
    --hover-bg: rgba(245, 245, 245, 0.95);
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --danger-color: #f44336;
    --danger-hover: #da190b;
    --scrollbar-track: rgba(0, 0, 0, 0.1);
    --scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-border: rgba(0, 0, 0, 0.2);
    --button-hover: rgba(245, 245, 245, 0.95);
    --item-border: rgba(0, 0, 0, 0.2);
    --theme-green: #4CAF50;
}

/* Simple scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
}

/* Dark theme scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Saved items container */
.saved-items {
    max-height: 300px;
    overflow-y: overlay;
    width: 100%;
    box-sizing: border-box;
    padding-right: 0;
    margin-right: 0;
}

body {
    width: 300px;
    margin: 0;
    padding: 15px;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: var(--font-size);
}

.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
    box-sizing: border-box;
}

.header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 28px;
    height: 28px;
}

.settings-btn:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

/* Settings panel */
.settings-panel {
    background-color: var(--item-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
    user-select: none;
    -webkit-user-select: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, transform 0.3s ease-out, padding 0.3s ease-out, margin 0.3s ease-out;
    display: none;
}

.settings-panel.active {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    padding: 6px;
    margin-bottom: 6px;
    display: block;
}

.settings-panel h3 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
    -webkit-user-select: none;
}

.setting-option:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

.setting-option span {
    font-size: 12px;
    color: var(--text-color);
    user-select: none;
    -webkit-user-select: none;
}

.setting-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color);
}

/* Theme switch styles */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--input-bg);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--input-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--primary-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Input and buttons */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.button-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.button-group button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-group button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Action buttons */
.copy-btn, .delete-btn, .expand-btn {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    min-width: 28px;
    height: 24px;
}

.copy-btn {
    background-color: var(--primary-color);
    color: white;
    opacity: 1;
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
    opacity: 1;
}

.expand-btn {
    min-width: 20px;
    height: 20px;
    padding: 2px 4px;
}

.expand-btn:hover, .copy-btn:hover, .delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .copy-btn {
    background-color: #4CAF50;
    color: white;
}

[data-theme="light"] .delete-btn {
    background-color: #f44336;
    color: white;
}

[data-theme="light"] .copy-btn:hover {
    background-color: #45a049;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .delete-btn:hover {
    background-color: #da190b;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-container {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    height: 40px;
}

/* Search section */
.search-section {
    position: relative;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 8px 32px 8px 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    color: var(--text-color);
    font-size: var(--font-size);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.clear-search {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--button-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    opacity: 0.7;
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    z-index: 1;
}

.clear-search:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

.clear-search .icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Saved items */
.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    margin-bottom: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.saved-item:hover {
    background-color: var(--hover-bg);
}

.saved-item-content {
    flex: 1;
    word-break: break-word;
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    white-space: pre-wrap;
    line-height: 1.2;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.saved-item-content.expanded {
    max-height: none;
    overflow: visible;
    display: block;
    line-height: 1.4;
}

/* Remove text-overflow ellipsis for links and ensure proper inline alignment */
.saved-item-content a {
    text-overflow: clip;
    display: inline;
    vertical-align: baseline;
    max-width: 100%;
    word-break: break-all;
}

.edit-textarea {
    flex: 1;
    margin-right: 8px;
    padding: 4px 8px;
    background-color: var(--item-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    color: var(--text-color);
    font-family: inherit;
    resize: both;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    max-height: 400px;
    overflow: auto;
}

.edit-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.edit-textarea::-webkit-resizer {
    border-width: 8px;
    border-style: solid;
    border-color: transparent var(--primary-color) var(--primary-color) transparent;
    background-color: transparent;
}

.icon {
    width: 16px;
    height: 16px;
    fill: var(--text-color);
    transition: fill 0.2s;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -5px;
    padding: 0;
    width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-right {
    display: flex;
    align-items: center;
}

.undo-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    opacity: 0.9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.undo-btn:hover {
    opacity: 1;
    background: rgba(25, 118, 210, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.undo-btn .icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.credit-link {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.4;
    transition: all 0.2s ease;
    font-size: 11px !important;
}

.credit-link:hover {
    opacity: 0.8;
    color: var(--primary-color);
    text-decoration: none;
}

/* Main textarea */
textarea {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: var(--font-size);
    outline: none;
    box-sizing: border-box;
    min-width: 0;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    font-family: inherit;
    width: 100%;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    background-color: var(--hover-bg);
}

/* Font size controls */
.font-size-option {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin-top: 2px;
    background: var(--item-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border-radius: 3px;
    background: var(--button-bg);
    border: 1px solid var(--input-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.font-size-btn {
    padding: 2px 6px;
    border: 1px solid var(--input-border);
    background: var(--button-bg);
    color: var(--text-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    min-width: 20px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.font-size-btn:hover {
    background: var(--button-hover);
    transform: scale(1.05);
    border-color: var(--primary-color);
}

#fontSizeValue {
    min-width: 32px;
    text-align: center;
    font-size: 11px;
    color: var(--text-color);
    background: var(--input-bg);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid var(--input-border);
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* Apply font size to all text elements */
body, input, textarea, button, .saved-item-content, .setting-option span {
    font-size: var(--font-size) !important;
}

/* Reset button */
.reset-settings {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--input-border);
    user-select: none;
    -webkit-user-select: none;
}

.reset-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.reset-btn:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

.reset-btn .icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Ensure font size is inherited by all elements */
* {
    font-size: inherit !important;
}

/* Specific font size adjustments for different elements */
.saved-item-content {
    font-size: var(--font-size) !important;
    line-height: 1.4;
}

.setting-option span {
    font-size: var(--font-size) !important;
}

/* Ensure input and textarea maintain proper sizing */
input, textarea {
    font-size: var(--font-size) !important;
    padding: 8px;
    min-height: calc(var(--font-size) * 2);
}

/* Ensure buttons maintain proper sizing */
button {
    font-size: var(--font-size) !important;
    padding: 8px 16px;
}

/* Standardize colors for both themes */
:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --danger-color: #f44336;
    --danger-hover: #da190b;
}

[data-theme="light"] {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --danger-color: #f44336;
    --danger-hover: #da190b;
}

/* Button styles */
.button-group button {
    background-color: var(--primary-color);
    color: white;
}

.button-group button:hover {
    background-color: var(--primary-hover);
}

.copy-btn {
    background-color: var(--primary-color);
    color: white;
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
}

.copy-btn:hover {
    background-color: var(--primary-hover);
}

.delete-btn:hover {
    background-color: var(--danger-hover);
}

/* Theme variables for better visibility */
:root {
    --button-bg: rgba(45, 45, 45, 0.8);
    --button-hover: rgba(51, 51, 51, 0.9);
    --input-bg: rgba(45, 45, 45, 0.8);
    --input-border: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] {
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-hover: rgba(245, 245, 245, 0.95);
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: rgba(0, 0, 0, 0.2);
}

.hyperlink {
    color: var(--theme-green);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: inline;
    vertical-align: baseline;
}

.hyperlink:hover {
    opacity: 0.8;
}

[data-theme="light"] .hyperlink {
    color: var(--theme-green);
}

[data-theme="dark"] .hyperlink {
    color: var(--theme-green);
}

/* Add expand button styles */
.expand-btn {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    min-width: 28px;
    height: 24px;
}

.expand-btn:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

/* Info icon styles */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    color: var(--text-color);
    opacity: 0.6;
    cursor: help;
    font-size: 12px;
    transition: opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.info-icon:hover {
    opacity: 1;
}

/* Update setting option styles to accommodate info icon */
.setting-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
    -webkit-user-select: none;
}

/* Update font size option styles */
.font-size-option {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin-top: 2px;
    background: var(--item-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
} 
