
:root {
    --primary: #34C759;
    --secondary: #00A86B;
    --dark: #1e2a44;
    --light: #f4faff;
    --danger: #ff4d4f;
    --warning: #ffa940;
    --purple: #007947;
    --gradient: linear-gradient(135deg, #34C759, #00A86B 50%, #007947);
    --tab-gradient: linear-gradient(90deg, #34C759, #00A86B, #007947);
    --card-gradient: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(230,240,250,0.8));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: none;
}

/* Landing Page Styles */
.landing {
    min-height: 100vh;
    background: url('https://images.unsplash.com/photo-1448375240586-882707db888b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    background-attachment: fixed;
    background-blend-mode: overlay;
    background-color: rgba(0,0,0,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.landing-content {
    max-width: 1000px;
    padding: 1.5rem;
    z-index: 2;
    position: relative;
}

.landing h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.landing p {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    background: white;
    color: var(--dark);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 10px rgba(52,199,89,0.5);
    animation: glow 2s ease-in-out infinite;
}

.cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 25px rgba(0,0,0,0.4), 0 0 15px rgba(52,199,89,0.8);
}

@keyframes glow {
    0% { box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 10px rgba(52,199,89,0.5); }
    50% { box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 20px rgba(52,199,89,0.7); }
    100% { box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 10px rgba(52,199,89,0.5); }
}

/* Particle Animation */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: float 8s infinite ease-in-out;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { transform: translateY(-50vh) scale(1.2); opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

header {
    background: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    background-attachment: fixed;
    background-blend-mode: overlay;
    background-color: rgba(0,0,0,0.3);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 3;
    width: 100%;
}

h1 {
    font-size: clamp(2rem, 6vw, 2.5rem);
    margin-bottom: 0.8rem;
}

.subtitle {
    font-size: clamp(0.9rem, 3.5vw, 1.2rem);
    opacity: 0.9;
    max-width: 900px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.8rem;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    z-index: 4;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--tab-gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 6px rgba(52,199,89,0.5);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
    min-width: 100px;
    justify-content: center;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn:hover::after, .tab-btn.active::after {
    transform: scaleX(1);
}

.tab-btn.active {
    background: linear-gradient(90deg, #007947, #34C759);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 10px rgba(52,199,89,0.7);
}

.tab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4), 0 0 12px rgba(52,199,89,0.8);
}

.tab-btn i {
    transition: transform 0.3s ease;
}

.tab-btn:hover i {
    transform: scale(1.1) rotate(10deg);
}

.tab-content {
    display: none;
    position: relative;
    min-height: 80vh;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    z-index: 3;
    max-width: 100%;
    overflow: hidden;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Backgrounds */
#dashboard, #composting, #recipes, #energy, #actions, #community {
    background: url('https://images.unsplash.com/photo-1502082553048-f009c37129b9?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    background-attachment: fixed;
    background-blend-mode: overlay;
    background-color: rgba(0,0,0,0.3);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
    max-width: 100%;
}

.card {
    background: var(--card-gradient);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: clamp(1.4rem, 4vw, 1.6rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: rotate(10deg);
}

.data-display {
    font-size: clamp(2rem, 6vw, 2.5rem);
    font-weight: bold;
    margin: 1rem 0;
    color: var(--dark);
}

.progress-container {
    background: #e6e6e6;
    border-radius: 10px;
    height: 12px;
    margin: 1rem 0;
    overflow: hidden;
    max-width: 100%;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: var(--primary);
    width: 0;
    transition: width 1.2s ease;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(0.9rem, 3vw, 1rem);
    transition: background 0.3s ease, transform 0.2s ease;
    touch-action: manipulation;
    max-width: 100%;
}

button:hover {
    background: #2ca749;
    transform: translateY(-2px);
}

.input-group {
    margin: 1rem 0;
    max-width: 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: clamp(0.9rem, 3vw, 1rem);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: clamp(0.9rem, 3vw, 1rem);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52,199,89,0.1);
}

.tip-card {
    background: var(--card-gradient);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 5px solid var(--primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: transform 0.3s ease;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tip-card:hover {
    transform: translateX(5px);
}

.simulator-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}

.simulator-result {
    background: var(--card-gradient);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    max-width: 100%;
}

footer {
    text-align: center;
    padding: 2rem 0;
    background: url('https://images.unsplash.com/photo-1519608487953-e999c86e1b89?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    background-attachment: fixed;
    background-blend-mode: overlay;
    background-color: rgba(0,0,0,0.3);
    color: white;
    position: relative;
    z-index: 2;
}

/* Composting Guide Styles */
.composting-steps {
    margin: 1rem 0;
    max-width: 100%;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    animation: slideIn 0.6s ease forwards;
    max-width: 100%;
}

.step-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step div {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Recipe Generator Styles */
.recipe-card {
    background: var(--card-gradient);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: transform 0.4s ease;
    max-width: 100%;
}

.recipe-card:hover {
    transform: translateY(-5px);
}

.recipe-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: cover;
    height: clamp(150px, 40vw, 200px);
}

/* Chart Styles */
.chart-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--card-gradient);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    max-width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
}

/* Loading Animation */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    animation: slideInRight 0.5s ease;
    z-index: 1000;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    max-width: 90%;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Accessibility */
button:focus, .tab-btn:focus, input:focus, select:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
    .tabs {
        gap: 0.4rem;
        padding: 0.6rem;
    }
    .tab-btn {
        padding: 0.5rem 1rem;
        min-width: 80px;
    }
    .card {
        padding: 1.2rem;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .tabs {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
    }
    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-width: 70px;
    }
    .landing h1 {
        font-size: clamp(2rem, 7vw, 3rem);
    }
    .landing p {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }
    .cta-button {
        padding: 0.8rem 2rem;
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }
    .card {
        padding: 1rem;
    }
    .recipe-card img {
        height: 150px;
    }
    .step {
        flex-direction: column;
        align-items: flex-start;
    }
    .step-number {
        margin-bottom: 0.5rem;
    }
    .composting-steps {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .landing-content {
        padding: 1rem;
    }
    .landing h1 {
        font-size: clamp(2.8rem, 9vw, 3.5rem);
    }
    .landing p {
        font-size: clamp(1.1rem, 5vw, 1.4rem);
    }
    h1 {
        font-size: clamp(2.2rem, 7vw, 2.8rem);
    }
    .subtitle {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
    .tabs {
        gap: 0.2rem;
        padding: 0.5rem;
    }
    .tab-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 60px;
    }
    .card {
        padding: 0.8rem;
    }
    .card h2 {
        font-size: 1.3rem;
    }
    .data-display {
        font-size: 2rem;
    }
    .notification {
        bottom: 15px;
        right: 15px;
        padding: 0.8rem 1.2rem;
    }
    .recipe-card {
        padding: 1rem;
    }
    .recipe-card img {
        height: 120px;
    }
    button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    input, select, textarea {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    .particle {
        width: 6px;
        height: 6px;
    }
    .dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .composting-steps {
        margin: 0.8rem 0;
    }
    .step-number {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 360px) {
    .landing h1 {
        font-size: clamp(2.5rem, 8.5vw, 3.2rem);
    }
    .landing p {
        font-size: clamp(1rem, 4.5vw, 1.3rem);
    }
    h1 {
        font-size: clamp(2rem, 6.5vw, 2.5rem);
    }
    .subtitle {
        font-size: clamp(0.9rem, 3.8vw, 1.2rem);
    }
    .dashboard {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .card {
        padding: 0.7rem;
    }
    .card h2 {
        font-size: 1.2rem;
    }
    .data-display {
        font-size: 1.8rem;
    }
    .tab-btn {
        min-width: 55px;
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    .input-group {
        margin: 0.8rem 0;
    }
    .composting-steps {
        margin: 0.7rem 0;
    }
    .step {
        margin-bottom: 0.8rem;
    }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
