@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    /* Pastel Dark Mode Colors (now default) */
    --primary-color: #8D9EFF; /* Muted Lavender Blue */
    --secondary-color: #F8BBD0; /* Muted Light Pink */
    --background-color: #2F3C7E; /* Soft Deep Indigo */
    --card-background: #3A4790; /* Slightly Lighter Indigo */
    --text-color: #E0E0E0; /* Very Light Gray */
    --shadow-color: rgba(141, 158, 255, 0.2); /* Muted lavender shadow */
    --deep-shadow-color: rgba(141, 158, 255, 0.4); /* Deeper muted lavender shadow */
    --paragraph-color: #B0B7D6; /* Light Muted Blue */
    --button-gradient-start: #8D9EFF; /* Muted Lavender Blue */
    --button-gradient-end: #778BEB;   /* Slightly darker Lavender Blue */
    --border-color: rgba(141, 158, 255, 0.15); /* Muted lavender border */
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%233A4790" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

body[data-theme='light'] {
    /* Pastel Light Mode Colors */
    --primary-color: #A2D2FF; /* Soft Sky Blue */
    --secondary-color: #FFC7EA; /* Pastel Pink */
    --background-color: #F8F9FA; /* Very Light Gray */
    --card-background: #FFFFFF; /* White */
    --text-color: #495057; /* Soft Dark Gray */
    --shadow-color: rgba(162, 210, 255, 0.2); /* Soft blue shadow */
    --deep-shadow-color: rgba(162, 210, 255, 0.4); /* Deeper soft blue shadow */
    --paragraph-color: #6C757D; /* Slightly lighter soft dark gray */
    --button-gradient-start: #B0E0E6; /* Powder Blue */
    --button-gradient-end: #A2D2FF;   /* Soft Sky Blue */
    --border-color: rgba(162, 210, 255, 0.1); /* Very light blue border */
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23CED4DA" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    flex-direction: column; /* Changed to column to stack elements vertically */
}

.container {
    background-color: var(--card-background);
    padding: 2rem 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 30px var(--deep-shadow-color), 0 8px 12px var(--shadow-color);
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color);
    margin-bottom: 20px; /* Add some margin below the container */
}

h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

p {
    margin-bottom: 2rem;
    color: var(--paragraph-color);
}

#start-button {
    background: linear-gradient(145deg, var(--button-gradient-start), var(--button-gradient-end));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--shadow-color), inset 0 -3px 5px rgba(0,0,0,0.1);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    margin-bottom: 20px; /* Space between button and webcam */
}

#start-button:hover {
    background-color: var(--button-gradient-end);
    box-shadow: 0 12px 25px var(--deep-shadow-color), inset 0 -4px 6px rgba(0,0,0,0.15);
    transform: translateY(-3px) scale(1.02);
}

#start-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px var(--shadow-color), inset 0 2px 5px rgba(0,0,0,0.15);
}

#webcam-container {
    margin-top: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
}

#label-container {
    margin-top: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

#label-container div {
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

/* Theme Toggle Button Styles */
.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
}

#theme-toggle {
    background: var(--card-background);
    border: 1px solid var(--border-color); /* Use pastel border color */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Enhanced shadow for a button-like feel */
    box-shadow: 0 3px 8px var(--shadow-color), inset 0 1px 3px rgba(0,0,0,0.05); /* Lighter shadows */
    transition: all 0.3s ease;
    color: var(--text-color); /* Icon color */
}

#theme-toggle:hover {
    box-shadow: 0 5px 12px var(--deep-shadow-color), inset 0 1px 4px rgba(0,0,0,0.1); /* Lighter hover shadows */
    transform: translateY(-1px);
}

#theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor; /* Ensure SVG color changes with theme */
    fill: none; /* Make sure fill is none if stroke is used for outline */
}

/* Icon display logic: Moon for dark (default), Sun for light */
/* Hide sun icon by default (dark mode) */
body .theme-switch-wrapper .sun {
    display: none;
}

/* Show sun icon in light mode, hide moon */
body[data-theme='light'] .theme-switch-wrapper .sun {
    display: block;
}
body[data-theme='light'] .theme-switch-wrapper .moon {
    display: none;
}
/* Show moon icon in dark mode (default) */
body .theme-switch-wrapper .moon {
    display: block;
}
