:root {
    /* Base colors - unified color palette */
    --color-black: #1A1C1F;
    --color-white: #FBFBFB;
    --color-gray-100: #F1F1F1;
    --color-gray-200: #E0E0E0;
    --color-gray-300: #C0C0C0;
    --color-gray-400: #A0A0A0;
    --color-gray-500: #808080;
    --color-gray-600: #606060;
    --color-gray-700: #404040;
    --color-gray-800: #303030;
    --color-gray-900: #212226;
    
    /* Opacity values */
    --opacity-low: 0.1;
    --opacity-medium: 0.4;
    --opacity-high: 0.7;
    
    /* Light theme semantic variables */
    --bg-color: var(--color-white);
    --text-color: var(--color-black);
    --secondary-text-color: rgba(0, 0, 0, var(--opacity-high));
    --footer-text-color: #4D4D4D;
    --footer-text-hover-color: var(--color-black);
    --card-bg-color: white;
    --toggle-bg-color: rgba(9, 10, 11, 0.06);
    --toggle-active-bg: white;
    --toggle-active-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    --icon-stroke: var(--color-black);
    --icon-stroke-secondary: rgba(15, 16, 18, 0.50);
    --border-color: rgba(0, 0, 0, var(--opacity-low));
    --card-shadow: 0px 0px 0px 1px rgba(9, 10, 11, 0.06), 
                  0px 1px 1px -0.5px rgba(9, 10, 11, 0.06), 
                  0px 3px 3px -1.5px rgba(9, 10, 11, 0.06), 
                  0px 6px 6px -3px rgba(9, 10, 11, 0.06);
    --instruction-number-color: var(--color-black);

    /* Light theme variables */
    --background: #F5F5F7;
    --text: #1D1D1F;
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-tertiary: rgba(0, 0, 0, 0.45);
    --card-bg: #FFFFFF;
    --card-shadow: 0px 0px 0px 0.5px rgba(0, 0, 0, 0.05), 
                  0px 2px 8px -2px rgba(0, 0, 0, 0.1);
    --outline: rgba(0, 0, 0, 0.10);
    --toggle-bg: rgba(0, 0, 0, 0.06);
    --icon-stroke: #1D1D1F;
    --icon-stroke-secondary: rgba(0, 0, 0, 0.65);
    --opacity-medium: 0.28;
}

/* Dark theme variables */
.dark-theme {
    --bg-color: var(--color-black);
    --text-color: var(--color-white);
    --secondary-text-color: rgba(255, 255, 255, var(--opacity-high));
    --footer-text-color: var(--color-gray-400);
    --footer-text-hover-color: var(--color-white);
    --card-bg-color: #2A2C2F;
    --toggle-bg-color: rgba(255, 255, 255, var(--opacity-low));
    --toggle-active-bg: #3A3C3F;
    --toggle-active-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
    --icon-stroke: var(--color-white);
    --icon-stroke-secondary: rgba(255, 255, 255, 0.50);
    --border-color: rgba(255, 255, 255, var(--opacity-low));
    --card-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.06), 
                  0px 2px 4px rgba(0, 0, 0, 0.25);
    --instruction-number-color: var(--color-white);

    /* Dark theme variables */
    --background: #1D1D1F;
    --text: #F5F5F7;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --card-bg: #2C2C2E;
    --card-shadow: 0px 0px 0px 0.5px rgba(255, 255, 255, 0.05), 
                  0px 2px 8px -2px rgba(0, 0, 0, 0.25);
    --outline: rgba(255, 255, 255, 0.10);
    --toggle-bg: rgba(255, 255, 255, 0.1);
    --icon-stroke: #F5F5F7;
    --icon-stroke-secondary: rgba(255, 255, 255, 0.65);
    --opacity-medium: 0.5;
}

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

/* We already have inline critical CSS in the HTML for body sizing */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text);
    transition: background-color 0.3s ease;
}

.container {
    width: 100%;
    min-height: 400px;
    background: var(--background);
    outline: 1px var(--outline) solid;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
}

.header-section {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.logo svg path {
    stroke: var(--icon-stroke);
    transition: stroke 0.3s ease;
}

.title {
    color: var(--text);
    font-size: 18px;
    font-family: 'Inter Display', sans-serif;
    font-weight: 600;
    line-height: 20px;
    word-wrap: break-word;
}

.content-section {
    flex: 1;
    margin: 0 16px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toggle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 0 16px 0;
}

.permission-toggle {
    margin: 0;
    padding: 0;
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.permission-row {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.permission-status-container {
    display: flex;
    margin-top: 16px;
    font-weight: 500;
    font-size: 16px;
    color: var(--text);
}

#permissionStatus {
    margin-left: 4px;
    font-style: normal;
    font-size: 16px;
    transition: color 0.3s;
}

.divider {
    height: 1px;
    background-color: var(--outline);
    margin: 0 16px;
}

.instructions-card {
    padding: 16px;
}

.instruction-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.instruction-number {
    display: inline-block;
    min-width: auto;
    margin-right: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: color 0.3s ease;
}

.instruction-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.footer-section {
    padding: 16px;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 20px;
    word-wrap: break-word;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-text:hover {
    color: var(--text);
    cursor: pointer;
}

.theme-toggle {
    background-color: var(--toggle-bg);
    border-radius: 40px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: background-color 0.3s ease;
}

.toggle-button {
    padding: 4px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-button.active {
    height: 28px;
    padding: 4px;
    background: white;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 99px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon {
    width: 16px;
    height: 16px;
    position: relative;
}

.icon svg path {
    stroke: var(--icon-stroke-secondary);
    transition: stroke 0.3s ease;
}

.toggle-button.active .icon svg path {
    stroke: var(--icon-stroke);
}

/* Dark theme class applied to body */
body.dark-theme {
    background-color: var(--background);
    color: var(--text);
}

/* Slider switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #4CAF50;
}

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

/* Dark theme version of the slider */
.dark-theme .slider {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .slider:before {
    background-color: #fff;
}

.dark-theme input:checked + .slider {
    background-color: #4CAF50;
}

.dark-theme .toggle-button.active {
    background: var(--card-bg);
}