/* Client Panel Styles */

.rebrandy_cp_wrapper {
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Barlow', sans-serif;
    color: var(--rebrandy-text-dark);
}

/* Navigation */
.rebrandy_cp_nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    background: #fff;
    padding: 15px 30px;
    border-radius: 99px;
    box-shadow: var(--rebrandy-shadow);
    flex-wrap: wrap;
}

.rebrandy_cp_nav_link {
    text-decoration: none;
    color: var(--rebrandy-text-gray);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.rebrandy_cp_nav_link:hover {
    color: var(--rebrandy-primary-blue);
    background: rgba(79, 128, 255, 0.05);
    /* Very light blue */
}

.rebrandy_cp_nav_link.active {
    background: var(--rebrandy-primary-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 128, 255, 0.3);
}

.rebrandy_cp_nav_link.logout {
    color: #e53e3e;
}

.rebrandy_cp_nav_link.logout:hover {
    background: rgba(229, 62, 62, 0.05);
    color: #c53030;
}

/* Content Area */
.rebrandy_cp_content {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--rebrandy-shadow);
    min-height: 400px;
}

.rebrandy_cp_header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rebrandy-border-color);
}

.rebrandy_cp_title {
    font-family: 'Lora', serif;
    font-size: 32px;
    color: var(--rebrandy-text-dark);
    margin: 0;
}

.rebrandy_cp_subtitle {
    display: block;
    margin-top: 10px;
    color: var(--rebrandy-text-gray);
    font-size: 16px;
}

/* Dashboard Cards */
.rebrandy_dashboard_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.rebrandy_dashboard_card {
    background: var(--rebrandy-bg-light);
    padding: 30px;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.rebrandy_dashboard_card:hover {
    transform: translateY(-5px);
}

.rebrandy_card_title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--rebrandy-text-dark);
}

.rebrandy_card_value {
    font-size: 36px;
    font-weight: 700;
    color: var(--rebrandy-primary-blue);
    font-family: 'Lora', serif;
}

.rebrandy_card_link {
    display: inline-block;
    margin-top: 15px;
    color: var(--rebrandy-text-gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.rebrandy_card_link:hover {
    color: var(--rebrandy-primary-blue);
}

/* Table (Orders) */
.rebrandy_table_wrapper {
    overflow-x: auto;
}

.rebrandy_table {
    width: 100%;
    border-collapse: collapse;
    width: 100%;
}

.rebrandy_table th {
    text-align: left;
    padding: 15px;
    font-size: 14px;
    color: var(--rebrandy-text-gray);
    font-weight: 600;
    border-bottom: 2px solid var(--rebrandy-border-color);
}

.rebrandy_table td {
    padding: 20px 15px;
    border-bottom: 1px solid var(--rebrandy-border-color);
    font-size: 15px;
}

.rebrandy_status_badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Barlow', sans-serif;
}

.rebrandy_status_badge.completed {
    background: #d4edda;
    color: #155724;
}

.rebrandy_status_badge.processing {
    background: #cce5ff;
    color: #004085;
}

.rebrandy_status_badge.pending {
    background: #fff3cd;
    color: #856404;
}

.rebrandy_status_badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Profile Form */
.rebrandy_profile_section {
    max-width: 100%;
    /* Use full width available */
}

/* Form Grid System */
.rebrandy_grid_row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.rebrandy_form_col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent overflow */
}

/* Accordions */
.rebrandy_accordion_item {
    border: 1px solid var(--rebrandy-border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fff;
    overflow: hidden;
}

.rebrandy_accordion_header {
    padding: 20px;
    background: #fdfdfd;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--rebrandy-text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    /* default no border */
    transition: background 0.2s;
}

.rebrandy_accordion_header:hover {
    background: #f9f9f9;
}

.rebrandy_accordion_item.active .rebrandy_accordion_header {
    border-bottom: 1px solid var(--rebrandy-border-color);
    background: #f5f7fa;
}

.rebrandy_accordion_icon::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--rebrandy-text-gray);
    transition: transform 0.3s;
    display: inline-block;
}

.rebrandy_accordion_item.active .rebrandy_accordion_icon::after {
    content: '−';
    /* Minus sign */
}

.rebrandy_accordion_content {
    display: none;
    padding: 25px;
    background: #fff;
}

/* Ensure full width inside accordion */
.rebrandy_accordion_content .rebrandy_profile_section {
    max-width: 100%;
}

.rebrandy_form_col.full-width {
    width: 100%;
    flex: 0 0 auto;
    /* Prevent height expansion in column layouts */
}

.rebrandy_form_label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rebrandy-text-gray);
}

.rebrandy_form_input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--rebrandy-border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #fdfdfd;
}

.rebrandy_form_input:focus {
    border-color: var(--rebrandy-primary-blue);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
    /* Assuming primary blue */
}

.rebrandy_section_separator {
    font-family: 'Lora', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--rebrandy-text-dark);
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.rebrandy_submit_btn {
    background-color: var(--rebrandy-primary-blue);
    color: #fff;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}

.rebrandy_submit_btn:hover {
    background-color: var(--rebrandy-text-dark);
    /* Darker on hover */
}

/* Make addresses stack on mobile base styles */
@media (max-width: 768px) {
    .rebrandy_grid_row {
        flex-direction: column;
        gap: 15px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .rebrandy_cp_nav {
        flex-direction: column;
        padding: 20px;
        align-items: stretch;
    }

    .rebrandy_cp_nav_link {
        text-align: center;
    }

    .rebrandy_cp_content {
        padding: 20px;
    }

    .rebrandy_cp_title {
        font-size: 24px;
    }
}

/* --- Modal Styles --- */

/* Main Container */
.rebrandy_modal {
    display: none;
    position: fixed;
    z-index: 999999;
    /* Very high to cover everything including footer */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent wrapper scroll */
    opacity: 0;
    transition: opacity 0.3s ease;
    /* background-color removed as requested */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* Flex centering */
    align-items: center;
    justify-content: center;
}

.rebrandy_modal.is-visible {
    opacity: 1;
    display: flex !important;
    /* Override display:block from JS for flex centering */
}

/* Modal Content */
.rebrandy_modal_content {
    background-color: #fff;
    margin: 0;
    /* Centered by flex */
    padding: 0;
    border: 1px solid var(--rebrandy-border-color);
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    box-shadow: var(--rebrandy-shadow);
    position: relative;
    z-index: 10;
    transform: translateY(-20px);
    transition: transform 0.3s ease;

    /* Internal scrolling setup */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.rebrandy_modal.is-visible .rebrandy_modal_content {
    transform: translateY(0);
}

/* Header */
.rebrandy_modal_header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--rebrandy-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Don't shrink header */
}

.rebrandy_modal_title {
    font-family: 'Lora', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--rebrandy-text-dark);
    margin: 0;
}

/* Close Button */
.rebrandy_modal_close {
    color: var(--rebrandy-text-gray);
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.rebrandy_modal_close:hover {
    color: var(--rebrandy-text-dark);
}

/* Body */
.rebrandy_modal_body {
    padding: 30px;
    overflow-y: auto;
    /* Internal scroll */
}

/* Modal Table Styles */
.rebrandy_modal_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rebrandy_modal_table th,
.rebrandy_modal_table td {
    padding: 12px;
    border-bottom: 1px solid var(--rebrandy-border-color);
    text-align: left;
    font-size: 14px;
}

.rebrandy_modal_table th {
    font-weight: 600;
    color: var(--rebrandy-text-gray);
}

.rebrandy_loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: var(--rebrandy-text-gray);
}

/* Lock Body Scroll */
body.rebrandy-modal-open {
    overflow: hidden !important;
    height: 100vh;
    /* Prevent some mobile scroll overrides */
}

/* --- Dashboard Recent Orders --- */
.rebrandy_section_header h2 {
    font-family: 'Lora', serif;
}

.rebrandy_table_card {
    transition: box-shadow 0.3s ease;
}

.rebrandy_table_card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.rebrandy_table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.rebrandy_table th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--rebrandy-text-gray);
    font-weight: 600;
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.rebrandy_table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: var(--rebrandy-text-dark);
    font-size: 14px;
    vertical-align: middle;
}

.rebrandy_table tr:last-child td {
    border-bottom: none;
}

.rebrandy_table td strong {
    font-weight: 600;
}

/* Responsive Table */
@media (max-width: 768px) {
    .rebrandy_table_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rebrandy_table {
        min-width: 600px;
        /* Ensure it scrolls instead of squishing */
    }
}

/* --- Order Filters --- */
.rebrandy_order_filters {
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    /* Reduced from 12px */
    border: 1px solid var(--rebrandy-border-color);
}

.rebrandy_filter_form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
    /* Force 1 row on desktop */
}

.rebrandy_filter_group {
    flex: 0 0 200px;
    /* Fixed width for inputs */
}

.rebrandy_filter_range {
    flex: 0 0 320px;
    /* Wider for range inputs */
    display: flex;
    align-items: center;
    gap: 10px;
}

.rebrandy_filter_input {
    padding: 10px 15px;
    font-size: 14px;
    width: 100%;
    /* Fill the group */
    border-radius: 6px;
    /* Reduced from default */
}

.rebrandy_range_separator {
    color: var(--rebrandy-text-gray);
    font-weight: 500;
}

.rebrandy_filter_btn {
    padding: 0px 24px;
    font-size: 14px;
    width: auto !important;
    /* Prevent full width */
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 6px;
    /* Reduced from 50px */
}

.rebrandy_filter_reset {
    color: var(--rebrandy-text-gray);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    margin-left: 5px;
    white-space: nowrap;
}

.rebrandy_filter_reset:hover {
    color: #e53e3e;
}

@media (max-width: 768px) {
    .rebrandy_filter_form {
        flex-direction: column;
        align-items: stretch;
    }

    .rebrandy_filter_group,
    .rebrandy_filter_range {
        flex: 1;
        width: 100%;
    }

    .rebrandy_filter_range {
        flex-direction: row;
    }

    .rebrandy_filter_btn {
        width: 100% !important;
        /* Full width on mobile */
    }

    .rebrandy_filter_reset {
        text-align: center;
        padding: 10px;
        display: block;
    }
}