/* ==========================================
   RESET
   ========================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333333;
    margin: 0;
    line-height: 1.6;
}


/* ==========================================
   HEADER
   ========================================== */

header {
    background-color: #ffffff;
    padding: 12px 60px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1000;
}

.brand {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    display: block;
    width: 180px;
    height: auto;
    max-height: 65px;
    object-fit: contain;
}

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

nav a {
    color: #333333;
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
}

nav a:hover {
    color: #2f7d8c;
}

nav .get-started {
    background-color: #2f7d8c;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 6px;
}

nav .get-started:hover {
    background-color: #256572;
    color: #ffffff;
}

.menu-button {
    display: none;
    background-color: transparent;
    color: #1f4f5f;
    border: none;
    font-size: 30px;
    padding: 5px;
    cursor: pointer;
}


/* ==========================================
   GENERAL SECTIONS
   ========================================== */

section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 30px;
}

section h2 {
    color: #1f4f5f;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 20px;
}

section p {
    font-size: 17px;
    max-width: 700px;
}


/* ==========================================
   HERO
   ========================================== */

.hero {
    text-align: center;
    padding-top: 110px;
    padding-bottom: 110px;
}

.hero h1 {
    color: #1f4f5f;
    font-size: 46px;
    line-height: 1.2;
    max-width: 780px;
    margin: 0 auto 25px;
}

.hero p {
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}


/* ==========================================
   BUTTONS
   ========================================== */

.button {
    display: inline-block;
    background-color: #2f7d8c;
    color: #ffffff;
    text-decoration: none;
    padding: 13px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.button:hover {
    background-color: #256572;
}

.secondary-button {
    background-color: #ffffff;
    color: #2f7d8c;
    border: 1px solid #2f7d8c;
}

.secondary-button:hover {
    background-color: #eef7f8;
    color: #256572;
}


/* ==========================================
   PROBLEM
   ========================================== */

.problem {
    max-width: none;
    background-color: #ffffff;
    padding-left: calc((100% - 940px) / 2);
    padding-right: calc((100% - 940px) / 2);
}


/* ==========================================
   FEATURES
   ========================================== */

.features {
    text-align: center;
}

.feature-container {
    display: flex;
    gap: 25px;
}

.feature-card {
    flex: 1;
    background-color: #ffffff;
    padding: 28px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.feature-card h3 {
    color: #2f7d8c;
    margin-top: 0;
}


/* ==========================================
   DASHBOARD PREVIEW
   ========================================== */

.dashboard-preview {
    max-width: 1100px;
    text-align: center;
}

.dashboard-preview > p {
    margin: 0 auto 35px;
}

.dashboard-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 35px;
}

.summary-card {
    flex: 1;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    text-align: left;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.summary-card h3 {
    color: #1f4f5f;
    font-size: 16px;
    margin: 0 0 10px;
}

.summary-card p {
    color: #2f7d8c;
    font-size: 30px;
    font-weight: bold;
    margin: 0;
}

.dashboard-table {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-align: left;
}

.dashboard-table h3 {
    color: #1f4f5f;
    margin-top: 0;
    margin-bottom: 20px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.dashboard-table th {
    background-color: #f5f7fa;
    color: #1f4f5f;
    font-size: 15px;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}


/* ==========================================
   HOW IT WORKS
   ========================================== */

.how-it-works {
    max-width: none;
    background-color: #ffffff;
    text-align: center;
    padding-left: calc((100% - 940px) / 2);
    padding-right: calc((100% - 940px) / 2);
}

.steps {
    display: flex;
    gap: 25px;
}

.step {
    flex: 1;
    padding: 25px;
}

.step-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    background-color: #2f7d8c;
    color: #ffffff;
    border-radius: 50%;
    font-weight: bold;
}

.step h3 {
    color: #1f4f5f;
}


/* ==========================================
   CALL TO ACTION
   ========================================== */

.cta {
    text-align: center;
}

.cta p {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}


/* ==========================================
   FOOTER
   ========================================== */

footer {
    background-color: #1f4f5f;
    color: #ffffff;
    text-align: center;
    padding: 25px;
}

footer p {
    margin: 0;
}


/* ==========================================
   AUTHENTICATION
   ========================================== */

.auth-page {
    min-height: 100vh;
    background-color: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.auth-logo img {
    display: block;
    width: 170px;
    height: auto;
}

.auth-card h1 {
    color: #1f4f5f;
    font-size: 30px;
    margin: 0 0 10px;
}

.auth-description {
    color: #666666;
    font-size: 15px;
    margin: 0 0 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #1f4f5f;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 7px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333333;
    font-size: 16px;
    outline: none;
}

.form-group input:focus {
    border-color: #2f7d8c;
    box-shadow: 0 0 0 2px rgba(47, 125, 140, 0.12);
}

.auth-button {
    width: 100%;
    border: none;
    background-color: #2f7d8c;
    color: #ffffff;
    padding: 13px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.auth-button:hover {
    background-color: #256572;
}

.auth-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-message {
    min-height: 20px;
    margin-top: 20px;
    border-radius: 6px;
    font-size: 14px;
}

.auth-message.success {
    background-color: #e7f6ee;
    color: #237a4b;
    padding: 12px;
}

.auth-message.error {
    background-color: #fdecec;
    color: #b42318;
    padding: 12px;
}

.auth-switch {
    color: #666666;
    font-size: 14px;
    margin: 25px 0 10px;
}

.auth-switch a {
    color: #2f7d8c;
    font-weight: bold;
    text-decoration: none;
}

.back-home {
    color: #2f7d8c;
    text-decoration: none;
    font-size: 14px;
}


/* ==========================================
   PROTECTED DASHBOARD
   ========================================== */

.dashboard-page {
    min-height: 100vh;
    background-color: #f5f7fa;
}

.dashboard-header {
    background-color: #ffffff;
    padding: 12px 50px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-brand {
    display: block;
}

.dashboard-brand img {
    display: block;
    width: 170px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.logout-button {
    background-color: #ffffff;
    color: #2f7d8c;
    border: 1px solid #2f7d8c;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

.logout-button:hover {
    background-color: #eef7f8;
}

.logout-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ==========================================
   DASHBOARD CONTENT
   ========================================== */

.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 30px;
}

.welcome-card {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.welcome-card h1 {
    color: #1f4f5f;
    font-size: 36px;
    margin: 0 0 15px;
}

#welcomeMessage {
    color: #2f7d8c;
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 10px;
}

.dashboard-description {
    color: #666666;
    margin: 0;
}


/* ==========================================
   ADD PRODUCT
   ========================================== */

.add-product-section {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.section-heading {
    margin-bottom: 30px;
}

.section-heading h2 {
    color: #1f4f5f;
    font-size: 28px;
    margin: 0 0 8px;
}

.section-heading p {
    color: #666666;
    margin: 0;
    font-size: 16px;
}

.product-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.product-form .form-group {
    margin-bottom: 0;
}

.product-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333333;
    font-size: 16px;
    outline: none;
}

.product-form input:focus {
    border-color: #2f7d8c;
    box-shadow: 0 0 0 2px rgba(47, 125, 140, 0.12);
}

.save-product-button {
    grid-column: 1 / -1;
    width: 100%;
    border: none;
    background-color: #2f7d8c;
    color: #ffffff;
    padding: 13px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
}

.save-product-button:hover {
    background-color: #256572;
}

.save-product-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.product-message {
    min-height: 20px;
    margin-top: 20px;
    border-radius: 6px;
    font-size: 15px;
}

.product-message.success {
    background-color: #e7f6ee;
    color: #237a4b;
    padding: 12px 15px;
}

.product-message.error {
    background-color: #fdecec;
    color: #b42318;
    padding: 12px 15px;
}


/* ==========================================
   PRODUCTS SECTION
   ========================================== */

.products-section {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.products-loading {
    color: #666666;
    padding: 25px 0;
    text-align: center;
}

.no-products-message {
    background-color: #f5f7fa;
    color: #666666;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    font-size: 16px;
}

.products-table-container {
    width: 100%;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.products-table th {
    background-color: #f5f7fa;
    color: #1f4f5f;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.products-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #333333;
    font-size: 15px;
}

.products-table tbody tr:hover {
    background-color: #f8fafb;
}

.products-table td:first-child {
    color: #1f4f5f;
    font-weight: bold;
}

.products-table td:nth-child(2) {
    font-weight: bold;
}

.products-table td:nth-child(3) {
    color: #2f7d8c;
    font-weight: bold;
}


/* ==========================================
   EDIT PRODUCT BUTTON
   ========================================== */

.edit-product-button {
    background-color: #ffffff;
    color: #2f7d8c;
    border: 1px solid #2f7d8c;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    margin-right: 6px;
}

.edit-product-button:hover {
    background-color: #2f7d8c;
    color: #ffffff;
}


/* ==========================================
   DELETE PRODUCT BUTTON
   ========================================== */

.delete-product-button {
    background-color: #ffffff;
    color: #b42318;
    border: 1px solid #b42318;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.delete-product-button:hover {
    background-color: #b42318;
    color: #ffffff;
}

.delete-product-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ==========================================
   EDIT PRODUCT MODAL
   ========================================== */

.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 79, 95, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.edit-modal-content {
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 35px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.edit-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.edit-modal-header h2 {
    color: #1f4f5f;
    margin: 0 0 5px;
    font-size: 28px;
}

.edit-modal-header p {
    color: #666666;
    margin: 0;
    font-size: 15px;
}

.close-modal-button {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    border: none;
    background-color: #f5f7fa;
    color: #555555;
    border-radius: 50%;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.close-modal-button:hover {
    background-color: #e5e7eb;
}

#editProductForm .form-group {
    margin-bottom: 20px;
}

#editProductForm input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333333;
    font-size: 16px;
    outline: none;
}

#editProductForm input:focus {
    border-color: #2f7d8c;
    box-shadow: 0 0 0 2px rgba(47, 125, 140, 0.12);
}

.edit-form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.cancel-edit-button {
    background-color: #ffffff;
    color: #555555;
    border: 1px solid #d1d5db;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

.cancel-edit-button:hover {
    background-color: #f5f7fa;
}

.update-product-button {
    background-color: #2f7d8c;
    color: #ffffff;
    border: none;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.update-product-button:hover {
    background-color: #256572;
}

.update-product-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}


/* ==========================================
   PRODUCTS ERROR
   ========================================== */

.products-error {
    background-color: #fdecec;
    color: #b42318;
    padding: 14px 16px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 15px;
}


/* ==========================================
   DASHBOARD MESSAGE
   ========================================== */

.dashboard-message {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 12px 18px;
    border-radius: 6px;
    background-color: #e7f6ee;
    color: #237a4b;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 3000;
}

.dashboard-message.success {
    display: block;
    background-color: #e7f6ee;
    color: #237a4b;
}

.dashboard-message.error {
    display: block;
    background-color: #fdecec;
    color: #b42318;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 900px) {

    header {
        padding: 15px 30px;
    }

    nav {
        gap: 15px;
    }

    nav a {
        font-size: 15px;
    }

    .hero {
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .hero h1 {
        font-size: 40px;
    }

}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 700px) {

    header {
        padding: 12px 20px;
    }

    .brand img {
        width: 150px;
        max-height: 55px;
    }

    .menu-button {
        display: block;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    nav.show-menu {
        display: flex;
    }

    nav a {
        display: block;
        width: 100%;
        padding: 12px 10px;
        text-align: center;
    }

    section {
        width: 100%;
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .feature-container {
        flex-direction: column;
    }

    .dashboard-summary {
        flex-direction: column;
    }

    .steps {
        flex-direction: column;
    }


    /* Add product */

    .add-product-section {
        padding: 25px 20px;
    }

    .product-form {
        grid-template-columns: 1fr;
    }

    .save-product-button {
        grid-column: auto;
    }


    /* Products */

    .products-section {
        padding: 25px 20px;
    }

    .products-table {
        min-width: 800px;
    }


    /* Edit modal */

    .edit-modal {
        padding: 15px;
    }

    .edit-modal-content {
        padding: 25px 20px;
        max-height: 95vh;
    }

    .edit-modal-header h2 {
        font-size: 24px;
    }

    .edit-form-buttons {
        flex-direction: column-reverse;
    }

    .cancel-edit-button,
    .update-product-button {
        width: 100%;
    }


    /* Dashboard */

    .dashboard-header {
        padding: 12px 20px;
    }

    .dashboard-brand img {
        width: 145px;
        max-height: 52px;
    }

    .logout-button {
        padding: 8px 14px;
        font-size: 14px;
    }

    .dashboard-container {
        padding: 40px 20px;
    }

    .welcome-card {
        padding: 30px 22px;
    }

    .welcome-card h1 {
        font-size: 30px;
    }


    /* Product action buttons */

    .edit-product-button,
    .delete-product-button {
        display: block;
        width: 100%;
        margin: 4px 0;
    }

}


/* ==========================================
   SMALL PHONES
   ========================================== */

@media (max-width: 450px) {

    header {
        padding: 10px 15px;
    }

    .brand img {
        width: 140px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .auth-card {
        padding: 25px 18px;
    }

    .dashboard-header {
        padding: 10px 15px;
    }

    .dashboard-brand img {
        width: 130px;
    }

    .logout-button {
        padding: 7px 12px;
        font-size: 13px;
    }

    .add-product-section {
        padding: 25px 15px;
    }

    .products-section {
        padding: 25px 15px;
    }

    .section-heading h2 {
        font-size: 25px;
    }

    .edit-modal-content {
        padding: 22px 17px;
    }

}