fruits-veggies-ui / style.css
Baskar2005's picture
Upload 143 files
44b5a6f verified
/* Base Styles */
:root {
--primary-color: #4a7c59;
--secondary-color: #8cb369;
--accent-color: #f4e285;
--text-color: #333;
--light-text: #f9f9f9;
--background-color: #f9f9f9;
--card-background: #ffffff;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}
/* Dark Mode Variables */
body.dark {
--text-color: #f1f1f1;
--background-color: #222;
--card-background: #333;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Poppins", sans-serif;
color: var(--text-color);
background-color: var(--background-color);
line-height: 1.6;
transition: var(--transition);
}
a {
text-decoration: none;
color: inherit;
}
ul {
list-style: none;
}
/* Header & Navigation */
header {
position: fixed;
width: 100%;
z-index: 1000;
background-color: rgba(255, 255, 255, 0.95);
box-shadow: var(--shadow);
transition: var(--transition);
}
body.dark header {
background-color: rgba(34, 34, 34, 0.95);
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 5%;
max-width: 1400px;
margin: 0 auto;
}
.logo a {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
font-weight: 500;
transition: var(--transition);
position: relative;
}
.nav-links a:hover,
.nav-links a.active {
color: var(--primary-color);
}
.nav-links a::after {
content: "";
position: absolute;
width: 0;
height: 2px;
bottom: -5px;
left: 0;
background-color: var(--primary-color);
transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
width: 100%;
}
/* Hamburger Menu */
.hamburger {
display: none;
flex-direction: column;
cursor: pointer;
gap: 5px;
}
.hamburger span {
width: 25px;
height: 3px;
background: var(--text-color);
transition: var(--transition);
}
/* Dark mode toggle button */
#theme-toggle {
background: none;
border: none;
font-size: 1.2rem;
cursor: pointer;
margin-left: 1rem;
}
/* Hero Section */
.hero {
height: 100vh;
background: url('https://media.nature.com/lw767/magazine-assets/d42473-024-00291-0/d42473-024-00291-0_27698496.jpg') center/cover no-repeat;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.hero::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(74, 124, 89, 0.4);
}
.hero-content {
position: relative;
text-align: center;
color: var(--light-text);
z-index: 1;
}
.hero-content h1 {
font-size: 3rem;
margin-bottom: 1rem;
}
.btn {
display: inline-block;
padding: 0.75rem 1.5rem;
background-color: var(--primary-color);
color: var(--light-text);
border-radius: 5px;
transition: var(--transition);
margin-top: 1rem;
}
.btn:hover {
background-color: var(--secondary-color);
}
/* Categories & Cards */
.categories {
padding: 4rem 5%;
text-align: center;
}
.category-cards {
display: flex;
flex-wrap: wrap;
gap: 2rem;
justify-content: center;
margin-top: 2rem;
}
.card {
width: 300px;
background-color: var(--card-background);
box-shadow: var(--shadow);
border-radius: 10px;
overflow: hidden;
transition: var(--transition);
}
.card:hover {
transform: translateY(-5px);
}
.card-image {
height: 200px;
background-size: cover;
background-position: center;
position: relative;
}
.card-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(74, 124, 89, 0.3);
}
.card-content {
padding: 1rem;
}
.card-content h3 {
margin-bottom: 0.5rem;
}
/* Page Header for Listing Pages */
.page-header {
height: 50vh;
background-size: cover;
background-position: center;
position: relative;
}
.page-header::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(74, 124, 89, 0.4);
}
.page-header-content {
position: relative;
z-index: 1;
text-align: center;
color: var(--light-text);
top: 50%;
transform: translateY(-50%);
}
/* Produce List Items */
.produce-list {
padding: 4rem 5%;
display: grid;
gap: 2rem;
}
.produce-item {
display: flex;
flex-wrap: wrap;
background-color: var(--card-background);
box-shadow: var(--shadow);
border-radius: 10px;
overflow: hidden;
transition: var(--transition);
}
.produce-item:hover {
transform: translateY(-3px);
}
.produce-images {
display: flex;
width: 100%;
}
.produce-image {
flex: 1;
background-size: cover;
background-position: center;
min-height: 200px;
}
.produce-info {
padding: 1rem;
flex-basis: 100%;
}
/* Comparison Pages */
.comparison-header {
text-align: center;
padding: 3rem 5%;
background-color: var(--card-background);
}
.comparison-container {
padding: 2rem 5%;
}
.comparison-section {
margin-bottom: 2rem;
}
.visual-comparison {
display: flex;
flex-wrap: wrap;
gap: 2rem;
justify-content: center;
}
.comparison-item {
flex: 1;
max-width: 400px;
text-align: center;
}
.comparison-image {
width: 100%;
height: 250px;
background-size: cover;
background-position: center;
border-radius: 5px;
}
.comparison-table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
}
.comparison-table th,
.comparison-table td {
border: 1px solid #ddd;
padding: 0.75rem;
text-align: left;
}
.comparison-table th {
background-color: var(--primary-color);
color: var(--light-text);
}
.back-link {
display: inline-block;
margin-top: 1rem;
color: var(--primary-color);
transition: var(--transition);
}
.back-link:hover {
text-decoration: underline;
}
/* Responsive Design */
@media (max-width: 768px) {
.nav-links {
position: fixed;
top: 70px;
right: -100%;
background-color: var(--card-background);
flex-direction: column;
gap: 1rem;
padding: 2rem;
width: 200px;
height: calc(100% - 70px);
transition: var(--transition);
}
.nav-links.active {
right: 0;
}
.hamburger {
display: flex;
}
.produce-item {
flex-direction: column;
}
}
/* Base Styles */
:root {
--primary-color: #4a7c59;
--secondary-color: #8cb369;
--accent-color: #f4e285;
--text-color: #333;
--light-text: #f9f9f9;
--background-color: #f9f9f9;
--card-background: #ffffff;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}
/* Dark Mode Variables */
body.dark {
--text-color: #f1f1f1;
--background-color: #222;
--card-background: #333;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Poppins", sans-serif;
color: var(--text-color);
background-color: var(--background-color);
line-height: 1.6;
transition: var(--transition);
}
.apple-header {
text-align: center;
padding: 3rem 5%;
background-color: var(--card-background);
}
.apple-comparison {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 2rem 5%;
}
.apple-category {
flex: 1;
max-width: 48%;
background-color: var(--card-background);
box-shadow: var(--shadow);
padding: 1.5rem;
border-radius: 10px;
}
.apple-category h2 {
text-align: center;
margin-bottom: 1rem;
}
.apple-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.apple-item {
text-align: center;
padding: 1rem;
background-color: var(--background-color);
border-radius: 8px;
box-shadow: var(--shadow);
}
.apple-item img {
width: 100%;
height: auto;
border-radius: 5px;
}
@media (max-width: 768px) {
.apple-comparison {
flex-direction: column;
}
.apple-category {
max-width: 100%;
margin-bottom: 2rem;
}
}
.fruits-header {
padding: 100px 5% 20px; /* Adjusts top spacing to push content below navbar */
text-align: center;
background-color: var(--card-background);
}
.vegetables-header{
padding: 100px 5% 20px; /* Adjusts top spacing to push content below navbar */
text-align: center;
background-color: var(--card-background);
}
/* Add this CSS rule to your existing style.css file */
/* Adjust the top padding of the veg-header section to clear the fixed header */
.veg-header {
padding: 100px 5% 20px; /* Adjusts top spacing to push content below navbar */
text-align: center;
background-color: var(--card-background);
}
.about-content,
.contact-form-section {
max-width: 800px;
margin: 40px auto;
padding: 20px;
line-height: 1.8;
}
.about-content h2,
.contact-form-section h2 {
font-size: 2rem;
margin-bottom: 10px;
color: #333;
}
.about-content p,
.contact-form-section p {
font-size: 1rem;
color: #555;
}
/* Contact Form Specific Styles */
.contact-form-section form {
display: flex;
flex-direction: column;
gap: 15px;
margin-top: 20px;
}
.contact-form-section label {
font-weight: 600;
margin-bottom: 5px;
}
.contact-form-section input,
.contact-form-section textarea {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
.contact-form-section button.btn {
background: #007bff;
color: #fff;
border: none;
padding: 12px;
font-size: 1rem;
border-radius: 5px;
cursor: pointer;
}
.contact-form-section button.btn:hover {
background: #0056b3;
}
/* Responsive Styles */
@media (max-width: 768px) {
.nav-links {
flex-direction: column;
gap: 10px;
}
.about-content,
.contact-form-section {
padding: 15px;
}
}
.page-header {
text-align: center;
padding: 100px 5% 20px;
background-color: var(--card-background);
}
.page-header h1 {
font-size: 2rem;
color: var(--primary-color);
margin-bottom: 1rem;
}
.page-header p {
font-size: 1rem;
color: var(--text-color);
}
* Footer Styles */
.footer {
background-color: white;
border-radius: 0.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin: 1rem;
padding: 1.5rem;
transition: background-color 0.3s ease, color 0.3s ease;
}
.footer-content {
width: 100%;
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer-links {
display: flex;
flex-wrap: wrap;
justify-content: center;
font-size: 0.875rem;
color: #4a5568;
margin: 0;
padding: 0;
list-style-type: none;
}
.footer-links li {
margin-right: 1rem;
}
.footer-links a {
text-decoration: none;
color: inherit;
transition: color 0.3s ease;
}
.footer-divider {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
border-color: #e2e8f0;
}
.footer-credit {
text-align: center;
font-size: 0.875rem;
color: #6b7280;
}
.footer-credit a {
text-decoration: none;
color: #4a5568;
}
/* Dark Mode Footer Styles */
body.dark .footer {
background-color: #333;
color: #f1f1f1;
}
body.dark .footer-links a {
color: #f1f1f1;
}
body.dark .footer-divider {
border-color: #555;
}
body.dark .footer-credit a {
color: #f1f1f1;
}