@font-face {
    font-family: 'MPLUS Rounded 1c';
    src: url('fonts/MPLUSRounded1c-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'MPLUS Rounded 1c';
    src: url('fonts/MPLUSRounded1c-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'MPLUS Rounded 1c';
    src: url('fonts/MPLUSRounded1c-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}


:root {
    --background: #FEF9EF;
    --button: #000000;
    --button-shadow: #66522b;
    --primary-card: #FFB133;
    --image-box: #FFCB77;
    --image-ellipse: #FEF9EF;
    --border-color: #1a1a1a;
    --text-color: #1a1a1a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    font-family: 'MPLUS Rounded 1c', sans-serif;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 120px 20px 20px 20px;
}

.container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    position: relative;
  
}

h1 {
    font-size: 32px;
    margin-bottom: 5px;
    text-align: center;
    font-weight: 700;
}

h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.5;
    font-weight: 500;
}

/* Upload Prompt Toast */
.upload-prompt {
    background-color: var(--button);
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    margin-bottom: 20px;
    border: 2px solid #000;
    box-shadow: 0 4px 0 var(--button-shadow);
    animation: float-toast 2s ease-in-out infinite;
}

.upload-prompt-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #000;
}

.upload-prompt-arrow::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--button);
}

@keyframes float-toast {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Primary Card Styles */
.primary-card {
    background-color: var(--primary-card);
    border-radius: 40px;
    border: 2px solid #000;
    padding: 40px 20px;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
}

.welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 500px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Result Cards */
.result-card {
    background-color: var(--button);
    color: #fff;
    padding: 25px 20px;
    border-radius: 40px;
    margin-bottom: 20px;
}

.result-card p {
    font-size: 16px;
    line-height: 1.5;
    padding-left: 20px;
    /* indent the content under the heading */
}

/* File Input Wrapper and Image Box */
.file-input-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    margin-top: 10px;
}

#medicineImage {
    display: none;
}

.image-box {
    width: 200px;
    height: 200px;
    background-color: var(--image-box);
    border: 2px dashed #000;
    border-radius: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.image-box:hover {
    opacity: 0.9;
}

.image-box:active {
    transform: scale(0.97);
}

.image-ellipse {
    width: 90px;
    height: 90px;
    background-color: var(--image-ellipse);
    border-radius: 50%;
    border: 2px dashed #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    /* keep icon above background if needed */
}

#imagePreviewContainer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--image-box);
    border-radius: 40px;
    /* match parent */
    overflow: hidden;
    z-index: 3;
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Button */
.m-btn {
    background-color: var(--button);
    color: #fff;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 20px;
    font-family: 'MPLUS Rounded 1c', sans-serif;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--button-shadow);
    transition: all 0.1s ease;
    display: block;
    margin: 0 auto;
    width: 85%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.m-btn:active {
    transform: translateY(4px) scale(0.97);
    box-shadow: 0 2px 0 var(--button-shadow);
}

.m-btn:disabled {
    background-color: var(--button-shadow);
    color: #888;
    cursor: not-allowed;
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--button-shadow);
}

#searchAnotherBtn {
    margin-top: 30px;
    margin-bottom: 20px;
}

/* Disclaimer Card */
.disclaimer-card {
    background-color: #FFC0B3;
    border: 2px dashed #000;
    border-radius: 30px;
    padding: 25px 20px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
    color: #000;
}


/* Loading */
#loading {
    margin-top: 25px;
    text-align: center;
    font-weight: bold;
}

.loading-text {
    font-size: 16px;
    color: var(--button);
}


.result-card h3 {
    display: flex;
    align-items: center;
}

/* Floating Animation */
@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

/* App Header & Footer */
.app-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    display: none;
}

.menu-icon {
    width: 40px;
    height: 40px;
    background-color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-icon svg {
    stroke: #fff;
    width: 24px;
    height: 24px;
}

.app-footer {
    width: 100%;
    margin-top: 30px;
    padding-bottom: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.70;
    font-weight: 500;
}

/* Sidebar Menu Styles */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--background);
    border-left: 2px solid #000;
    z-index: 999;
    padding: 30px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
}

.side-menu.open {
    transform: translateX(0);
}

.close-btn {
    display: flex;
    justify-content: flex-end;
    cursor: pointer;
    margin-bottom: 40px;
}

.menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-links li {
    margin-bottom: 25px;
}

.menu-links a {
    text-decoration: none;
    color: #000;
    font-size: 20px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.menu-links a:hover {
    color: var(--primary-card);
}

.menu-links a:active {
    display: inline-block;
    transform: scale(0.95);
}

@media (min-width: 768px) {
    .menu-icon {
        display: none;
    }

    .logo-text {
        display: block;
    }

    .app-header {
        top: 30px;
        left: 40px;
        right: 40px;
        justify-content: space-between;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
    }

    /* Desktop Inline Menu */
    .menu-overlay {
        display: none !important;
    }

    .side-menu {
        position: static;
        width: auto;
        height: auto;
        transform: none;
        border-left: none;
        padding: 0;
        background: transparent;
        z-index: auto;
        display: flex;
        flex: 1;
        justify-content: flex-end;
        align-items: center;
        box-shadow: none;
    }

    .close-btn {
        display: none;
    }

    .menu-links {
        display: flex;
        flex-direction: row;
        gap: 30px;
        margin-top: 0;
        padding-left: 0;
    }

    .menu-links li {
        margin-bottom: 0;
    }
}