:root {
    --primary: #3B82F6;
    --secondary: #10B981;
    --accent: #F87171;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --text-lightest: #FFFFFF;
    --bg-light: #F9FAFB;

    --pending: #FBBF24;
    --table-bg: #ffffff;
    --border-color: #E5E7EB;

    --highlight: #FEF3C7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: white;
    color: var(--text-dark);
    line-height: 1.6;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.4rem;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

h1 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.index-header {
    padding: 1rem 0rem;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
}

.index-header .title {
    color: var(--bg-light) !important;
}

.title {
    cursor: pointer;
}

.index-header .links {
    display: flex;
    flex-direction: row;
    gap: 10px;

}

.index-header a {
    color: var(--bg-light);
}

nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 3rem;
    background: linear-gradient(135deg, #3B82F6, #10B981);
}

.hero-text {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    min-width: 300px;
    width: 100%;
}

.hero-text h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--bg-light);
    margin-bottom: 1rem;
}

.hero-text p {
    color: var(--bg-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;

}

.upload-form {
    display: flex;
    align-items: center;
    flex-direction: column;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    min-width: 400px;
}

.upload-form h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    text-align: center;
}

.upload-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.upload-form input[type="text"],
.upload-form input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    outline: none;
    font-size: 1rem;
}

.upload-form input[type="file"] {
    display: none;
}

#title {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 1.5rem;
    border: 2px dashed var(--primary);
    border-radius: 10px;
    text-align: center;
    color: var(--text-light);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease;
    font-size: 0.95rem;
    width: 100%;
}

.file-label:hover {
    background: #eff6ff;
}

.file-label.dragover {
    background: #dbeafe;
    border-color: var(--secondary);
    color: var(--secondary);
}

.file-name {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
}

.btn-primary {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.hero img {
    max-width: 450px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 2rem;
}

/* How It Works */
.steps {
    text-align: center;
    padding: 4rem 2rem;
}

.steps h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.step h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

/* Why Choose Us */
.benefits {
    background: var(--bg-light);
    padding: 4rem 2rem;
    text-align: center;
}

.benefits h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.benefit-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.benefit {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

.content {
    flex: 1;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #3B82F6, #10B981);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    margin: 2rem 0 0;
}

footer a {
    color: var(--text-lightest);
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

.petscriptions-btn {
    display: inline-block;
    background: linear-gradient(135deg, #3B82F6, #10B981);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-decoration: none;
    padding: 0.9rem 2rem;
    border-radius: 9999px;
    /* pill shape */
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
    text-align: center;
    border: none;
}

.petscriptions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35);
    color: var(--bg-light);
}

.petscriptions-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {

    .petscriptions-btn {
        padding: 0.8rem 1.6rem;
        font-size: 0.95rem;
    }

    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .upload-form {
        margin: 0 auto;
    }

    nav {
        display: none;
    }
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 5%;
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background-color: var(--table-bg);
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    vertical-align: top;
}

th {
    background-color: #E0F2FE;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.drug-item {
    background-color: #F3F4F6;
    border: 1px solid #E5E7EB;
    margin: 2px 0;
    padding: 2px 5px;
    border-radius: 4px;
    text-align: left;
    font-size: 0.88rem;
}

.status {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    display: inline-block;
    max-width: fit-content;
}

.status.pending {
    background-color: var(--pending);
}

.status.fulfilled {
    background-color: var(--secondary);
}

.status.revoked {
    background-color: var(--accent);
}

.status.expired {
    background-color: var(--accent);
}

.action-btn {
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.action-btn:hover {
    background-color: #059669;
}

.mobile-cards {
    display: none;
}

.option-card {
    background-color: var(--table-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    min-width: 400px;
}

.option-price {
    min-width: 10rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.vertical-line {
    width: 1px;
    height: -webkit-fill-available;
    background: var(--border-color);
}

.pharmacy-options-result {
    flex: 1;
    max-width: 820px;
}

.pharmacy-options-page {
    padding: 1rem;
}

.pharmacy-options-info {
    background-color: var(--table-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.pharmacy-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.filter-group {}

.filter-radio-item {
    display: flex;
    align-items: center;
    padding: 0.2rem 0 0;
}

.filter-radio-item input {
    width: 10px !important;
    flex: 1;
}

.filter-radio-item label {
    flex: 6;
}

.horizontal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
}

.vertical {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.preview {
    width: 100%;
    height: 100%;
    padding: 8px;
}

.preview-container h2 {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-size: 1.1rem;
}

.preview img,
.preview iframe,
.preview embed {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    border-radius: 8px;
}

.contents-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-container {
    flex: 1;
    min-width: 320px;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    color: var(--primary);
}

.form-container-title-action {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .action:hover {
        color: var(--primary);
        cursor: pointer;
    }
}

#modal {
    z-index: 100;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(100, 100, 100, 0.3);
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
}

input,
select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 0.2rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.drug-section {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
}

.drug-section h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.remove-btn:hover {
    background: #dc2626;
}

.btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-secondary {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.error-text {
    color: var(--accent);
}

.btn-secondary:hover {
    background: #2563eb;
}

.btn-primary {
    flex: 1;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #059669;
}

.medication-list {
    display: none;
    z-index: 99;
    position: absolute;
    background-color: var(--bg-light);
    border-radius: 5px;
    border: 1px solid #d1d5db;
    width: 100%;
}

.medication-list-item {
    width: 100%;

    p {
        padding: 0.3rem 1rem;
    }
}

.medication-list-item :hover {
    background-color: var(--secondary);
}

.no-pharmacy-results {
    text-align: center;
    color: var(--text-light);

    p {
        font-style: italic;
    }
}

.details-label {
    color: var(--text-light);
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem;
}

.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    transition: all 0.4s ease;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    font-weight: 700;
}

#login-form {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    flex-direction: column;
    gap: 0.6rem;
}

.toggle-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.toggle-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.toggle-text a:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s ease;
}

input[type=radio] {
    width: 20px;
    padding: 0.7rem;
    font-size: 1rem;
}

input:focus {
    border-color: var(--primary);
}

.prescription_key {
    width: 48px !important;
    font-size: x-large !important;
    font-weight: bold !important;
}

.radio-group {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.empty-cell {
    border: 0px;
}

.price-higher {
    color: var(--accent);
}

.price-matched {
    color: var(--secondary);
}

.list-items {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
}

@media screen and (max-width: 768px) {
    main {
        flex-direction: column;
        align-items: center;
    }

    .preview iframe,
    .preview img {
        height: 350px;
    }

    .mobile-cards {
        display: contents;
    }

    /* table {
        display: none;
    } */

    .prescription-card {
        background-color: var(--table-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1.5rem;
        padding: 1rem;
    }

    .prescription-card .field {
        margin-bottom: 0.5rem;
    }

    .prescription-card .field span.label {
        font-weight: 600;
    }

    .drug-item {
        margin: 2px 0;
    }

    .status {
        display: inline-block;
        margin-top: 2px;
    }

    .action-btn {
        margin-top: 4px;
        display: inline-block;
    }

    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}