.tv-box-products {
    margin: 20px 0;
}

.tv-box-product-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tv-box-product-details .tv-box-product-name,
.tv-box-product-details .tv-box-product-box-number {
    width: 100%;
    /* Make the product name and box number take full width */
    text-align: center;
    /* Center the text within their containers */
}

.tv-box-product {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    border-radius: 5px;
    background-color: #fff;
    box-shadow:
        0 20px 40px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(226, 232, 240, 0.6);
}

.tv-box-product-image {
    width: 100px;
    /* Set a fixed width for the image box */
    height: auto;
    margin-right: 20px;
}

.tv-box-product-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
}

.tv-box-product-name {
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
}

.tv-box-manage-button {
    padding: 10px 20px;
    background-color: #0071a1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.tv-box-manage-button:hover {
    background-color: #005f80;
}

.tv-box-log {
    margin-top: 30px;
    font-size: 14px;
    color: #666;
}

.back-link {
    text-align: left;
    margin-bottom: 20px;
}

.device-title {
    color: #555 !important;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.device-subtitle {
    color: #555 !important;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.device-text {
    color: #555 !important;
    font-size: 16px;
    margin-top: 10px;
    color: #555;
}

.mac-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

.action-button {
    background-color: #0071a1;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

.disabled-button {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.status-active {
    color: #555 !important;
    background-color: #d4edda;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}

.status-inactive {
    color: #555 !important;
    background-color: #f8d7da;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}

.expiry-active {
    color: #555 !important;
    background-color: #f9f871;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}

.expiry-expired {
    color: #555 !important;
    background-color: #f8d7da;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}


.tv-box-product-box-number {
    margin-right: 10px;
    /* Adjust the value as needed */
    display: inline-block;
}


.box-search-container {
    display: flex;
    justify-content: flex-end;
    /* Move the search form to the right */
    align-items: center;
    margin-bottom: 20px;
    /* Add some spacing from the content */
}

.box-search-form {
    display: flex;
}

.box-search-input {
    width: 300px;
    /* Increase the width of the input field */
    padding: 10px;
    /* Increase the padding for better readability */
    font-size: 16px;
    /* Increase font size */
}

.box-search-button {
    padding: 10px 15px;
    /* Increase the button size */
    font-size: 16px;
    /* Increase font size */
    background-color: #0073e6;
    /* Customize the button background color */
    color: #fff;
    /* Set text color to white */
    border: none;
    cursor: pointer;
}

/* Base styles for larger screens can go here */

/* Add your custom CSS styles for the Manage page here */

/* Container for TV box details */
.tv-box-container {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* TV box title */
.tv-box-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* TV box details */
.tv-box-details {
    font-size: 18px;
}

.link-display-container {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
    /* Added to allow wrapping on mobile */

}

.link-label {
    font-size: 16px;
    margin-right: 10px;
    min-width: 80px;
}

.link-content {
    background: #0f5479;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    white-space: normal;
    /* Changed from nowrap to allow wrapping */
    word-break: break-all;
    /* Added to break long URLs */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
    .link-display-container {
        gap: 8px;
        /* Adds space between wrapped elements */
    }

    .link-content {
        font-size: 13px;
        /* Slightly smaller font on mobile */
        width: 100%;
        /* Full width on mobile */
    }

    .link-label {
        font-size: 14px;
        width: auto;
    }

    .copy-button {
        margin-left: auto;
        /* Aligns copy button to the right */
    }
}

.copy-button {
    margin-left: 10px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.copy-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.copy-button svg {
    vertical-align: middle;
}

/* Box and Device label */
.device-number-label,
.device-mac,
.device-username {
    background-color: #0071a1;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    margin-right: 10px;
}

.other-info-div {
    margin-top: 10px;
}

/* MAC address section */
.mac-address-section {
    margin-top: 20px;
}

/* MAC address label */
.mac-address-label {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* MAC address input */
.mac-address-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

/* Save button */
.save-button {
    background-color: #0073e6;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

/* Styling for the purchase date */
.purchase-date {
    font-size: 16px;
    margin-top: 10px;
}

/* ===== My Devices Styles ===== */

/* Default structure for desktop */
.tv-box-product-top-row {
    display: contents;
    /* Makes it behave as if the div doesn't exist on desktop */
}

.tv-box-product-bottom-row {
    display: contents;
    /* Makes it behave as if the div doesn't exist on desktop */
}

.tv-box-product-main-info {
    flex: 1;
}

.tv-box-product-details {
    flex: 1;
}

/* Tablet (768px - 1024px) - Desktop layout with slightly smaller fonts */
@media (max-width: 1024px) and (min-width: 741px) {
    .tv-box-product {
        padding: 25px 18px;
    }

    .tv-box-product-image {
        width: 85px;
        margin-right: 18px;
    }

    .tv-box-product-name {
        font-size: 17px;
    }

    .tv-box-product-box-number {
        font-size: 15px;
    }

    .tv-box-manage-button {
        font-size: 16px;
        padding: 9px 18px;
    }

    .tv-box-products h2 {
        font-size: 22px;
    }

    .tv-box-products h3 {
        font-size: 18px;
    }
}

/* Small mobile (up to 425px) - Centered layout */
@media (max-width: 740px) {

    /* My Devices container */
    .tv-box-products {
        margin: 15px 0;
    }

    /* Individual device/box product styling */
    .tv-box-product {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px 10px;
        margin-bottom: 15px;
    }

    /* Centered image at top */
    .tv-box-product-top-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 15px;
        width: 100%;
    }

    .tv-box-product-image {
        width: 70px;
        height: 70px;
        margin: 0 0 10px 0;
        flex-shrink: 0;
    }

    .tv-box-product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }

    .tv-box-product-main-info {
        width: 100%;
    }

    .tv-box-product-name {
        font-weight: bold;
        margin: 0;
        line-height: 1.3;
    }

    .tv-box-product-name small {
        display: block;
        font-weight: normal;
        color: #666;
        margin-top: 3px;
    }

    /* Expiry badges */
    .expired-badge,
    .expiry-active {
        padding: 3px 6px;
        margin: 5px 0 0 0;
        display: inline-block;
    }

    /* Bottom section: Device details + Manage button stacked */
    .tv-box-product-bottom-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .tv-box-product-details {
        width: 100%;
    }

    .tv-box-product-box-number {
        line-height: 1.4;
    }

    .tv-box-product-box-number .device-number-label,
    .tv-box-product-box-number .device-mac,
    .tv-box-product-box-number .device-username {
        padding: 3px 6px;
        margin: 0 4px 5px 4px;
        display: inline-block;
    }

    .other-info-div {
        margin-top: 8px;
    }

    /* Manage button */
    .tv-box-manage-button {
        width: 100%;
        text-align: center;
        padding: 10px 15px;
        box-sizing: border-box;
    }

    /* Section headings */
    .tv-box-products h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .tv-box-products h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .tv-box-products p {
        margin-bottom: 15px;
    }
}