/**
 * Reminders for WooCommerce - Admin Styles
 * Version: 1.4.0
 */

/* ===================================
   Variables & Reset
   =================================== */
:root {
    --rfwc-primary: #4169E1;
    --rfwc-primary-hover: #365AC2;
    --rfwc-green: #2ecf63;
    --rfwc-green-hover: #26B356;
    --rfwc-blue: #1e73be;
    --rfwc-blue-hover: #1A5FA0;
    --rfwc-danger: #dc3545;
    --rfwc-danger-hover: #bb2d3b;
    --rfwc-border: #ccd0d4;
    --rfwc-border-light: #f0f0f0;
    --rfwc-bg-light: #f8f9fa;
    --rfwc-text: #23282d;
    --rfwc-text-muted: #666;
    --rfwc-radius: 6px;
    --rfwc-shadow: 0 4px 10px rgba(0,0,0,0.08);
    --rfwc-shadow-lg: 0 12px 30px rgba(0,0,0,0.2);
}

/* ===================================
   Toolbar
   =================================== */
#rfwc-toolbar {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0 14px 0;
    padding: 10px 0;
}

.tablenav .rfwc-toolbar {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* ===================================
   Buttons - FIXED: All toolbar buttons to 32px height
   =================================== */
.wp-core-ui .rfwc-toolbar .button.rfwc-btn,
.wp-core-ui .button.rfwc-btn {
    background: var(--rfwc-primary) !important;
    color: #fff !important;
    border: 1px solid var(--rfwc-primary) !important;
    box-shadow: none !important;
    border-radius: var(--rfwc-radius);
    height: 32px !important;
    line-height: 30px !important;
    padding: 0 12px !important;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rfwc-btn:hover {
    background: var(--rfwc-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.3) !important;
}

.rfwc-btn:active {
    transform: translateY(0);
}

.rfwc-btn:disabled,
.rfwc-btn[data-pro-only="1"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.rfwc-btn[data-pro-only="1"]:hover {
    transform: none;
    box-shadow: none !important;
}

/* Button Variants - IMPORTANT: Keep green as green! */
.rfwc-btn--green,
.wp-core-ui .button.rfwc-btn--green,
#rfwc-open-today.rfwc-btn--green,
#rfwc-completed.rfwc-btn--green {
    background: var(--rfwc-green) !important;
    border-color: var(--rfwc-green) !important;
    color: #fff !important;
}

.rfwc-btn--green:hover,
.wp-core-ui .button.rfwc-btn--green:hover {
    background: var(--rfwc-green-hover) !important;
    border-color: var(--rfwc-green-hover) !important;
    box-shadow: 0 2px 8px rgba(46, 207, 99, 0.3) !important;
}

.rfwc-btn--blue,
.wp-core-ui .button.rfwc-btn--blue {
    background: var(--rfwc-blue) !important;
    border-color: var(--rfwc-blue) !important;
    color: #fff !important;
}

.rfwc-btn--blue:hover,
.wp-core-ui .button.rfwc-btn--blue:hover {
    background: var(--rfwc-blue-hover) !important;
    border-color: var(--rfwc-blue-hover) !important;
    box-shadow: 0 2px 8px rgba(30, 115, 190, 0.3) !important;
}

.rfwc-btn--danger {
    background: var(--rfwc-danger) !important;
    border-color: var(--rfwc-danger) !important;
}

.rfwc-btn--danger:hover {
    background: var(--rfwc-danger-hover) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
}

/* Button Icons */
.rfwc-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* ===================================
   TODAY'S REMINDERS Pulse Animation
   =================================== */
@keyframes rfwcPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 207, 99, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 207, 99, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 207, 99, 0);
    }
}

.rfwc-pulse {
    animation: rfwcPulse 1.5s ease-in-out infinite;
}

/* ===================================
   Search Bar
   =================================== */
.rfwc-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rfwc-search {
    padding: 6px 12px;
    border: 1px solid var(--rfwc-border);
    border-radius: var(--rfwc-radius);
    background: #fff;
    font-size: 14px;
    min-width: 200px;
    transition: all 0.2s ease;
}

.rfwc-search:focus {
    border-color: var(--rfwc-primary);
    box-shadow: 0 0 0 1px var(--rfwc-primary);
    outline: none;
}

.rfwc-search[readonly] {
    background: var(--rfwc-bg-light);
    cursor: not-allowed;
}

.rfwc-search-go {
    padding: 6px 10px !important;
    min-width: auto !important;
}

/* ===================================
   Popover & Overlay
   =================================== */
#rfwc-popover-overlay,
.rfwc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

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

.rfwc-popover {
    position: fixed;
    z-index: 100000;
    background: #fff;
    border: 1px solid var(--rfwc-border);
    border-radius: var(--rfwc-radius);
    box-shadow: var(--rfwc-shadow-lg);
    padding: 16px;
    min-width: 400px;
    max-width: 600px;
    max-height: 500px;
    overflow: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ===================================
   List Items
   =================================== */
.rfwc-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--rfwc-border-light);
    transition: background 0.2s ease;
}

.rfwc-list-item:hover {
    background: var(--rfwc-bg-light);
}

.rfwc-list-item:last-child {
    border-bottom: none;
}

.rfwc-title {
    font-weight: 600;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--rfwc-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.rfwc-title:hover {
    color: var(--rfwc-primary);
    text-decoration: underline;
}

.rfwc-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rfwc-actions .dashicons,
.rfwc-actions .rfwc-delete {
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    color: var(--rfwc-text-muted);
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.rfwc-actions .dashicons:hover,
.rfwc-actions .rfwc-delete:hover {
    opacity: 1;
    color: var(--rfwc-danger);
    transform: scale(1.1);
}

.rfwc-actions .dashicons.dashicons-trash {
    color: var(--rfwc-text-muted);
}

.rfwc-actions .dashicons.dashicons-trash:hover {
    color: var(--rfwc-danger);
}

/* Checkbox for bulk selection */
.rfwc-arch-chk {
    margin-right: 12px;
    cursor: pointer;
}

/* ===================================
   Pagination
   =================================== */
.rfwc-pager {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    margin-top: 12px;
    border-top: 1px solid var(--rfwc-border-light);
}

.rfwc-pager .button {
    min-width: 80px;
}

/* ===================================
   Bulk Actions Bar
   =================================== */
.rfwc-bulkbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
    padding: 10px;
    background: var(--rfwc-bg-light);
    border-radius: var(--rfwc-radius);
}

.rfwc-bulkbar select {
    min-width: 160px;
    padding: 4px 8px;
    border: 1px solid var(--rfwc-border);
    border-radius: var(--rfwc-radius);
}

/* ===================================
   Modal
   =================================== */
.rfwc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 680px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--rfwc-shadow-lg);
    z-index: 100001;
    display: none;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.rfwc-modal-header,
.rfwc-modal-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rfwc-modal-header {
    border-bottom: 1px solid var(--rfwc-border-light);
    background: var(--rfwc-bg-light);
    border-radius: 10px 10px 0 0;
}

.rfwc-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--rfwc-text);
}

.rfwc-modal-footer {
    border-top: 1px solid var(--rfwc-border-light);
    background: var(--rfwc-bg-light);
    border-radius: 0 0 10px 10px;
}

.rfwc-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--rfwc-text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rfwc-close:hover {
    color: var(--rfwc-danger);
    transform: scale(1.1);
}

.rfwc-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* ===================================
   Form Elements
   =================================== */
.rfwc-label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    color: var(--rfwc-text);
    font-size: 14px;
}

.rfwc-input,
.rfwc-textarea,
.rfwc-select {
    width: 100%;
    border: 1px solid var(--rfwc-border);
    border-radius: var(--rfwc-radius);
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.rfwc-input:focus,
.rfwc-textarea:focus,
.rfwc-select:focus {
    border-color: var(--rfwc-primary);
    box-shadow: 0 0 0 1px var(--rfwc-primary);
    outline: none;
}

.rfwc-input:disabled,
.rfwc-textarea:disabled {
    background: var(--rfwc-bg-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.rfwc-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Category Block - FIXED: Reduced margin from header to 10px for proper 20px spacing */
.rfwc-category-block {
    margin-top: 10px !important;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--rfwc-bg-light);
    border-radius: var(--rfwc-radius);
}

.rfwc-category-block .rfwc-input {
    max-width: 320px;
}

/* ===================================
   Inline Rows
   =================================== */
.rfwc-row {
    margin: 16px 0;
}

.rfwc-inline-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rfwc-mini-label {
    font-size: 13px;
    color: var(--rfwc-text-muted);
    white-space: nowrap;
}

/* Remind & Email Buttons - FIXED: Center alignment and 32px height */
.rfwc-remind-btn,
.rfwc-email-btn {
    min-width: 140px;
    height: 32px !important;
    line-height: 30px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    text-align: center !important;
    display: inline-block !important;
}

/* Force center alignment even when disabled */
.rfwc-remind-btn:disabled,
.rfwc-email-btn:disabled {
    text-align: center !important;
}

/* ===================================
   Extensions Area - FIXED: 20px spacing to footer
   =================================== */
.rfwc-extensions {
    margin-top: 16px;
    margin-bottom: 20px !important;
    padding-top: 16px;
    border-top: 1px dashed var(--rfwc-border);
}

/* Ensure 20px gap between last modal content and footer */
.rfwc-modal-body {
    padding-bottom: 0px;
}

.rfwc-modal-footer {
    margin-top: 0px;
}

/* ===================================
   Badges
   =================================== */
.rfwc-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--rfwc-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===================================
   Toast Notifications
   =================================== */
.rfwc-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--rfwc-radius);
    font-size: 14px;
    z-index: 100010;
    box-shadow: var(--rfwc-shadow-lg);
    animation: toastSlideIn 0.3s ease;
    display: none;
}

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

.rfwc-pro-toast {
    position: absolute;
    background: #111;
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--rfwc-radius);
    font-size: 12px;
    z-index: 100010;
    box-shadow: var(--rfwc-shadow-lg);
    white-space: nowrap;
}

/* ===================================
   Loading Spinner
   =================================== */
.rfwc-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--rfwc-text-muted);
}

.rfwc-spinner {
    border: 3px solid var(--rfwc-border-light);
    border-top: 3px solid var(--rfwc-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   Empty State
   =================================== */
.rfwc-empty {
    text-align: center;
    padding: 40px;
    color: var(--rfwc-text-muted);
}

.rfwc-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--rfwc-border);
    margin-bottom: 12px;
}

/* ===================================
   RTL Support
   =================================== */
body.rtl .rfwc-title {
    text-align: right;
}

body.rtl .rfwc-actions {
    flex-direction: row-reverse;
}

body.rtl .rfwc-arch-chk {
    margin-right: 0;
    margin-left: 12px;
}

body.rtl .rfwc-badge {
    margin-left: 0;
    margin-right: 6px;
}

/* ===================================
   Responsive Design
   =================================== */
@media screen and (max-width: 768px) {
    .rfwc-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rfwc-btn {
        width: 100%;
        justify-content: center;
    }
    
    .rfwc-search-wrap {
        width: 100%;
    }
    
    .rfwc-search {
        flex: 1;
    }
    
    .rfwc-popover,
    .rfwc-modal {
        width: 95%;
        max-width: none;
    }
    
    .rfwc-title {
        max-width: 60%;
    }
}

@media screen and (max-width: 480px) {
    .rfwc-modal-body {
        padding: 12px;
    }
    
    .rfwc-inline-center {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rfwc-remind-btn,
    .rfwc-email-btn {
        width: 100%;
    }
}