/**
 * Printer Favorites CSS
 * Full stylesheet for all plugin functionality
 */

/* -------------------------------- */
/* Product Page Styles */
/* -------------------------------- */
.compatible-printers {
    margin: 20px 0;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 4px;
}

.compatible-printers h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.compatible-printers-intro {
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.printer-badges {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Exactly 3 equal columns */
    gap: 12px;
    margin-top: 15px;
}

.printer-badge-container {
    position: relative;
    display: flex;
    width: 100%; /* Full width of grid cell */
}

.printer-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background: #ffcc29; /* Yellow background */
    border-radius: 4px;
    color: #000; /* Black text */
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.printer-badge:hover {
    background: #ffd65c; /* Slightly lighter on hover */
    transform: translateY(-2px);
    text-decoration: none;
    color: #000;
}

.printer-model {
    font-weight: 500;
    margin-right: 5px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.printer-favorite-btn,
.printer-favorite-login {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
    flex-shrink: 0; /* Prevent heart from shrinking */
}

.printer-favorite-btn:hover {
    transform: scale(1.15);
}

.printer-favorite-btn .heart-icon path, 
.printer-favorite-login .heart-icon path {
    fill: #ffffff;
    transition: fill 0.2s;
}

.printer-favorite-btn:hover .heart-icon path {
    fill: #ff5a5f;
}

.printer-favorite-btn.printer-favorite-saved .heart-icon path {
    fill: #ff5a5f;
}

/* -------------------------------- */
/* Modal Styles */
/* -------------------------------- */
#printer-favorite-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.printer-favorite-modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 5px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.printer-favorite-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
}

.printer-favorite-close:hover {
    color: #333;
}

.printer-favorite-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.printer-favorite-form {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#printer-favorite-nickname {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#save-printer-favorite {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

#save-printer-favorite:hover {
    background: #135e96;
}

.printer-favorite-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 15px;
}

/* -------------------------------- */
/* My Account Page Styles - Table Layout */
/* -------------------------------- */
.woocommerce-saved-printers-table {
    margin-bottom: 2em;
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-saved-printers-table th {
    font-weight: 700;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.woocommerce-saved-printers-table td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #ddd;
}

.woocommerce-saved-printers-table .printer-nickname {
    font-weight: 600;
}

.woocommerce-saved-printers-table .printer-model-link {
    color: #2271b1;
    text-decoration: none;
}

.woocommerce-saved-printers-table .printer-model-link:hover {
    color: #135e96;
    text-decoration: underline;
}

.woocommerce-saved-printers-table .printer-actions {
    display: flex;
    gap: 15px; /* Increased gap between buttons */
    justify-content: flex-end;
}

.woocommerce-saved-printers-table .printer-actions .button {
    margin: 0;
    padding: 1px 1px; /* Slightly larger padding */
    font-size: 13px;
    min-height: auto;
    min-width: 90px; /* Set minimum width for buttons */
    text-align: center;
    border-radius: 4px;
}

/* Optional: Add a subtle border to better separate the buttons */
.woocommerce-saved-printers-table .edit-nickname-btn,
.woocommerce-saved-printers-table .remove-printer-btn {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.woocommerce-saved-printers-table .edit-nickname-btn {
    background-color: #2271b1;
    color: white;
}

.woocommerce-saved-printers-table .edit-nickname-btn:hover {
    background-color: #135e96;
}

.woocommerce-saved-printers-table .remove-printer-btn {
    background-color: #d63638;
    color: white;
}

.woocommerce-saved-printers-table .remove-printer-btn:hover {
    background-color: #b32d2e;
}

.edit-nickname-form {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.edit-nickname-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.edit-buttons-container {
    display: flex;
    gap: 8px;
}

.edit-buttons-container .button {
    margin: 0;
    padding: 5px 10px;
    font-size: 12px;
    min-height: auto;
}

/* Success message styling */
.printer-favorite-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #00a32a;
    color: white;
    padding: 12px 15px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 14px;
    display: none;
}

/* Notification shortcode styling */
.printer-favorites-notification {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.printer-favorites-notification h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #343a40;
}

.printer-favorites-notification p {
    margin-bottom: 15px;
    color: #495057;
}

.printer-favorites-notification-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2271b1;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.printer-favorites-notification-link:hover {
    background-color: #135e96;
    color: white;
    text-decoration: none;
}

/* Minimal style */
.printer-favorites-notification-minimal {
    background: none;
    border: none;
    padding: 0;
}

/* Banner style */
.printer-favorites-notification-banner {
    background-color: #e6f4ff;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
}

.printer-favorites-banner-content {
    display: flex;
    align-items: center;
}

.printer-favorites-icon {
    margin-right: 15px;
    color: #2271b1;
}

.printer-favorites-notification-text {
    flex-grow: 1;
}

.printer-favorites-notification-banner h4 {
    margin-bottom: 5px;
}

.printer-favorites-notification-banner p {
    margin-bottom: 0;
}

.printer-favorites-notification-banner .printer-favorites-notification-link {
    margin-left: 15px;
    white-space: nowrap;
}

/* Responsive Adjustments */
@media screen and (max-width: 992px) {
    .printer-badges {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .printer-favorites-banner-content {
        flex-wrap: wrap;
    }
    
    .printer-favorites-notification-banner .printer-favorites-notification-link {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media screen and (max-width: 768px) {
    .woocommerce-saved-printers-table thead {
        display: none;
    }
    
    .woocommerce-saved-printers-table tr {
        display: block;
        margin-bottom: 1.5em;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
    }
    
    .woocommerce-saved-printers-table td {
        display: block;
        text-align: right;
        border-bottom: 1px dotted #ddd;
        padding: 8px 0;
    }
    
    .woocommerce-saved-printers-table td:last-child {
        border-bottom: none;
    }
    
    .woocommerce-saved-printers-table td::before {
        content: attr(data-title);
        float: left;
        font-weight: 700;
    }
    
    .woocommerce-saved-printers-table td.woocommerce-saved-printers-table__cell-actions {
        text-align: center;
    }
    
    /* Updated mobile button styling to display side by side */
    .woocommerce-saved-printers-table .printer-actions {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        gap: 10px;
    }
    
    .woocommerce-saved-printers-table .printer-actions .button {
        flex: 0 1 48%;
        min-width: 0;
        max-width: 48%;
        padding: 8px 5px; /* Reduced padding */
        text-align: center;
        font-size: 12px; /* Smaller font size */
    }
    
    .printer-favorites-banner-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .printer-favorites-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media screen and (max-width: 576px) {
    .printer-badges {
        grid-template-columns: 1fr !important;
    }

    .edit-nickname-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .edit-buttons-container {
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }
    
    .edit-buttons-container .button {
        flex: 0 1 48%;
        padding: 8px 0;
    }
    
    /* Keep buttons side by side even on smallest screens */
    .woocommerce-saved-printers-table .printer-actions {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }
    
    .woocommerce-saved-printers-table .printer-actions .button {
        flex: 0 1 48%;
        width: 48%;
        max-width: 48%;
        margin: 0;
        padding: 7px 5px; /* Further reduced padding */
        font-size: 11px; /* Even smaller font size */
    }
}