body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    color: #1e293b;
}

.main-container {
    width: 100%;
    max-width: 700px;
    margin: 30px auto;
}

.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1517248135467-4c7edcad34c4');
    background-size: cover;
    background-position: center;
    padding: 60px 20px;
    border-radius: 30px;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    text-align: center;
}

.header h1 {
    font-weight: 700;
    font-size: 3em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header p {
    font-size: 1.3em;
    font-weight: 400;
    color: #f1f5f9;
}

.card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    padding: 40px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.form-group {
    margin-bottom: 30px;
}

label {
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

input:hover, select:hover, textarea:hover {
    border-color: #94a3b8;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

textarea {
    resize: vertical;
}

#map {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
}

.error-message {
    color: #ef4444;
    font-size: 0.85em;
    margin-top: 6px;
    display: none;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.btn:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(to right, #f97316, #fb923c);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(to right, #fb923c, #f97316);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: linear-gradient(to right, #64748b, #94a3b8);
    color: #ffffff;
}

.btn-secondary:hover {
    background: linear-gradient(to right, #94a3b8, #64748b);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-add-resource {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: #ffffff;
    width: 100%;
    margin-top: 12px;
}

.btn-add-resource:hover {
    background: linear-gradient(to right, #16a34a, #22c55e);
    transform: translateY(-2px);
}

.btn-remove {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: #ffffff;
    padding: 8px;
    width: auto;
}

.btn-remove:hover {
    background: linear-gradient(to right, #dc2626, #ef4444);
}

.btn-dismiss {
    background: none;
    color: #ffffff;
    padding: 0;
    font-size: 1.2em;
    line-height: 1;
}

.btn-dismiss:hover {
    color: #e2e8f0;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.custom-resources {
    margin-bottom: 30px;
}

.custom-resource-input {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    position: relative;
}

.custom-resource-name {
    flex: 2;
}

.custom-resource-amount {
    flex: 1;
}

.custom-resource-unit {
    flex: 1;
}

.custom-resource-input .error-message {
    position: absolute;
    bottom: -20px;
    left: 0;
}

.result h2, .history h2 {
    color: #1e293b;
    font-size: 1.8em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#predictionOutput {
    font-size: 1em;
    color: #1e293b;
    line-height: 1.8;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.loader {
    border: 5px solid #f1f5f9;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active, .tab-btn:hover {
    background: #3b82f6;
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.history ul {
    list-style: none;
    padding: 0;
}

.history li {
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    font-size: 0.95em;
    color: #1e293b;
    transition: background 0.2s ease;
}

.history li:hover {
    background: #e2e8f0;
}

.footer {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    color: #f1f5f9;
    text-align: center;
    margin-top: 30px;
}

.particle-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 2s linear infinite;
    box-shadow: 0 0 4px rgba(255,255,255,0.3);
}

@keyframes float {
    0% { transform: translateY(0); opacity: 0.5; }
    100% { transform: translateY(-100vh); opacity: 0; }
}

.animate-header {
    opacity: 0;
    transform: translateY(-30px);
    animation: slideInHeader 0.8s ease-out forwards;
}

@keyframes slideInHeader {
    to { opacity: 1; transform: translateY(0); }
}

.animate-card {
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.6s ease-out forwards;
}

.animate-card:nth-child(1) { animation-delay: 0.2s; }
.animate-card:nth-child(2) { animation-delay: 0.4s; }
.animate-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes slideIn {
    to { opacity: 1; transform: translateY(0); }
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: #22c55e;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
    font-weight: 500;
    animation: slideInNotification 0.4s ease-out;
    position: relative;
    border-left: 4px solid #16a34a;
}

.notification.error {
    background: #ef4444;
    border-left-color: #dc2626;
}

.notification i {
    font-size: 1.4em;
}

.notification .btn-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
}

@keyframes slideInNotification {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px;
        max-width: 100%;
    }

    .header h1 {
        font-size: 2.3em;
    }

    .card {
        padding: 30px;
    }

    .btn {
        padding: 12px;
    }

    .custom-resource-input {
        flex-direction: column;
        gap: 8px;
    }

    .custom-resource-name, .custom-resource-amount, .custom-resource-unit {
        width: 100%;
    }

    .notification-container {
        top: 10px;
        right: 10px;
        max-width: 90%;
    }

    #map {
        height: 150px;
    }

    .tabs {
        flex-direction: column;
        gap: 8px;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }
}