body, html {
    overflow: hidden;
    padding-top: 10px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #411B56;
    color: #ffffff;
    padding: clamp(10px, 3vw, 20px);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

h1, h2 {
    color: #DC1967;
    text-align: center;
}

.full-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100%;
    padding-top: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.input-group {
    width: 80%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.input-group input[type="tel"] {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #672A6C;
    color: #F5C530;
    font-size: 1.5em;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.input-group button {
    width: 100%;
    box-sizing: border-box;
}

label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2em;
}

input[type="number"] {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #672A6C;
    color: #F5C530;
    font-size: 1.5em;
    -webkit-appearance: none;
    appearance: none;
}

input[type="number"]:hover {
    background: #87377F;
}

button {
    background-color: #2dbdec;
    color: #ffffff;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 1.2em;
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
    flex-shrink: 0;
}

button:hover {
    background-color: #87377f;
}

.hidden {
    display: none !important;
}

.section {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border-bottom: 1px solid #ccc;
    background: #87377F;
    color: #ffffff;
    padding: 20px;
    margin: 0 20px 20px 20px;
    border-radius: 10px;
    width: auto;
    min-width: 80%;
    box-sizing: border-box;
}

.section h2 {
    color: #F5C530;
    font-weight: bold;
    margin-bottom: 10px;
}

.section p {
    font-size: 1.2em;
    margin: 5px 0;
    color: #ffffff;
}

.section .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #87377f;
}

.section .label {
    font-size: 1em;
    color: #ccc;
}

/* Results Screen Specific Styles */
#results {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    min-height: calc(100vh - 160px); /* Account for header space */
}

.review-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 20px)); /* Dynamic padding */
}

.button-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #411B56;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); /* For iPhone notch */
    display: flex;
    gap: 10px;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Hide buttons by default */
#editButton,
#confirmButton {
    display: none;
    flex: 1;
    max-width: 200px;
    margin: 0;
}

/* Show buttons only when results screen is visible */
#results:not(.hidden) #editButton,
#results:not(.hidden) #confirmButton {
    display: block;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .button-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        padding: 15px;
    }
    
    #results {
        padding-bottom: 0;
    }
    
    .hamburger {
        left: 5px;
        padding: 8px;
    }

    .section {
        margin: 0 10px 20px 10px;
    }

    #finalResults {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background-color: #411B56;
        z-index: 900;
    }

    .review-content {
        padding-bottom: calc(120px + env(safe-area-inset-bottom, 20px)); /* Extra padding for mobile */
    }
    
    #results {
        min-height: calc(100vh - 120px); /* Adjusted for mobile header */
    }
}

/* Existing Mobile Styles */
@media (max-width: 320px) {
    .input-group {
        width: 100%;
    }
}

.hamburger {
    width: auto;
    font-size: 2em;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    position: fixed;
    top: 20px;
    left: 10px;
    z-index: 1000;
    margin: 0;
    padding: 10px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: #333;
    color: #ffffff;
    overflow-y: auto;
    padding: 60px 20px 20px 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: transform 0.3s ease-in-out;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar h2 {
    color: #2dbdec;
    margin-bottom: 20px;
}

#historyList {
    list-style: none;
    padding: 0;
}

#historyList li {
    margin-bottom: 10px;
    cursor: pointer;
}

#historyList li:hover {
    color: #2dbdec;
}

.accent {
    color: #2dbdec;
    font-weight: bold;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

#pageTitle.hidden {
    display: none;
}

#finalResults {
    width: 100%;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    max-height: 100vh;
    box-sizing: border-box;
    height: 100%;
}

body.results-shown, html.results-shown {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.sidebar-button {
    background-color: #2dbdec;
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
    margin-bottom: 20px;
    width: 100%;
}

.sidebar-button:hover {
    background-color: #87377f;
}

.site-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    padding-top: 35px;
}

@media (max-width: 768px) {
    .site-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
        padding-top: 35px;
    }
}

#pageTitle.hidden ~ .site-logo {
    display: none;
}

#finalResults.hidden {
    display: none !important;
    visibility: hidden;
    position: absolute;
    z-index: -1;
}

.share-button {
    background-color: #F5C530;
    margin: 20px;
    position: relative;
    width: calc(100% - 40px);
    max-width: 300px;
    transition: background-color 0.3s ease;
}

.share-button:hover {
    background-color: #DC1967;
}

.share-text, .share-confirmation {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.share-confirmation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(100%);
    opacity: 0;
}

.share-confirmation.show {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.share-text.hide {
    transform: translateY(-100%);
    opacity: 0;
}

.share-text.show-success {
    color: #ffffff;
    transform: scale(1.1);
    opacity: 1;
}

@media (min-width: 769px) {
    #finalResults {
        overflow-y: auto;
        max-height: 100vh;
        padding-bottom: 40px;
        position: relative;
    }

    .container {
        min-height: 100vh;
        padding: 20px;
        box-sizing: border-box;
    }

    body.results-shown {
        overflow: auto;
        height: auto;
    }
}

@media (min-height: 800px) {
    .review-content {
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 20px));
    }
}

/* Handle shorter screens */
@media (max-height: 600px) {
    .review-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
    }
}

.section hr {
    width: 100%;
    border: none;
    border-top: 1px solid #F5C530;
    margin: 20px 0;
}