:root {
    --primary: #0066cc;
    --secondary: #4caf50;
    --danger: #e53935;
    --bg-gradient: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#installSnackbarBtn:hover {
    background: #e0f7fa;
    color: #004a99;
}

:root {
    --primary: #0066cc;
    --secondary: #4caf50;
    --danger: #e53935;
    --bg-gradient: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-gradient);
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

.container {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    position: relative;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-in-out;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.app-logo {
    height: 96px;
    width: auto;
}

.app-title {
    font-size: 2rem;
    color: var(--primary);
    margin: 0;
}

h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.5rem;
}

label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

input,
select {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

button {
    margin-top: 1.5rem;
    width: 100%;
    padding: 1.2rem;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

button:hover {
    background: #004a99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.result,
.share-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #e6f2ff;
    border-radius: 8px;
    line-height: 1.4;
    animation: fadeIn 0.5s ease-in-out;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-button {
    flex: 1 1 calc(25% - 0.5rem);
    text-align: center;
    padding: 0.75rem 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.share-button i {
    font-size: 1.5rem;
    color: var(--primary);
}

.share-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    width: 100%;
    max-width: 500px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #004a99;
    text-decoration: underline;
}

.result-box {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

.result-label {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

.result-diff {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

.result-diff-label {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Modal styles */

.info-button {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #0066cc;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s;
    z-index: 10;
    line-height: 1;
}

.info-button:hover {
    color: #004a99;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    padding: 0.5rem;
    z-index: 10;
}

.modal-close:hover {
    color: #004a99;
    transform: scale(1.1);
}

.modal-logo {
    display: block;
    margin: 0 auto 1.5rem;
    height: 120px;
    width: auto;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    color: #0066cc;
    margin-bottom: 0.5rem;
}

.modal-section p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.info-icon {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.5rem;
    color: #0066cc;
    cursor: pointer;
}

.lang-toggle {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1rem;
    color: #0066cc;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: 1px solid #0066cc;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.lang-toggle:hover {
    background: #0066cc;
    color: white;
}


/* Notice Modal Styles */

.notice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.notice-modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

.notice-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.notice-modal-close:hover {
    color: var(--danger);
}

.notice-modal-message {
    margin: 1rem 0;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.5;
}

.notice-modal-button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.notice-modal-button:hover {
    background-color: #0052a3;
}

.privacy-notice {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.4;
}

.modal-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.modal-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.email-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.email-link:hover {
    color: #004a99;
    text-decoration: underline;
}

.privacy-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.privacy-link:hover {
    color: #004a99;
    text-decoration: underline;
}

.about-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.about-link:hover {
    color: #004a99;
    text-decoration: underline;
}

.example-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.3rem;
    transition: color 0.3s;
    display: inline-block;
}

.example-link:hover {
    color: #004a99;
    text-decoration: underline;
}

.example-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.example-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.example-image {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

.example-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    padding: 0.5rem;
    z-index: 10;
}

.example-modal-close:hover {
    color: #004a99;
    transform: scale(1.1);
}

label[for="total"] {
    display: inline-block;
    margin-right: 0.2rem;
}

.gauge-track {
    width: 100%;
    height: 14px;
    background: #eee;
    border-radius: 7px;
    margin-bottom: .4rem
}

.gauge-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 7px;
    transition: width .6s ease, background .6s ease
}

.subtitle {
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 500;
}

.scarcity-banner {
    background: #ffefc5;
    padding: .75rem 1rem .75rem 1rem;
    padding-right: 3rem;
    border-radius: 8px;
    font-size: .95rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.scarcity-banner span {
    padding-right: 2rem;
}

.action-banner {
    background: #e8f5e8;
    padding: .75rem 1rem .75rem 1rem;
    padding-right: 3rem;
    border-radius: 8px;
    font-size: .95rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.action-banner span {
    padding-right: 2rem;
}

.why-banner {
    background: #e3f2fd;
    padding: .75rem 1rem .75rem 1rem;
    padding-right: 3rem;
    border-radius: 8px;
    font-size: .95rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.why-banner span {
    padding-right: 2rem;
}

.info-icon {
    cursor: pointer;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.info-icon-orange {
    color: #ff9800;
}

.info-icon-green {
    color: #4caf50;
}

.info-icon-blue {
    color: #2196f3;
}

.instructions-text {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-align: left;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    position: relative;
}

.instructions-text:target {
    border-radius: 8px;
    padding: 1rem;
}

@keyframes highlight {
    0% {
        background: linear-gradient(135deg, #fff3cd 0%, #f8d7da 100%);
        transform: scale(1.02);
    }
    100% {
        background: linear-gradient(135deg, #e8f5e8 0%, #f3e5f5 100%);
        transform: scale(1);
    }
}

.how-it-works-image {
    text-align: center;
}

.how-it-works-image img {
    max-width: 60%;
    height: auto;
}

.tips-button {
    margin: 0 0;
    background: var(--secondary);
    color: #fff;
    font-weight: bold;
    width: 100%;
}

.reminder-button {
    margin: 0.5rem 0 1.5rem 0;
    background: #ff9800;
    color: #fff;
    font-weight: bold;
    width: 100%;
}

.progress-reminder {
    background: #e3f2fd;
    padding: .75rem 1rem;
    padding-right: 3rem;
    border-radius: 8px;
    font-size: .9rem;
    margin-top: 1.25rem;
    text-align: left;
    color: #1976d2;
    position: relative;
}

.jump-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: #e3f2fd;
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jump-link:hover {
    background: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.jump-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jump-link i {
    font-size: 0.9em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.section-separator {
    position: relative;
    height: 40px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    transform: translateY(-50%);
}

.section-separator i {
    background: #fff;
    color: #666;
    padding: 0 1rem;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.share-section {
    margin-top: 1.5rem;
    padding: 0;
    width: 100%;
    background: none;
    border-radius: 0;
    line-height: 1.4;
    animation: fadeIn 0.5s ease-in-out;
    box-sizing: border-box;
}

.pledge-slider-section {
    width: 100%;
    border-radius: 8px;
    box-sizing: border-box;
    background: none;
    border: 2px solid #000;
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
}

#pledgeSlider {
    padding: 0;
}

#resultSummary {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
    font-style: italic;
    font-size: 0.8em;
}

#bannerImage {
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
    font-style: italic;
    font-size: 0.8em;
    background: #fff;
}

#bannerCanvas {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}


/* Add to <style> section */

.install-snackbar {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(100%);
    min-width: 220px;
    max-width: 90vw;
    background: #0066cc;
    color: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75em 1.5em;
    font-size: 1rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s;
}

.install-snackbar.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

#installSnackbarBtn {
    background: #fff;
    color: #0066cc;
    border: none;
    border-radius: 16px;
    padding: 0.3em 1em;
    margin-left: 1em;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s, color 0.2s;
}

#installSnackbarBtn:hover {
    background: #e0f7fa;
    color: #004a99;
}

.input-group-bordered {
    border: 2px solid #000;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
    background: #fff;
}

.share-title {
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

#bluebox {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #e6f2ff;
    border-radius: 8px;
    line-height: 1.4;
    animation: fadeIn 0.5s ease-in-out;
}

#resultMessage {
    text-align: left;
}

.pledge-title {
    text-align: center !important;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

#pledge-subtitle {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

.tips-modal-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: #e3f2fd;
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    justify-content: center;
}

#resultMessage .tips-modal-link {
    display: block;
    text-align: center;
    margin: 1rem auto;
}

.tips-modal-link:hover {
    background: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.tips-modal-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}