/* mycartly-store-owner-payouts.css */

/* Google Fonts - Inter */
body {
    font-family: 'Inter', sans-serif;
}

/* General Wrapper */
.wrap {
    max-width: 1200px; /* Increased max-width for a wider layout */
    margin: 20px auto;
    padding: 0 20px;
}

/* Page Title */
.wrap h1 {
    font-size: 2.5em;
    color: #111827;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Navigation Tabs */
.nav-tab-wrapper {
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0;
    display: flex;
    gap: 5px;
}

.nav-tab {
    display: inline-block;
    padding: 12px 20px;
    margin: 0;
    border: 1px solid #ccc;
    border-bottom: none;
    background: #f7f7f7;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    color: #555;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease-in-out;
    position: relative; /* Needed for z-index */
    z-index: 1; /* Ensure inactive tabs are behind the active tab's connecting border */
}

.nav-tab:hover {
    background: #fff;
    color: #0073aa;
}

.nav-tab-active {
    background: #fff;
    border-color: #ddd;
    border-bottom-color: transparent; /* Makes it connect visually */
    color: #000;
    font-weight: 700; /* Bolder for active state */
    z-index: 2; /* Ensures active tab is on top */
    border-bottom: 1px solid #fff; /* Create a white line over the wrapper border */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05); /* Subtle shadow for lift */
}

/* Card-like Sections - Upgraded */
.mycartly-payout-summary,
.mycartly-payout-history,
.form-table { /* Target form-table directly for section styling */
    background: linear-gradient(to bottom right, #ffffff, #f0f0f0); /* More pronounced gradient */
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 50px; /* Increased padding to 50px for the card itself */
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.mycartly-payout-summary h2,
.mycartly-payout-history h2,
.mycartly-payout-settings-form h2.title { /* Targeting h2 for sections */
    font-size: 1.6em;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Payout Summary Specifics */
.mycartly-pending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mycartly-pending-list li {
    padding: 20px 25px; /* Increased padding */
    border-bottom: 1px solid #e0e0e0; /* Solid border for better separation */
    display: flex;
    justify-content: space-between; /* Space out content */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px;
    font-size: 1.1em;
    color: #444;
    background-color: #fcfcfc; /* Slightly off-white background for list items */
    border-radius: 8px; /* Rounded corners for list items */
    margin-bottom: 10px; /* Space between list items */
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); /* Subtle shadow for depth */
    transition: all 0.2s ease-in-out;
}

.mycartly-pending-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mycartly-pending-list li:hover {
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* More pronounced shadow on hover */
    background-color: #ffffff; /* White background on hover */
}

.mycartly-pending-list li strong {
    font-size: 1.8em; /* Significantly larger font size for amount */
    color: #0073aa; /* Keeping the existing blue for primary amount */
    font-weight: 700; /* Bolder */
    display: flex;
    align-items: center;
    gap: 10px; /* Space for icon if added via PHP/JS */
}

/* Using Dashicons for currency symbol */
.mycartly-pending-list li strong::before {
    content: "\f155"; /* Dashicon for money/dollar sign - more generic */
    font-family: 'dashicons'; /* Assuming dashicons are available */
    font-size: 1em; /* Adjust size relative to text */
    color: #0073aa; /* Same color as text */
}

.mycartly-request-payout-btn {
    background-color: #28a745; /* Green for action */
    color: #fff;
    border: none;
    padding: 12px 25px; /* Larger padding */
    border-radius: 8px; /* More rounded */
    cursor: pointer;
    font-size: 1.1em; /* Larger font */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(40,167,69,0.3); /* Green shadow */
    display: flex;
    align-items: center;
    gap: 8px;
}

.mycartly-request-payout-btn::before {
    content: "\f12a"; /* Dashicon for money/dollar sign, or similar */
    font-family: 'dashicons';
    font-size: 1.1em;
}


.mycartly-request-payout-btn:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-2px); /* More pronounced lift */
    box-shadow: 0 6px 15px rgba(40,167,69,0.4); /* Stronger shadow on hover */
}

.mycartly-request-payout-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mycartly-request-payout-loading {
    display: inline-block;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

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

#mycartly-payout-request-message-box.notice {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-size: 1em;
}

/* Form Fields Styling */
.form-table th {
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 20px; /* Consistent left padding for table headers */
    padding-right: 15px; /* Ensure some right padding too */
    font-weight: 600;
    color: #333;
    vertical-align: middle;
    width: 200px; /* Adjust as needed */
}

.form-table td {
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 20px; /* Consistent left padding for table cells */
    padding-right: 15px; /* Ensure some right padding too */
    vertical-align: middle;
}

/* Input Group for Floating Labels */
.input-group {
    position: relative;
    margin-bottom: 25px; /* Spacing between input groups */
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 12px;
    background-color: #fff; /* Base background, assuming input is on white background */
    padding: 0 5px;
    font-size: 0.85em;
    color: #6b7280;
    transition: 0.2s ease-out;
    pointer-events: none; /* Make label non-interactive */
    z-index: 1; /* Ensure label is above input when floating */
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group select:focus + label, /* Added for select focus */
.input-group select:valid + label /* Added for select with a selected option */
{
    top: -10px;
    font-size: 0.75em;
    color: #2563eb;
    background-color: #fff; /* Ensure it's explicitly white for light mode, matching input background */
    padding: 0 6px; /* Slightly increase horizontal padding for better visual separation */
}

.regular-text,
.large-text,
select {
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%; /* Make inputs fill their container */
    max-width: 400px; /* Limit max width */
    padding-top: 18px; /* Increased padding-top for floating label */
    box-sizing: border-box; /* Include padding in width calculation */
}

.regular-text:focus,
.large-text:focus,
select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Container for Bank Name Input and Suggestions */
.mycartly-input-container {
    position: relative; /* Essential for absolute positioning of suggestions */
    display: block; /* Use block to take full width of parent td */
    width: 100%; /* Take full width of parent td */
    max-width: 400px; /* Match the max-width of the input field */
}

/* Account Number and Verify Button Alignment */
#mycartly_account_number {
    display: inline-block;
    width: auto; /* Revert to auto to allow button next to it */
    max-width: 250px; /* Specific width for account number input */
    vertical-align: middle;
}

#mycartly_verify_bank_btn {
    margin-left: 10px;
    vertical-align: middle;
    background-color: #00a0d2;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s ease;
}

#mycartly_verify_bank_btn:hover {
    background-color: #008ec2;
}

#mycartly_verify_bank_btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#mycartly_account_name {
    background-color: #f9f9f9;
    cursor: default;
}

/* Description text below fields */
.description {
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
    display: block;
}

/* Bank Suggestions */
#mycartly_bank_suggestions {
    position: absolute;
    left: 0; /* Align with the left edge of the parent container */
    top: 100%; /* Position right below the input field */
    width: 100%; /* Take full width of the parent container */
    max-width: 400px; /* Ensure it doesn't exceed the input's max-width */
    background-color: #fff;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Slightly more prominent shadow */
    z-index: 1000;
    border-radius: 4px;
    margin-top: 2px; /* Small gap between input and suggestions */
    animation: fadeInDropdown 0.3s ease-out; /* Animate appearance */
}

#mycartly_bank_suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#mycartly_bank_suggestions li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#mycartly_bank_suggestions li:last-child {
    border-bottom: none;
}

#mycartly_bank_suggestions li:hover {
    background-color: #e0f2fe; /* Light blue on hover */
    transform: scale(1.01); /* Subtle zoom effect */
}

/* Animation for dropdown */
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Verification Status Message */
#mycartly_verification_status.notice {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    font-size: 1em;
    line-height: 1.5;
}

#mycartly_verification_status.notice p {
    margin: 0;
    padding: 0;
}

#mycartly_verification_status.notice-success {
    animation: fadeSlideIn 0.4s ease-out forwards;
}

@keyframes fadeSlideIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}


/* Submit Button */
.submit input[type="submit"] {
    background-color: #0085ba;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    -webkit-appearance: none; /* For consistent styling across browsers */
}

.submit input[type="submit"]:hover {
    background-color: #006799;
    transform: translateY(-1px);
}

.submit input[type="submit"]:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Dark Mode Styling */
body.dark-mode {
    background-color: #111827;
    color: #f9fafb;
}

body.dark-mode .wrap h1,
body.dark-mode .mycartly-payout-summary h2,
body.dark-mode .mycartly-payout-history h2,
body.dark-mode .mycartly-payout-settings-form h2.title,
body.dark-mode .nav-tab,
body.dark-mode .mycartly-pending-list li,
body.dark-mode .form-table th,
body.dark-mode .form-table td,
body.dark-mode .description {
    color: #f9fafb;
}

body.dark-mode .nav-tab {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .nav-tab-active {
    background: #111827;
    border-color: #374151;
    border-bottom-color: transparent;
    color: #fff;
}

body.dark-mode .mycartly-payout-summary,
body.dark-mode .mycartly-payout-history,
body.dark-mode .form-table {
    background: linear-gradient(to bottom right, #1f2937, #2d3748); /* Dark mode gradient */
    border-color: #374151;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 50px; /* Keep padding consistent for dark mode */
}

body.dark-mode .mycartly-pending-list li {
    border-bottom-color: #374151;
    background-color: #28303f; /* Slightly lighter background for list items in dark mode */
}

body.dark-mode .mycartly-pending-list li:hover {
    background-color: #343e4f; /* More distinct background on hover in dark mode */
}


body.dark-mode .mycartly-payout-summary h2,
body.dark-mode .mycartly-payout-history h2,
body.dark-mode .mycartly-payout-settings-form h2.title {
    border-bottom-color: #374151;
}

body.dark-mode .regular-text,
body.dark-mode .large-text,
body.dark-mode select {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .regular-text:focus,
body.dark-mode .large-text:focus,
body.dark-mode select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
}

body.dark-mode .input-group label {
    background-color: #1f2937; /* Base background for dark mode label, matches card */
}

body.dark-mode .input-group input:focus + label,
body.dark-mode .input-group input:not(:placeholder-shown) + label,
body.dark-mode .input-group select:focus + label,
body.dark-mode .input-group select:valid + label {
    color: #60a5fa;
    background-color: #374151; /* Match dark mode input background when floating */
    padding: 0 6px; /* Consistency in padding */
}

body.dark-mode #mycartly_account_name {
    background-color: #2d3748;
}

body.dark-mode #mycartly_bank_suggestions {
    background-color: #374151;
    border-color: #4b5563;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

body.dark-mode #mycartly_bank_suggestions li {
    border-bottom-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode #mycartly_bank_suggestions li:hover {
    background-color: #4a5568;
    color: #fff;
}

body.dark-mode .wp-list-table {
    background-color: #1f2937;
    border-color: #374151;
}

body.dark-mode .wp-list-table th {
    background-color: #2d3748;
    border-bottom-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .wp-list-table tbody tr {
    background-color: #1f2937;
    border-bottom-color: #374151;
    /* Removed padding from tbody tr as it was not having the desired effect on nested content */
}

body.dark-mode .wp-list-table tbody tr:nth-child(even) {
    background-color: #2d3748;
}

body.dark-mode .wp-list-table tbody tr:hover {
    background-color: #4a5568;
}


/* WordPress List Table Overrides (for history tab) */
.wp-list-table {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners on table */
}

.wp-list-table th,
.wp-list-table td {
    padding: 12px 15px; /* Default padding for all table cells */
    vertical-align: middle;
}

.wp-list-table th {
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-size: 0.95em;
}

.wp-list-table tbody tr {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    /* Removed padding from tbody tr as it was not having the desired effect on nested content */
}

.wp-list-table tbody tr:last-child {
    border-bottom: none;
}

.wp-list-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-list-table tbody tr:hover {
    background-color: #f0f8ff;
}

/* Table Navigation (Pagination and Filters) */
.tablenav {
    height: auto; /* Allow height to adjust */
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 10px;
}

.tablenav .actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    flex-grow: 1; /* Allow it to take available space */
}

.tablenav .actions select {
    max-width: 200px;
    padding: 7px 10px;
    height: auto;
}

.tablenav .actions .button {
    padding: 7px 14px;
    height: auto;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .wrap {
        padding: 0 10px;
    }

    .nav-tab {
        flex-grow: 1;
        text-align: center;
        padding: 10px 15px;
    }

    .nav-tab-wrapper {
        flex-wrap: wrap;
    }

    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0; /* Adjust padding for mobile display */
    }

    .form-table th {
        padding-bottom: 5px;
    }

    .form-table td {
        padding-top: 5px;
    }

    .regular-text,
    .large-text,
    select {
        max-width: 100%;
    }

    #mycartly_account_number,
    #mycartly_verify_bank_btn {
        display: block;
        width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
        max-width: none; /* Remove max-width for full width on mobile */
    }

    #mycartly_verify_bank_btn {
        margin-top: 10px;
    }

    .mycartly-pending-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .mycartly-request-payout-btn {
        width: 100%;
        margin-top: 10px;
    }

    .tablenav .actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .tablenav .actions select,
    .tablenav .actions .button {
        width: 100%;
        max-width: 100%;
    }
}
