/**
 * Bever Webshop Portal Styles
 */

/* General styles */
.bever-portal-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
    color: #333;
}

.bever-portal-title {
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.bever-portal-section-title {
    font-size: 22px;
    margin: 30px 0 15px;
    font-weight: 500;
    color: #34495e;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 10px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Messages */
.bever-portal-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in-out;
}

.bever-portal-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bever-portal-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.bever-portal-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.bever-portal-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Relation info */
.bever-portal-relation {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: #f5f7f9;
    border: 1px solid #dce0e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
}

.bever-portal-relation-info {
    flex: 1;
}

.relation-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.relation-header h3 {
    margin: 0;
    padding: 0;
    font-size: 1.2em;
    margin-right: 15px;
}

.relation-code-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e9f0f7;
    color: #3c5b78;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9em;
}

.relation-code-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.relation-address {
    font-size: 0.95em;
    color: #555;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dce0e6;
}

.relation-address p {
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
}

.relation-address .dashicons {
    margin-right: 5px;
    color: #3c5b78;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Fix mail icon alignment */
.relation-contact p {
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
}

.relation-contact .dashicons {
    margin-right: 5px;
    color: #3c5b78;
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.bever-portal-change-relation {
    display: inline-flex;
    align-items: center;
    color: #d63638;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.bever-portal-change-relation:hover {
    background-color: #fbeaea;
    color: #d63638;
}

.bever-portal-change-relation .dashicons {
    margin-right: 5px;
}

/* Product table */
.bever-portal-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.bever-portal-product-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 20px;
}

.bever-portal-product-table th {
    text-align: left;
    padding: 12px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.bever-portal-product-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.bever-portal-product-table tr:hover {
    background-color: #f8f9fa;
}

.product-image {
    width: 60px;
    text-align: center;
}

.product-thumbnail {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.product-no-image {
    width: 50px;
    height: 50px;
    background-color: #f1f1f1;
    display: inline-block;
    position: relative;
}

.product-no-image:after {
    content: "?";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #aaa;
}

.product-code {
    font-weight: 500;
    color: #2c3e50;
}

.product-description {
    max-width: 300px;
}

.product-description-main {
    font-size: 14px;
}

.product-description-additional {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.product-price {
    font-weight: 500;
}

/* Remove stock-related CSS classes */
.product-stock, .stock-indicator, .in-stock .stock-indicator, .out-of-stock .stock-indicator {
    display: none;
}

.product-quantity {
    width: 100px;
}

.product-quantity-input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
}

.product-action {
    width: 120px;
    text-align: center;
}

.bever-portal-add-to-cart {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.bever-portal-add-to-cart:hover {
    background-color: #2980b9;
}

.bever-portal-add-to-cart:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.bever-portal-add-to-cart.added {
    background-color: #2ecc71;
}

/* Cart section */
.bever-portal-cart-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 20px;
}

.bever-portal-cart-table th {
    text-align: left;
    padding: 12px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.bever-portal-cart-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.cart-item-quantity {
    width: 60px;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
}

.cart-remove-item {
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cart-remove-item:hover {
    background-color: #c0392b;
}

.bever-portal-empty-cart {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #7f8c8d;
}

.bever-portal-comments-section {
    margin-bottom: 20px;
}

.bever-portal-comments-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#bever-portal-comments {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
}

.bever-portal-submit-section {
    text-align: right;
    margin-top: 20px;
}

#bever-portal-submit-order {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
}

#bever-portal-submit-order:hover {
    background-color: #27ae60;
}

#bever-portal-submit-order:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Loading spinner */
.bever-portal-loading {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: spin 1s infinite linear;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Order confirmation */
.bever-portal-order-confirmation {
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.order-success-animation {
    margin-bottom: 20px;
}

.order-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #2ecc71;
    border-radius: 50%;
    color: white;
    font-size: 40px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.order-number {
    font-size: 18px;
    margin-bottom: 30px;
    color: #7f8c8d;
}

.bever-portal-action-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.bever-portal-action-btn:hover {
    background-color: #2980b9;
}

.bever-portal-action-btn .dashicons {
    margin-right: 5px;
}

/* No access template */
.bever-portal-no-access {
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.message-icon {
    margin-bottom: 20px;
}

.message-icon .dashicons {
    font-size: 40px;
    color: #e74c3c;
}

.bever-portal-contact {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Generate link form */
.bever-portal-generate-link {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bever-portal-form-row {
    margin-bottom: 20px;
}

.bever-portal-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-with-button {
    display: flex;
    align-items: center;
}

.relation-info-icon {
    margin-left: 10px;
    color: #3498db;
    cursor: help;
}

.bever-portal-link-result {
    background-color: #d4edda;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.link-container {
    display: flex;
    margin: 15px 0;
}

#webshop-link {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px 0 0 4px;
    font-family: monospace;
}

#copy-link {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

#copy-link .dashicons {
    margin-right: 5px;
}

.link-info {
    margin: 15px 0;
}

.expiry-note {
    font-style: italic;
    color: #e67e22;
}

.link-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.bever-portal-link-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

/* Search functionality */
.bever-portal-product-filter {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

.search-icon-animate {
    position: absolute;
    left: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #7f8c8d;
}

.search-icon-animate:after {
    content: "";
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 8px;
    height: 2px;
    background-color: #7f8c8d;
    transform: rotate(45deg);
}

.product-search-input {
    width: 100%;
    padding: 8px 35px 8px 35px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.product-search-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.product-search-clear {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    display: none;
    padding: 5px;
}

.search-results-count {
    font-size: 14px;
    color: #7f8c8d;
}

.no-products-row td {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

/* Pagination */
.bever-portal-pagination {
    margin-top: 20px;
}

.tablenav-pages {
    float: right;
    display: flex;
    align-items: center;
}

.displaying-num {
    margin-right: 15px;
    color: #7f8c8d;
}

.pagination-links {
    display: flex;
    align-items: center;
}

.pagination-links .button,
.pagination-links button.button {
    background-color: #3498db;
    border: 2px solid #2980b9;
    padding: 10px 15px;
    margin: 0 3px;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: bold;
    min-width: 40px;
    min-height: 40px;
    font-size: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-links .button:hover,
.pagination-links button.button:hover {
    background-color: #2980b9;
    border-color: #1c5c84;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pagination-links .button.disabled,
.pagination-links button.button.disabled {
    background-color: #bdc3c7;
    border-color: #a6acaf;
    color: #7f8c8d;
    opacity: 0.7;
    pointer-events: none;
    cursor: default;
    box-shadow: none;
}

.pagination-links a.button {
    cursor: pointer;
}

.tablenav-paging-text {
    margin: 0 10px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .bever-portal-container {
        padding: 10px;
    }
    
    .bever-portal-title {
        font-size: 24px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .bever-portal-section-title {
        font-size: 20px;
        text-align: center;
    }
    
    .bever-portal-table-container {
        overflow-x: auto;
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
    }
    
    .bever-portal-product-table, 
    .bever-portal-cart-table {
        display: block;
        width: 100%;
    }
    
    .bever-portal-product-table thead, 
    .bever-portal-cart-table thead {
        display: none;
    }
    
    .bever-portal-product-table tbody, 
    .bever-portal-cart-table tbody,
    .bever-portal-product-table tr, 
    .bever-portal-cart-table tr {
        display: block;
        width: 100%;
    }
    
    .bever-portal-product-table tr, 
    .bever-portal-cart-table tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
        background-color: #fff;
    }
    
    .bever-portal-product-table td, 
    .bever-portal-cart-table td {
        display: flex;
        justify-content: space-between;
        text-align: right;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
        align-items: center;
    }
    
    .bever-portal-product-table td:last-child,
    .bever-portal-cart-table td:last-child {
        border-bottom: none;
    }
    
    .bever-portal-product-table td:before, 
    .bever-portal-cart-table td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #495057;
        text-align: left;
        flex: 1;
    }
    
    .product-image {
        justify-content: center !important;
        width: 100%;
        padding: 15px !important;
        background: #f9f9f9;
    }
    
    .product-image:before {
        display: none !important;
    }
    
    .product-thumbnail {
        max-width: 120px;
        max-height: 120px;
    }
    
    .product-code {
        font-size: 14px;
    }
    
    .product-description-main {
        font-size: 16px;
        font-weight: 500;
    }
    
    .product-description-additional {
        font-size: 13px;
    }
    
    .product-quantity-input {
        width: 60px;
        text-align: center;
    }
    
    .bever-portal-add-to-cart {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
    
    .bever-portal-relation {
        flex-direction: column;
        text-align: center;
    }
    
    .bever-portal-relation-info {
        width: 100%;
    }
    
    .relation-header {
        flex-direction: column;
        align-items: center;
    }
    
    .bever-portal-change-relation {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .link-actions {
        flex-direction: column;
    }
    
    .link-actions a, 
    .link-actions button {
        margin-bottom: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .bever-portal-product-filter {
        flex-direction: column;
    }
    
    .product-search-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .product-search-input {
        width: 100%;
    }
    
    .pagination-links .button {
        margin: 0 2px;
        min-width: 35px;
        min-height: 35px;
        font-size: 14px;
    }
    
    .relation-address-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .delivery-addresses-list {
        flex-direction: column;
    }
    
    .bever-portal-comments-section {
        width: 100%;
    }
    
    #bever-portal-comments {
        width: 100%;
        min-height: 80px;
    }
    
    .bever-portal-submit-section {
        flex-direction: column-reverse;
        align-items: center;
    }
    
    #bever-portal-submit-order {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .bever-portal-order-confirmation {
        padding: 15px;
    }
    
    .cart-item-quantity {
        width: 60px;
    }
    
    .bever-portal-action-btn {
        width: 100%;
        margin: 5px 0;
        justify-content: center;
    }
    
    #webshop-link {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 13px;
    }
}

/* Relation info enhanced styling */
.relation-header h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: normal;
    color: #666;
}

.relation-details {
    margin-top: 15px;
    width: 100%;
}

.relation-address-container {
    display: flex;
    gap: 30px;
}

.relation-address,
.relation-contact {
    flex: 1;
}

.relation-address h4,
.relation-contact h4,
.relation-business-info h4,
.relation-delivery-addresses h4 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #777;
    margin: 5px 0;
    padding: 0 0 5px 0;
    border-bottom: 1px solid #e9f0f7;
}

.relation-business-info {
    margin-top: 15px;
    padding-top: 10px;
}

.relation-delivery-addresses {
    margin-top: 15px;
    padding-top: 10px;
}

.delivery-addresses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.delivery-address {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
}

.delivery-address p {
    margin: 0 0 5px 0;
}

.relation-address p,
.relation-contact p,
.relation-business-info p {
    margin: 0 0 5px 0;
}

/* Responsive styles for relation info */
@media screen and (max-width: 768px) {
    .relation-address-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .delivery-addresses-list {
        flex-direction: column;
    }
} 