Here's a complete implementation of all the requested features:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Card with Features</title>
<style>
:root {
--primary-color: #2c3e50;
--secondary-color: #ecf0f1;
--accent-color: #3498db;
--text-color: #333;
--background-color: #fff;
--card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.dark-theme {
--primary-color: #1a1a1a;
--secondary-color: #333;
--accent-color: #4a90e2;
--text-color: #f0f0f0;
--background-color: #222;
--card-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: var(--background-color);
color: var(--text-color);
transition: background-color 0.3s, color 0.3s;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
/* Product Card */
.product-card {
background-color: var(--secondary-color);
border-radius: 10px;
box-shadow: var(--card-shadow);
overflow: hidden;
margin-bottom: 30px;
transition: transform 0.3s;
display: flex;
flex-direction: column;
}
.product-card:hover {
transform: translateY(-5px);
}
.product-image {
height: 200px;
background-color: #ddd;
background-image: url('https://via.placeholder.com/400x200');
background-size: cover;
background-position: center;
}
.product-content {
padding: 20px;
}
.product-title {
font-size: 1.5rem;
margin: 0 0 10px;
color: var(--text-color);
}
.product-price {
font-size: 1.8rem;
font-weight: bold;
margin: 10px 0;
color: var(--accent-color);
}
.buy-button {
background-color: var(--accent-color);
color: white;
border: none;
padding: 12px 20px;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
width: 100%;
transition: background-color 0.3s;
}
.buy-button:hover {
background-color: #2980b9;
}
/* Theme Toggle */
.theme-toggle {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.theme-toggle label {
margin-right: 10px;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 30px;
}
.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: 30px;
}
.slider:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--accent-color);
}
input:checked + .slider:before {
transform: translateX(30px);
}
/* Progress Bar */
.progress-container {
margin: 30px 0;
}
.progress-label {
margin-bottom: 10px;
display: block;
}
.progress-bar {
width: 100%;
height: 20px;
background-color: #e0e0e0;
border
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Card with Features</title>
<style>
:root {
--primary-color: #2c3e50;
--secondary-color: #ecf0f1;
--accent-color: #3498db;
--text-color: #333;
--background-color: #fff;
--card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.dark-theme {
--primary-color: #1a1a1a;
--secondary-color: #333;
--accent-color: #4a90e2;
--text-color: #f0f0f0;
--background-color: #222;
--card-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: var(--background-color);
color: var(--text-color);
transition: background-color 0.3s, color 0.3s;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
/* Product Card */
.product-card {
background-color: var(--secondary-color);
border-radius: 10px;
box-shadow: var(--card-shadow);
overflow: hidden;
margin-bottom: 30px;
transition: transform 0.3s;
display: flex;
flex-direction: column;
}
.product-card:hover {
transform: translateY(-5px);
}
.product-image {
height: 200px;
background-color: #ddd;
background-image: url('https://via.placeholder.com/400x200');
background-size: cover;
background-position: center;
}
.product-content {
padding: 20px;
}
.product-title {
font-size: 1.5rem;
margin: 0 0 10px;
color: var(--text-color);
}
.product-price {
font-size: 1.8rem;
font-weight: bold;
margin: 10px 0;
color: var(--accent-color);
}
.buy-button {
background-color: var(--accent-color);
color: white;
border: none;
padding: 12px 20px;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
width: 100%;
transition: background-color 0.3s;
}
.buy-button:hover {
background-color: #2980b9;
}
/* Theme Toggle */
.theme-toggle {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.theme-toggle label {
margin-right: 10px;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 30px;
}
.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: 30px;
}
.slider:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--accent-color);
}
input:checked + .slider:before {
transform: translateX(30px);
}
/* Progress Bar */
.progress-container {
margin: 30px 0;
}
.progress-label {
margin-bottom: 10px;
display: block;
}
.progress-bar {
width: 100%;
height: 20px;
background-color: #e0e0e0;
border