/**
 * Empire Product Restock Notifications Styles
 */

/* ==========================================================================
   Frontend Styles
   ========================================================================== */

/* Notify Me Button */
.eprn-notify-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #5c6bc0;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.eprn-notify-btn:hover {
    background-color: #3f51b5;
    color: #ffffff;
}

.eprn-notify-btn:focus {
    outline: 2px solid #3f51b5;
    outline-offset: 2px;
}

.eprn-notify-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.eprn-notify-btn.eprn-subscribed {
    background-color: #43a047;
}

.eprn-notify-btn.eprn-subscribed:hover {
    background-color: #d32f2f;
}

.eprn-notify-btn.eprn-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Compact Icon Button for Grid */
.eprn-notify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: #5c6bc0;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eprn-notify-icon:hover {
    background-color: #3f51b5;
    transform: scale(1.1);
}

.eprn-notify-icon.eprn-subscribed {
    background-color: #43a047;
}

.eprn-notify-icon.eprn-subscribed:hover {
    background-color: #d32f2f;
}

/* Grid Notify Wrapper */
.eprn-grid-notify-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    margin-top: 4px;
}

.eprn-grid-notify-wrapper .eprn-notify-btn {
    font-size: 11px;
    padding: 4px 8px;
}

.eprn-grid-notify-wrapper .eprn-notify-btn .eprn-btn-text {
    display: none;
}

/* Compact button style for grid cells */
.eprn-notify-btn.eprn-grid-btn {
    font-size: 10px;
    padding: 3px 6px;
    gap: 3px;
    border-radius: 3px;
}

.eprn-notify-btn.eprn-grid-btn.eprn-compact {
    padding: 4px 8px;
    font-size: 11px;
}

.eprn-notify-btn.eprn-grid-btn svg {
    width: 14px;
    height: 14px;
}

/* Grid notification explanation/legend */
.eprn-grid-explanation {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 12px;
    color: #333;
    float: right;
    margin-top: -5px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.eprn-legend-text {
    white-space: nowrap;
}

.eprn-legend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    margin: 0 2px;
}

.eprn-legend-icon.eprn-bell-purple {
    background: #5c6bc0;
}

.eprn-legend-icon.eprn-bell-purple svg {
    color: #fff;
}

.eprn-legend-icon.eprn-bell-green {
    background: #43a047;
}

.eprn-legend-icon.eprn-bell-green svg {
    color: #fff;
}

/* New feature banner */
.eprn-new-feature-banner {
    display: block;
    width: 100%;
    height: auto;
    margin: 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 12px 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-align: center;
    color: #fff;
    text-decoration: none;
    box-sizing: border-box;
}

.eprn-new-feature-banner:hover {
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.eprn-new-feature-banner .eprn-banner-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.eprn-new-feature-banner .eprn-banner-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.eprn-new-feature-banner .eprn-banner-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.eprn-new-feature-banner .eprn-banner-bell svg {
    width: 18px;
    height: 18px;
}

/* Instructions section */
.eprn-instructions-section {
    max-width: 800px;
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.eprn-instructions-section h3 {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
    color: #333;
    font-size: 22px;
}

.eprn-instructions-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eprn-instruction-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.eprn-step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.eprn-step-content {
    flex: 1;
}

.eprn-step-content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.eprn-step-content p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

.eprn-step-content ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: #555;
}

.eprn-step-content ul li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.eprn-step-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.eprn-step-content a:hover {
    text-decoration: underline;
}

.eprn-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 2px;
}

.eprn-inline-icon.eprn-bell-purple {
    background: #5c6bc0;
}

.eprn-inline-icon.eprn-bell-purple svg {
    color: #fff;
}

.eprn-inline-icon.eprn-bell-green {
    background: #43a047;
}

.eprn-inline-icon.eprn-bell-green svg {
    color: #fff;
}

/* Clear float after explanation */
.click-for-image-instructions::after {
    content: "";
    display: table;
    clear: both;
}

/* Mobile: stack below */
@media (max-width: 767px) {
    .eprn-grid-explanation {
        float: none;
        display: flex;
        margin: 10px 0;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Style for button appearing after "0 in stock!" */
.out-of-stock + .eprn-grid-notify-wrapper,
.vg_stock_level .eprn-grid-notify-wrapper {
    display: block;
    margin-top: 5px;
}

.out-of-stock + .eprn-grid-notify-wrapper .eprn-notify-btn,
.vg_stock_level .eprn-grid-notify-wrapper .eprn-notify-btn {
    display: inline-flex;
}

@media (min-width: 768px) {
    .eprn-grid-notify-wrapper .eprn-notify-btn .eprn-btn-text {
        display: inline;
    }
    
    .eprn-notify-btn.eprn-grid-btn.eprn-compact .eprn-btn-text {
        display: none;
    }
}

/* Notify Container */
.eprn-notify-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #5c6bc0;
}

.eprn-notify-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eprn-notify-prompt {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
}

.eprn-subscribed-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 10px 15px;
    background-color: #e8f5e9;
    border-radius: 4px;
    color: #2e7d32;
    font-size: 14px;
}

.eprn-subscribed-notice svg {
    flex-shrink: 0;
}

.eprn-login-notice {
    text-align: center;
}

.eprn-login-notice p {
    margin: 0 0 10px;
    font-size: 14px;
}

.eprn-login-btn {
    display: inline-block;
}

/* Variation Notify Container */
.eprn-variation-notify-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* ==========================================================================
   My Account Styles
   ========================================================================== */

.eprn-my-account-wrapper {
    max-width: 100%;
}

.eprn-my-account-wrapper h3 {
    margin: 30px 0 15px;
    font-size: 1.3em;
}

.eprn-my-account-wrapper h3:first-child {
    margin-top: 0;
}

.eprn-preferences-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.eprn-form-description {
    margin: 0 0 20px;
    color: #666;
}

.eprn-frequency-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.eprn-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eprn-radio-option:hover {
    border-color: #5c6bc0;
}

.eprn-radio-option input[type="radio"] {
    margin-top: 3px;
}

.eprn-option-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eprn-option-label strong {
    font-size: 15px;
}

.eprn-option-description {
    color: #666;
    font-size: 13px;
}

.eprn-hours-input {
    width: 60px;
    padding: 4px 8px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Method Options (Stock Notification Method) */
.eprn-method-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* Disabled option styling */
.eprn-radio-option.eprn-option-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9f9f9;
}

.eprn-radio-option.eprn-option-disabled:hover {
    border-color: #ddd;
}

.eprn-chrome-required {
    color: #c62828;
    font-size: 12px;
}

/* Chrome Status */
.eprn-chrome-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.eprn-chrome-status .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.eprn-chrome-connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.eprn-chrome-disconnected {
    background: #fff3e0;
    color: #e65100;
}

/* Chrome Options */
.eprn-chrome-options {
    margin-top: 15px;
}

.eprn-chrome-options h4 {
    margin: 20px 0 10px;
    font-size: 14px;
    color: #333;
}

.eprn-chrome-options h4:first-child {
    margin-top: 0;
}

.eprn-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.eprn-checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.eprn-checkbox-option + .eprn-option-description {
    margin: 5px 0 0 28px;
}

/* Install Extension Button */
.eprn-install-extension-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: none !important;
}

.eprn-install-extension-btn:hover {
    opacity: 0.9;
}

/* Email Settings */
.eprn-email-settings {
    margin-bottom: 20px;
}

.eprn-form-row {
    margin-bottom: 15px;
}

.eprn-form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.eprn-email-input {
    width: 100%;
    max-width: 500px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.eprn-email-input:focus {
    outline: none;
    border-color: #5c6bc0;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.1);
}

.eprn-field-description {
    font-size: 12px;
    color: #666;
    margin: 6px 0 0;
}

.eprn-field-note {
    font-size: 13px;
    color: #555;
    margin: 8px 0 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

/* Subscriptions Table */
.eprn-subscriptions-table {
    width: 100%;
    margin-top: 20px;
}

.eprn-subscriptions-table th,
.eprn-subscriptions-table td {
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.eprn-subscriptions-table .eprn-col-product {
    width: 35%;
}

.eprn-subscriptions-table .eprn-col-date,
.eprn-subscriptions-table .eprn-col-status,
.eprn-subscriptions-table .eprn-col-actions {
    width: auto;
}

.eprn-stock-in {
    color: #43a047;
    font-weight: 500;
}

.eprn-stock-out {
    color: #d32f2f;
    font-weight: 500;
}

.eprn-unsubscribe-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.eprn-no-subscriptions {
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* Subscriptions actions */
.eprn-subscriptions-actions {
    margin-bottom: 15px;
    text-align: right;
}

.eprn-cancel-all-btn {
    background-color: #d32f2f !important;
    border-color: #d32f2f !important;
    color: #fff !important;
}

.eprn-cancel-all-btn:hover {
    background-color: #b71c1c !important;
    border-color: #b71c1c !important;
    color: #fff !important;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

/* Status badges */
.eprn-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.eprn-status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.eprn-status-notified {
    background-color: #e3f2fd;
    color: #1565c0;
}

.eprn-status-cancelled {
    background-color: #ffebee;
    color: #c62828;
}

/* Stock status */
.eprn-stock-unknown {
    color: #999;
}

/* Deleted items */
.eprn-deleted-product,
.eprn-deleted-user {
    color: #999;
    font-style: italic;
}

/* Action buttons */
.eprn-trigger-btn {
    background-color: #5c6bc0 !important;
    border-color: #5c6bc0 !important;
    color: #fff !important;
}

.eprn-trigger-btn:hover {
    background-color: #3f51b5 !important;
    border-color: #3f51b5 !important;
}

.eprn-delete-btn {
    color: #d32f2f !important;
}

.eprn-delete-btn:hover {
    background-color: #ffebee !important;
    border-color: #d32f2f !important;
}

/* Stats grid */
.eprn-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.eprn-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.eprn-stat-number {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.eprn-stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.eprn-stat-active .eprn-stat-number {
    color: #43a047;
}

.eprn-stat-notified .eprn-stat-number {
    color: #1565c0;
}

.eprn-stat-cancelled .eprn-stat-number {
    color: #999;
}

/* Admin notices */
.eprn-admin-notice {
    padding: 10px 15px;
    margin: 10px 0;
    border-left: 4px solid;
    background: #fff;
}

.eprn-admin-notice.success {
    border-color: #43a047;
}

.eprn-admin-notice.error {
    border-color: #d32f2f;
}

/* Responsive */
@media (max-width: 782px) {
    .eprn-subscriptions-table {
        display: block;
    }

    .eprn-subscriptions-table thead {
        display: none;
    }

    .eprn-subscriptions-table tbody,
    .eprn-subscriptions-table tr,
    .eprn-subscriptions-table td {
        display: block;
        width: 100%;
    }

    .eprn-subscriptions-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
    }

    .eprn-subscriptions-table td {
        padding: 10px 15px;
        text-align: right;
        border-bottom: 1px solid #eee;
    }

    .eprn-subscriptions-table td:last-child {
        border-bottom: none;
    }

    .eprn-subscriptions-table td::before {
        content: attr(data-title);
        float: left;
        font-weight: 600;
    }

    .eprn-radio-option {
        padding: 12px;
    }

    .eprn-stat-box {
        padding: 15px;
    }

    .eprn-stat-number {
        font-size: 24px;
    }
}

