:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f2;
    --bg-tertiary: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #70757a;
    --text-tertiary: #4d5156;
    --border-primary: #dfe1e5;
    --border-secondary: #e4e4e4;
    --border-tertiary: #dadce0;
    --link-primary: #1a0dab;
    --link-visited: #681da8;
    --link-url: #006621;
    --shadow-color: rgba(32,33,36,.28);
    --shadow-hover: rgba(0,0,0,.1);
    --button-bg: #f8f9fa;
    --button-border: #f8f9fa;
    --button-text: #3c4043;
    --button-hover-bg: #f8f9fa;
    --button-hover-border: #dadce0;
    --button-hover-text: #202124;
    --search-icon-color: #9aa0a6;
    --error-bg: #fce8e6;
    --error-border: #f28b82;
    --error-text: #c5221f;
    --error-text-secondary: #5f6368;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #202124;
    --bg-secondary: #292a2d;
    --bg-tertiary: #303134;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-tertiary: #bdc1c6;
    --border-primary: #5f6368;
    --border-secondary: #3c4043;
    --border-tertiary: #5f6368;
    --link-primary: #8ab4f8;
    --link-visited: #c58af9;
    --link-url: #5bb974;
    --shadow-color: rgba(0,0,0,.5);
    --shadow-hover: rgba(255,255,255,.1);
    --button-bg: #303134;
    --button-border: #5f6368;
    --button-text: #e8eaed;
    --button-hover-bg: #3c4043;
    --button-hover-border: #8ab4f8;
    --button-hover-text: #ffffff;
    --search-icon-color: #9aa0a6;
    --error-bg: #3c1f1e;
    --error-border: #8b3226;
    --error-text: #f28b82;
    --error-text-secondary: #9aa0a6;
}

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

body {
    font-family: arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

body.transitions-enabled {
    transition: background-color 0.3s, color 0.3s;
}

/* Logo styles */
.logo .s { color: #4285f4; }
.logo .o { color: #ea4335; }
.logo .n { color: #fbbc04; }
.logo .e { color: #4285f4; }
.logo .c { color: #34a853; }
.logo .h { color: #ea4335; }
.logo .k { color: #4285f4; }
.logo .o2 { color: #fbbc04; }

/* Search box styles */
.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 0 15px;
    transition: box-shadow 0.2s, border-color 0.2s;
    background: var(--bg-primary);
    height: 44px;
}

.search-box:hover,
.search-box:focus-within {
    box-shadow: 0 1px 6px var(--shadow-color);
    border-color: rgba(223,225,229,0);
}

.search-icon {
    color: var(--search-icon-color);
    margin-right: 10px;
    font-size: 20px;
}

input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 0;
    background: transparent;
    color: var(--text-primary);
    height: 100%;
}

button {
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    color: var(--button-text);
    font-size: 14px;
    padding: 0 16px;
    height: 44px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

button:hover {
    background-color: var(--button-hover-bg);
    box-shadow: 0 1px 1px var(--shadow-hover);
    border: 1px solid var(--button-hover-border);
    color: var(--button-hover-text);
}

/* Settings button (cog icon) */
.settings-btn {
    background: var(--button-bg);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    padding: 0;
}

.settings-btn:hover {
    background: var(--button-hover-bg);
    border-color: var(--button-hover-border);
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Settings Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow-color);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: normal;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: auto;
    height: auto;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
    box-shadow: none;
}

.modal-body {
    padding: 24px;
}

.setting-item {
    margin-bottom: 24px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.theme-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-option {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.theme-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
}

.theme-option.active {
    background: var(--button-hover-bg);
    border-color: var(--button-hover-border);
    color: var(--button-hover-text);
}

.theme-option-icon {
    font-size: 24px;
}
