.rui-projects {
    margin: 0;
    padding: 0;
}

.rui-credits-display {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rui-project-submission {
    margin-bottom: 40px;
}

.rui-project-submission form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rui-project-submission label {
    font-weight: bold;
}

.rui-project-submission input[type="text"],
.rui-project-submission textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: var(--wp--preset--color--inputbg);
    color: var(--wp--preset--color--inputtext);
}

.rui-project-submission input[type="text"]::placeholder,
.rui-project-submission input[type="text"]::-webkit-input-placeholder,
.rui-project-submission input[type="text"]::-moz-placeholder,
.rui-project-submission input[type="text"]:-ms-input-placeholder,
.rui-project-submission input[type="text"]:-moz-placeholder,
.rui-project-submission textarea::placeholder,
.rui-project-submission textarea::-webkit-input-placeholder,
.rui-project-submission textarea::-moz-placeholder,
.rui-project-submission textarea:-ms-input-placeholder,
.rui-project-submission textarea:-moz-placeholder {
    color: #767676 !important;
    opacity: 1 !important;
}

/* Search container */
.rui-search-container {
    margin: 20px 0;
    max-width: 400px;
}

.rui-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: var(--wp--preset--color--inputbg, #fff);
    color: var(--wp--preset--color--inputtext, #000);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%23999" d="M11.7 10.3c.8-1 1.3-2.3 1.3-3.8 0-3.3-2.7-6-6-6S1 3.2 1 6.5s2.7 6 6 6c1.4 0 2.8-.5 3.8-1.3l3.3 3.3c.4.4 1 .4 1.4 0 .4-.4.4-1 0-1.4l-3.8-2.8zm-4.7 1.2c-2.5 0-4.5-2-4.5-4.5S4.5 2 7 2s4.5 2 4.5 4.5-2 4.5-4.5 4.5z"/></svg>');
    background-position: 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    transition: border-color 0.2s ease;
}

.rui-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.rui-search-input::placeholder {
    color: #767676;
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .rui-search-container {
        max-width: 100%;
    }
}

.rui-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    margin-top: 20px;
}

.rui-projects table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensure table doesn't shrink too much */
}

.rui-projects table th,
.rui-projects table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

.rui-projects table th {
    font-weight: bold;
}

.rui-projects table td a.button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

@media screen and (max-width: 600px) {
    .rui-projects table th,
    .rui-projects table td {
        padding: 8px 5px;
    }
    
    .rui-projects table th:nth-child(4),
    .rui-projects table td:nth-child(4) {
        display: none; /* Hide 'Created at' column on very small screens */
    }
}

.rui-api-key-display {
    margin-top: 20px;
}

details {
    margin-top: 20px;
}

details summary {
    font-weight: bold;
    cursor: pointer;
}

details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

details table th,
details table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

details table th {
    font-weight: bold;
}

details ul {
    margin-top: 10px;
    padding-left: 20px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    transition: opacity 0.1s ease-in-out;
}

.modal-content {
    background-color: #1e1e1e; /* Unified darker background */
    color: #ffffff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #424242;
    border-radius: 8px; /* Add border radius for modern look */
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative; /* Combined positioning rule */
}

/* Unified close button for all modals */
.modal-close {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 1001;
    display: block;
    transition: opacity 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    opacity: 0.7;
    text-decoration: none;
    cursor: pointer;
}

#indexingChart {
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
    background-color: #1e1e1e;
    color: #ffffff;
}

.chart-data-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.chart-data-table th, .chart-data-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #424242; /* Dark grey border */
}

.chart-data-table th {
    background-color: #1e1e1e; /* Slightly lighter than the modal background */
    color: #ffffff;
}

.chart-data-table tr:hover {
    background-color: #2c2c2c; /* Slightly lighter on hover */
}

/* Fix word-break for long project names in first column */
.rui-projects table td:first-child {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 200px; /* Prevent excessive width */
}

/* Status badges */
.rui-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rui-status-pending {
    background-color: #ff9800;
    color: #000;
}

.rui-status-submitted {
    background-color: #2196f3;
    color: #fff;
}

.rui-status-completed {
    background-color: #4caf50;
    color: #fff;
}

.rui-status-failed {
    background-color: #f44336;
    color: #fff;
}

.rui-status-refunded {
    background-color: #9c27b0;
    color: #fff;
}

/* Progress visualization */
.rui-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rui-progress-bar {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.rui-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.rui-progress-low {
    background-color: #f44336;
}

.rui-progress-medium {
    background-color: #ff9800;
}

.rui-progress-high {
    background-color: #4caf50;
}

.rui-progress-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* Action buttons with icons */
.rui-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.rui-action-btn:hover {
    text-decoration: underline;
}

.rui-action-btn::before {
    font-size: 16px;
    margin-right: 4px;
    text-decoration: none !important;
}

.rui-action-download::before {
    content: "📥";
}

.rui-action-chart::before {
    content: "📊";
}

.rui-action-waiting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rui-action-waiting::before {
    content: "⏳";
    margin-right: 4px;
}

/* Improved table hover and spacing */
.rui-projects table tbody tr {
    transition: background-color 0.2s ease;
}

.rui-projects table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.rui-projects table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

.rui-projects table td {
    padding: 12px 10px; /* Slightly more padding */
    vertical-align: middle;
}

/* Action column styling */
.rui-projects table td:last-child {
    min-width: 180px;
}

.rui-projects table td:last-child a,
.rui-projects table td:last-child span {
    display: block;
    margin-bottom: 4px;
}

.rui-projects table td:last-child a:last-child,
.rui-projects table td:last-child span:last-child {
    margin-bottom: 0;
}

/* URLs Modal Styles */
.rui-urls-list {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #424242;
    padding: 10px;
    margin-top: 10px;
    background: #1e1e1e;
}

.url-item {
    padding: 8px;
    border-bottom: 1px solid #333;
    word-break: break-all;
    font-family: monospace;
    font-size: 13px;
    color: #ffffff;
}

.url-item:hover {
    background: #2c2c2c;
}

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

.rui-modal-search {
    margin: 15px 0;
}

.rui-modal-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #424242;
    background: #1e1e1e;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.rui-modal-search input:focus {
    outline: none;
    border-color: #2196f3;
}

.rui-modal-search input::placeholder {
    color: #767676;
    opacity: 1;
}

.rui-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 0;
}

.rui-modal-header span {
    font-weight: 600;
    color: #ffffff;
}

.rui-action-urls::before {
    content: "📋";
}
