﻿
h1 {
    font-weight: bold;
}

/* Containers */
.search-container {
    display: grid;
    max-width: 49%;
    margin: 0 auto;
}

.customer-list {
    display: grid;
    gap: 8px;
    padding: 10px;
    width: 50%;
    margin: 0 auto;
}

/* Customer Container */
.customer-container {
    margin-bottom: 8px;
}

/* Customer card */
.customer-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    gap: 15px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: auto;
    width: 100%;
    font-size: 1rem;
    font-weight: 300;
    transition: transform 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    cursor: pointer;
}

    .customer-card:hover {
        background-color: #f0f0f0;
        transform: scale(1.01);
    }


.customer-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 2fr 2fr;
    gap: 15px;
    align-items: start;
}

.name-email-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.name {
    font-weight: bold;
    font-size: 1.1rem;
}

.cell,
.email {
    font-size: 0.9rem;
    color: #666;
}

.company-timestamp {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
    margin-right: 40px;
}

.company {
    font-weight: bold;
    color: #444;
    text-align: right;
}

.address-postal div:not(:empty)::after {
    content: ", ";
    color: #999;
}

.address-postal div:last-child::after {
    content: "";
}

.timestamp {
    color: #666;
    font-size: 0.85rem;
    text-align: right;
}


.field {
    
    text-overflow: ellipsis;
    white-space: normal;
    overflow: hidden;
    height: 100%;
    min-width: 120px;
    flex: 1;
}

    .field strong {
        color: #333;
        font-weight: bold;
        margin-bottom: 3px;
    }

    .field span {
        color: #555;
        font-size: 0.8rem;
        word-wrap: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }


.additional-details {
    display: none;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
    padding: 15px;
    margin-top: -8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-top: 2px solid #e0e0e0;
}

    .additional-details.show {
        display: block;
        animation: slideDown 0.3s ease;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Customer Actions */
.customer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

    /* Delete is a POST form; let its button sit in the flex row like the other actions */
    .customer-actions form {
        display: contents;
    }

    .customer-actions .btn {
        pointer-events: auto;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        font-size: 25px;
    }

    .customer-actions .btn-gotosales {
        border-color: transparent;
        color: #000000;
    }

        .customer-actions .btn-gotosales:hover {
            border-color: transparent;
            color: #646464;
        }

    /* Delete icon */
    .customer-actions .btn-deletecustomer {
        border-color: transparent;
        color: #fe7061;
    }

        .customer-actions .btn-deletecustomer:hover {
            border-color: transparent;
            color: #f74a4a;
        }

    /* Edit icon */
    .customer-actions .btn-editcustomer {
        border-color: transparent;
        color: #ffcf0176;
    }

        .customer-actions .btn-editcustomer:hover {
            border-color: transparent;
            color: #ffcf01;
        }

/* Star icon */
.customer-star {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c7c7c7;
    font-size: 22px;
}

.customer-star.filled {
    color: #ffcf01;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
}

    
    .input-group .form-control {
        flex-grow: 1;
        border-radius: 0;
        padding-right: 40px;
        padding-left: 10px;
        font-size: 16px;
        border: none;
        background-color: #fafafa;
        color: #333;
        box-sizing: border-box;
    }

        .input-group .form-control:focus {
            outline: none;
            box-shadow: none;
            border-color: #e0e0e0;
        }

    
    .input-group .btn {
        background-color: transparent;
        border: none;
        color: #555;
        font-size: 20px;
        cursor: pointer;
        padding: 10px;
    }

        .input-group .btn:hover {
            color: #333;
        }

        .input-group .btn:focus {
            outline: none;
            box-shadow: none;
        }

.no-records-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

    .no-records-message i {
        font-size: 2rem;
        display: block;
        margin-bottom: 10px;
        color: #999;
    }


.btn-addcust {
    width: 60px;
    height: 60px;
    font-size: 1.71rem;
    border-radius: 100%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    background-color: #ffcf01;
    color: white;
    margin-left: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .btn-addcust i {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
    }

    .btn-addcust:hover {
        background-color: #ffdf54;
        transform: scale(1.02);
        border-color: #ffdf54;
        color: white;
    }

    .btn-addcust:focus {
        background-color: #ffdf54;
        border-color: #ffdf54;
        color: white;
    }

.customer-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.customer-filters {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}

.filter-btn {
    border: none;
    background: #efefef;
    color: #333;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn.icon-only {
    padding: 8px 12px;
}

.filter-btn.icon-only i {
    font-size: 16px;
    line-height: 1;
}

.filter-btn.active {
    background: #000;
    color: #fff;
}

.edit-customer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

    .edit-customer-form .input-group {
        width: 70%;
    }

    .edit-customer-form .form-control {
        font-size: 16px;
        padding: 12px;
        border-radius: 10px;
        border: 1px solid #e0e0e0;
    }




.customer-actions .btn-newsale {
    border-color: transparent;
    color: #4CAF50;
}

    .customer-actions .btn-newsale:hover {
        border-color: transparent;
        color: #3e8e41;
    }

/* Add Customer Form */
.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}


.form-container {
    width: 50%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

/* star radio button (add/edit cust modal) */
.star-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.star-input {
    display: none;
}

.star-label {
    font-size: 24px;
    color: #c7c7c7;
    cursor: pointer;
}

.star-input:checked + .star-label {
    color: #ffcf01;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

    .form-input:focus,
    .form-select:focus {
        box-shadow: 0 0 4px rgba(15, 82, 223, 0.2);
    }

/* Submit buttons */
.btn-savecust {
    width: 140px;
    padding: 10px 12px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-savecust:hover {
        background-color: #2e2e2e;
        transform: scale(1.01);
        color: white;
    }

    .btn-savecust:focus {
        outline: none;
        box-shadow: 0 0 4px rgba(15, 82, 223, 0.4);
        color: white;
    }

.btn-canceladd {
    width: 140px;
    padding: 10px 5px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-canceladd:hover {
        background-color: #ff4c4c;
        transform: scale(1.01);
        color: white;
    }

    .btn-canceladd:focus {
        outline: none;
        box-shadow: 0 0 4px rgba(15, 82, 223, 0.4);
        color: white;
    }

.form-error {
    color: #f74a4a;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}




@media (max-width: 1340px) {
    .search-container,
    .customer-list,
    .form-container {
        max-width: 60%;
        width: 80%;
    }
}


@media (max-width: 900px) {
    .search-container,
    .customer-list,
    .form-container {
        max-width: 95%;
        width: 95%;
    }

    

    
}


@media (max-width: 600px) {
    .search-container,
    .customer-list,
    .form-container {
        max-width: 100%;
        width: 100%;
        padding: 5px;
    }

    
    .customer-list {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        width: 100%;
    }

    
    .customer-card {
        flex-direction: column;
        height: auto;
        font-size: 0.85rem;
        padding: 8px;
        width: 100%;
    }

    
    .customer-fields {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .field {
        min-width: 100%;
        flex: none;
        text-align: left;
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .customer-actions .btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .company-timestamp {
        text-align: left;
        
    }

    .company {
        text-align: left;
    }

    .timestamp {
        text-align: left;
    }

    .input-group .btn {
        font-size: 18px;
    }

    .input-group .form-control {
        padding: 8px;
        font-size: 14px;
    }

    .customer-actions {
        gap: 6px;
    }
}

/* Add/Edit Customer Modal */
.customer-modal {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);

    /* Center the lightbox and prevent the overlay itself from scrolling */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
    overflow: hidden;
}

.customer-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.customer-modal-content {
    background: #fff;
    margin: 0;
    padding: 20px;
    border-radius: 10px;
    width: 60%;
    max-width: 700px;

    max-height: calc(100vh - 80px);
    overflow-y: auto;

    /* Open/Close animation */
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

/* Open/Close animation */
.customer-modal.show .customer-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.customer-modal.closing .customer-modal-content {
    transform: translateY(-20px);
    opacity: 0;
}

/* Customer modal form grid */
.customer-modal-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.form-group {
    margin-bottom: 6px; /* reduced row spacing */
}

.customer-modal-form .form-actions {
    grid-column: 1 / -1;
}

/* Stack on small screens */
@media (max-width: 700px) {
    .customer-modal-form {
        grid-template-columns: 1fr;
    }
}

/* Align the star toggle with the Notes input in 2-column layout */
@media (min-width: 701px) {
    .customer-modal-form .form-group-star {
        padding-top: 28px;
    }
}

.customer-modal-header {
    background: #f5f5f5; /* light shade in header */
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 16px -20px; /* align with modal padding */
}
