:root {
    --primary-color: #4DB848;
    --primary-dark: #3a9434;
    --primary-light: #7dce79;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-light);
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    padding-bottom: 60px; /* Space for mobile navbar */
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background-color: var(--white);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    /*opacity: 0;*/
    transition: opacity 0.5s ease;
}

/* Header Styles */
.app-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.app-logo {
    max-height: 50px;
    width: auto;
    background-color: var(--white);
    padding: 3px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.user-info {
    text-align: right;
    color: var(--white);
}

.points {
    font-weight: 500;
    color: var(--white);
    font-size: 1.1rem;
}

.points i {
    color: #FFD700;
    margin-right: 5px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); /* Add shadow for better contrast */
}

/* Content Styles */
.app-content {
    padding-bottom: 10px;
}

.back-button {
    color: white;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.back-button:hover {
    color: rgba(255, 255, 255, 0.8);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Mission Title Links */
.mission-title-link {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mission-title-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Mission Cards */
.mission-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border: none;
    transition: transform 0.2s ease;
}

.mission-card:hover {
    transform: translateY(-3px);
}

.mission-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(77, 184, 72, 0.1); /* Lighter version of primary color */
    padding: 10px;
}

.mission-image img {
    max-width: 100%;
    /*max-height: 80px;*/
    object-fit: contain;
}

.mission-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.points-badge {
    background-color: var(--primary-light);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-mission {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
}

.btn-mission:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

/* Product Cards */
.product-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border: none;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    /*height: 120px;*/
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-light);
    padding: 10px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-price {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 5px;
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.points-convert {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.points-convert i {
    color: #FFD700;
    margin-right: 5px;
}

.btn-convert {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
}

.btn-convert:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

/* Disabled conversion button states */
.btn-convert.disabled {
    background-color: #e0e0e0;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-convert.disabled:hover {
    background-color: #e0e0e0;
    transform: none;
    box-shadow: none;
}

.product-card.insufficient-points {
    position: relative;
}

.product-card.insufficient-points::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    pointer-events: none;
    border-radius: 10px;
}

.product-card.insufficient-points .points-convert {
    color: #d9534f;
}

.product-title-link {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.product-title-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.product-image {
    position: relative;
    overflow: hidden;
    border-top-left-radius: calc(0.25rem - 1px);
    border-top-right-radius: calc(0.25rem - 1px);
}

/* Mobile Navbar */
.mobile-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    text-decoration: none; /* Remove default link underline */
    padding: 5px 0;
    width: 25%;
    text-align: center;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--primary-color);
    text-decoration: none; /* Ensure no underline on hover */
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .product-desc {
        height: 36px;
        -webkit-line-clamp: 2;
    }

    .product-image {
        /*height: 100px;*/
        height: 100%;
    }

    .app-logo {
        max-height: 40px;
    }
}

/* Animation for buttons */
.btn-mission, .btn-convert {
    transition: all 0.2s ease;
}

.btn-mission:active, .btn-convert:active {
    transform: scale(0.95);
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
}

.splash-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-logo {
    width: 120px;
    height: auto;
    background-color: white;
    padding: 10px;
    border-radius: 20px;
    animation: pulse 1.5s infinite;
}

.splash-spinner {
    margin-top: 20px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Loading Component */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(77, 184, 72, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/*agri notify*/
.agri-notify-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 320px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agri-notify {
    background-color: #fff;
    border-left: 4px solid #4caf50;
    /* Default color - success */
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: agri-slide-in 0.3s ease-out;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.agri-notify.success {
    border-left-color: #4caf50;
    /* Green */
}

.agri-notify.error {
    border-left-color: #f44336;
    /* Red */
}

.agri-notify.warning {
    border-left-color: #ff9800;
    /* Orange */
}

.agri-notify.info {
    border-left-color: #2196f3;
    /* Blue */
}

.agri-notify:hover {
    transform: translateY(-3px);
}

.agri-notify.closing {
    animation: agri-slide-out 0.3s ease-in forwards;
}

.agri-notify-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.agri-notify-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.agri-notify-icon {
    margin-right: 8px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agri-notify-icon svg {
    width: 20px;
    height: 20px;
}

.agri-notify-icon.success svg {
    fill: #4caf50;
}

.agri-notify-icon.error svg {
    fill: #f44336;
}

.agri-notify-icon.warning svg {
    fill: #ff9800;
}

.agri-notify-icon.info svg {
    fill: #2196f3;
}

.agri-notify-title {
    font-weight: bold;
    color: #333;
    flex: 1;
}

.agri-notify-body {
    color: #666;
    font-size: 0.9rem;
    word-break: break-word;
    /*padding-left: 28px;*/
    /* Space for icon alignment */
}

.agri-notify-close {
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    margin-left: 10px;
}

@keyframes agri-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes agri-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* end agri notify */

/* App Install Banner */
#app-install-banner {
    border-radius: 10px;
    background-color: #ffffff;
    transition: all 0.3s ease-in-out;
}

#app-install-banner .btn {
    border-radius: 6px;
    font-weight: 500;
}

#install-button {
    transition: background-color 0.2s ease;
}

#install-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
/* Media query for small screens */
@media (max-width: 576px) {
    #app-install-banner {
        margin-left: 10px;
        margin-right: 10px;
    }
}
/*App Install Banner*/

.unread {
    background-color: #eeeeee;
}