/* filepath: /Users/staytuned/Github/StaytunedLLP/1000xrewards.com/src/fd_admin/static/withdraw.styles.css */

/* General Page Layout */
body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    background-color: #f8f9fa; /* Light background */
    color: #212529; /* Dark text */
}

.page-container {
    display: grid;
    grid-template-columns: auto 1fr; /* Sidebar and main content */
    grid-template-rows: 1fr auto; /* Main content and bottom nav */
    min-height: 100vh;
    container-type: inline-size; /* Set up container context for queries */
}

.main-content {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 1.5rem 2rem;
    overflow-y: auto; /* Allow scrolling if content overflows */
    background-color: #fff; /* White background for main content area */
    container-name: main-content-area; /* Name the container */
    container-type: inline-size;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: #343a40;
}

.export-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: #e88a3c; /* Theme color */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.export-button:hover {
    background-color: #d9792c; /* Darker shade on hover */
}

.export-button svg {
    margin-bottom: 2px; /* Align icon better */
}

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Align items vertically */
    margin-bottom: 1.5rem;
    background-color: #fff6ee; /* Light orange background */
    padding: 1rem 1.5rem;
    border-radius: 8px;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 1rem; /* Space between items when wrapped */
}

.search-filter-container {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Space between search and filters */
    flex-grow: 1; /* Allow this container to grow */
    flex-wrap: wrap; /* Allow internal wrapping */
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 0.3rem 0.5rem 0.3rem 0.8rem;
    flex-grow: 1; /* Allow search bar to take available space */
    min-width: 250px; /* Minimum width */
}

.search-bar input {
    border: none;
    outline: none;
    flex-grow: 1;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    background: transparent;
}

.search-bar button {
    background: none;
    border: none;
    padding: 0.3rem;
    cursor: pointer;
    color: #6c757d; /* Muted icon color */
    display: inline-flex; /* Align icon properly */
}

.search-bar button svg {
    width: 18px;
    height: 18px;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
}

.filter-button {
    padding: 0.5rem 1rem;
    border: 1px solid #e88a3c;
    border-radius: 20px; /* Pill shape */
    background-color: #fff;
    color: #e88a3c;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.filter-button.active,
.filter-button:hover {
    background-color: #e88a3c;
    color: white;
}
.filter-button.active svg {
    display: inline-block; /* Show checkmark only when active */
}
.filter-button:not(.active) svg {
    display: none;
}

.sort-container {
    /* Removed empty ruleset */
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: #fff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sort-button:hover {
    background-color: #e9ecef;
}

/* Mobile Search Icon - Initially hidden */
.mobile-search-icon {
    display: none;
}

/* Table Section */
.table-section {
    background-color: #fff6ee; /* Light orange background for table header area */
    border-radius: 8px;
    padding: 0.5rem 1.5rem; /* Padding around the header */
    overflow: hidden; /* Ensures border radius applies correctly */
}

.table-wrapper {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scroll on smaller screens */
    background-color: #fff; /* White background for table body */
    border-radius: 0 0 8px 8px; /* Round bottom corners */
    margin-top: 0.5rem; /* Space between header bg and table */
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Minimum width before scrollbar appears */
    font-size: 0.9rem;
}

thead {
    /* Removed empty ruleset */
}

th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6; /* Light border between rows */
    white-space: nowrap; /* Prevent text wrapping */
}

th {
    font-weight: 600;
    color: #495057; /* Header text color */
    background-color: transparent; /* Background handled by .table-section */
}

tbody tr:last-child td {
    border-bottom: none; /* Remove border from last row */
}

tbody tr:hover {
    background-color: #f8f9fa; /* Slight hover effect */
}

.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px; /* Pill shape */
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fff0e1; /* Light yellow/orange */
    color: #ffa500; /* Orange */
}

.status-approved {
    background-color: #e6f4ea; /* Light green */
    color: #28a745; /* Green */
}

.view-details-button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #e88a3c;
    border-radius: 6px;
    background-color: transparent;
    color: #e88a3c;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-details-button:hover {
    background-color: #fff6ee; /* Light orange background on hover */
}

/* --- Responsiveness --- */

/* Hide Sidebar and show BottomNav on smaller screens */
/* Using a standard media query approach first */
@media (max-width: 768px) {
    .page-container {
        grid-template-columns: 1fr; /* Single column */
        grid-template-rows: auto 1fr auto; /* Header, content, nav */
    }

    aside.sidebar {
        /* Target Sidebar component */
        display: none;
    }

    nav.bottom-nav {
        /* Target BottomNav component */
        display: grid; /* Show bottom nav */
    }

    .main-content {
        grid-column: 1 / 2; /* Take full width */
        grid-row: 2 / 3; /* Position below potential header */
        padding: 1rem; /* Reduce padding */
    }

    /* Mobile specific adjustments */
    .page-header {
        /* Header might need adjustments, e.g., stack title and button */
        flex-direction: column;
        align-items: flex-start;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch; /* Stretch items full width */
        padding: 1rem;
    }

    .search-filter-container {
        flex-direction: row; /* Keep filters and mobile search icon in a row */
        gap: 1rem;
        align-items: center; /* Align items vertically */
        width: 100%; /* Take full width */
        justify-content: space-between; /* Space out filters and search icon */
    }

    .search-bar.desktop-search {
        display: none; /* Hide desktop search bar */
    }

    .filter-buttons {
        justify-content: flex-start; /* Align filter buttons to the start */
        flex-wrap: nowrap; /* Prevent wrapping for the main two */
        gap: 0.5rem;
    }
    /* Keep text for Pending/Approved */
    .filter-button {
        padding: 0.5rem 0.8rem;
    }
    .filter-button.active {
        /* Removed empty ruleset */
    }
    .filter-button:not(.active) svg {
        /* Keep checkmark hidden if not active */
        display: none;
    }
    /* Hide the 'All' button on mobile as it's not in the design */
    .filter-button:first-child {
        display: none;
    }

    .sort-container.desktop-sort {
        display: none; /* Hide sort button on mobile */
    }

    /* Mobile Search Icon (appears next to filters) */
    .mobile-search-icon {
        display: inline-flex; /* Show the mobile search icon */
        background: #fff;
        border: 1px solid #ced4da;
        border-radius: 50%;
        padding: 0.6rem;
        cursor: pointer;
        color: #6c757d;
        /* margin-left: auto; /* Removed, using space-between on container */
    }
    .mobile-search-icon svg {
        width: 20px;
        height: 20px;
    }

    .table-section {
        padding: 0.5rem;
        background-color: transparent; /* Remove header bg color */
    }
    thead {
        display: none; /* Hide header as per mobile image */
    }
    tbody tr {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Two columns */
        gap: 0.5rem 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        background-color: #fff; /* White background for each card */
    }
    tbody td {
        border: none;
        padding: 0.2rem 0;
        white-space: normal;
        display: flex;
        flex-direction: column;
    }
    tbody td::before {
        /* Add labels using pseudo-elements */
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: #6c757d;
        margin-bottom: 0.2rem;
        text-transform: capitalize; /* Match image labels */
    }

    /* Specific styling for mobile table cells */
    td[data-label="Date and Time"] {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    } /* Date */
    td[data-label="Transaction ID"] {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        text-align: right;
    } /* Transaction ID */
    td[data-label="User ID"] {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
    } /* User ID */
    /* Hide Amount, Status, Action columns/labels as per mobile image */
    td[data-label="Amount"],
    td[data-label="Status"],
    td[data-label="Action"] {
        display: none;
    }

    .table-wrapper {
        overflow-x: visible;
        margin-top: 1rem;
    }
    table {
        min-width: auto;
    }
}

/* Container Query Example (Alternative/Supplement to Media Queries) */
/* Apply styles when the main content area is below a certain width */
@container main-content-area (max-width: 600px) {
    .page-header h1 {
        font-size: 1.5rem; /* Smaller title */
    }

    /* Add more container-specific styles if needed */
    /* This can refine styles within the main content area */
    /* without relying solely on viewport width */
}
