.rank-section {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    min-height: 630px;
    overflow: hidden;
    position: relative;
}

#rank-log-output {
    max-height: 300px;
    overflow-y: scroll;
    background: #f1f1f1;
    padding: 10px;
    border: 1px solid #ccc;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 12px;
}

.rank-admin-wrap h1 .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

#toplevel_page_rank-admin a .wp-menu-image img {
    width: 22px!important;
    height: auto;
    padding: 9px 0 0;
    box-sizing: border-box;
    opacity: 1.0;
}

#toplevel_page_rank-admin .wp-menu-image {
    opacity: 1;
}

#rank-health-issues-container {
    max-width: 1300px;
}

/* Health issues grid styling */
.rank-issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    grid-gap: 20px;
    margin-top: 20px;
}

.rank-issue-box {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    min-height: 200px;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.rank-issue-box:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.rank-issue-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.rank-issue-box button {
    margin-top: auto;
}

.rank-issue-box p {
    margin-bottom: 15px;
    color: #555;
}

.rank-credits-info {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    font-size: 14px;
}

#rank-auto-process-button {
    margin-left: 10px;
    float: none!important;
}

/* Add more space above the Cancel button */
#rank-cancel-button {
    margin-top: 40px;
    display: block;
}

#rank-start-button {
    float:left;
}

/* Health issues loading spinner alignment */
#rank-health-issues-loading {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

#rank-health-issues-loading .spinner {
    float: none;
    margin: 0;
}

/* Header layout with spinner */
#rank-health-issues-container > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Status message minimum height */
.rank-issue-status {
    min-height: 20px;
}

.rank-issue-box.rank-issue-box-good {
    border: 1px solid #4CAF50; /* Green border */
    /* You might want to adjust padding or other styles if needed */
}

.rank-issue-box.rank-issue-box-warning {
    border: 1px solid #FFA500; /* Orange/amber border */
    background-color: #FFF8E1; /* Light amber background */
}

.rank-issue-box .rank-fix-issues-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rank-overall-status-message {
    padding: 10px;
    margin-top: 15px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
}

#rank-log-spinner {
        padding-bottom: 5px;
}

/* Approval row styling */
.rank-approval-row {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    margin-bottom: 15px;
    min-height:200px;
}

.rank-item-info {
    margin-bottom: 15px;
}

.rank-solution-options {
    margin-bottom: 15px;
}

.rank-actions {
    margin-top: 10px;
}

/* Loading placeholder styling */
.rank-loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-style: italic;
}

.rank-loading-placeholder::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #ccc;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: rank-loading-spinner 1s linear infinite;
}

@keyframes rank-loading-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Progress Bar Styling */
.rank-progress-container {
    width: 100%;
    background-color: #f1f1f1;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
    height: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rank-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    text-align: center;
    line-height: 20px;
    color: white;
    font-weight: bold;
    transition: width 0.3s ease;
    min-width: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Add animation for progress bar */
@keyframes progress-bar-stripes {
    from {
        background-position: 40px 0;
    }
    to {
        background-position: 0 0;
    }
}

.rank-progress-bar {
    background-image: linear-gradient(45deg,
                                     rgba(255, 255, 255, 0.15) 25%,
                                     transparent 25%,
                                     transparent 50%,
                                     rgba(255, 255, 255, 0.15) 50%,
                                     rgba(255, 255, 255, 0.15) 75%,
                                     transparent 75%,
                                     transparent);
    background-size: 40px 40px;
    animation: progress-bar-stripes 2s linear infinite;
}


.rank-log-container {
    margin-top:70px;
}

/* Recrawl notification styling */
.rank-recrawl-notification {
    clear: both;
    margin: 40px 0;
    padding: 12px 15px;
    border: 1px solid #FFA500;
    background-color: #FFF8E1;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    text-align: center;
    font-size: 14px;
    width: 100%;
    grid-column: 1 / -1;
}

.rank-recrawl-notification p {
    margin: 0;
    color: #1d2327;
}

.rank-recrawl-notification a {
    color: #007cba;
    text-decoration: underline;
    font-weight: 500;
}

.rank-recrawl-notification a:hover {
    color: #00a0d2;
}

/* Connection error styling */
.rank-connection-error {
    clear: both;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #dc3232; /* Red border */
    background-color: #fbeaea; /* Light red background */
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    text-align: left;
    font-size: 14px;
    border-left: 4px solid #dc3232;
    width: 100%;
    grid-column: 1 / -1;
}


.rank-connection-error p {
    margin: 0;
    color: #1d2327;
    font-size: 14px !important;
}

/* Processing area padding for cancel button */
#rank-processing-area {
    padding-bottom: 70px; /* Make room for the cancel button */
}

/* Cancel button container styling */
.rank-cancel-container {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 15px;
    clear: both;
}

#rank-cancel-button {
    padding: 8px 20px;
    font-size: 14px;
    background-color: #f6f7f7;
    border-color: #ccd0d4;
    box-shadow: 0 1px 0 #ccd0d4;
    min-width: 120px;
}

#rank-cancel-button:hover {
    background-color: #f0f0f1;
    border-color: #999;
}

/* Cancelling state styling */
#rank-cancel-button.cancelling {
    background-color: #dc3232!important;
    border-color: #b32d2e!important;
    color: #fff!important;
    box-shadow: 0 1px 0 #b32d2e!important;
    cursor: not-allowed;
}

/* Set font-size for all p tags within the plugin */
.rank-admin-wrap p,
.rank-section p,
#rank-health-issues-container p,
.rank-approval-row p,
.rank-recrawl-notification p,
.rank-item-info p,
.rank-solution-options p {
    font-size: 14px;
}

.rank-issue-box p {
    font-size:12px!important;
}

.rank-solution-approve-btn {
    background: white !important;
    color: black !important;
    border-color: #3ac9c4 !important;
    border-width: 2px !important;
    }

#rank-see-fixes-button {
    float: left;
}

.rank-skip-btn {
    margin-top: 20px;
}

.rank-log-spinner {
background-size: 30px 30px;
width: 30px;
height: 30px;
}

/* CSS Spinner for tab content loading */
.tab-content {
    position: relative;
    min-height: 200px; /* Ensure there's space for the spinner */
}

.tab-content-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007cba; /* WordPress blue */
    animation: tab-content-spin 1s linear infinite;
    z-index: 10;
}

@keyframes tab-content-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Tab navigation spinner */
.nav-tab-wrapper {
    position: relative;
}

.nav-tab-spinner {
    display: none;
    width: 20px;
    height: 20px;
    float: left;
    margin-top: 5px;
    margin-left: 10px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007cba; /* WordPress blue */
    animation: nav-tab-spin 1s linear infinite;
}

@keyframes nav-tab-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Experimental label styling */
.rank-experimental-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #563ac9;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: help;
}

.rank-experimental-label:hover {
        background-color: #563ac9;
}

/* Tooltip styling using data-tooltip attribute */
.rank-experimental-label[data-tooltip] {
    position: relative;
    float:right;
}

.rank-experimental-label[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: #563ac9;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 5px;
    width: 250px;
    text-align: left;
    line-height: 1.4;
}

/* Inline tooltip styling for "already fixed" info */
.rank-inline-tooltip {
    cursor: help;
    position: relative;
    display: inline;
}

.rank-inline-tooltip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #563ac9;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 5px;
    width: 250px;
    text-align: left;
    line-height: 1.4;
}

/* System Status Styles */
.rank-status-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 15px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.rank-status-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.rank-status-ok {
    color: #46b450;
    font-weight: bold;
}

.rank-status-error {
    color: #dc3232;
    font-weight: bold;
}

.rank-status-warning {
    color: #f0ad4e;
    font-weight: bold;
}

#rank-test-mode-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

#rank-test-mode-status {
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

#rank-test-mode-status.enabled {
    background-color: #fff8e5;
    border: 1px solid #ffb900;
}

#rank-test-mode-status.disabled {
    background-color: #f7fcfe;
    border: 1px solid #00a0d2;
}

/* Scan notification styling */
.rank-scan-notification {
    clear: both;
    margin: 20px 0;
    padding: 12px 15px;
    border: 1px solid #ffb900;
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    text-align: left;
    font-size: 14px;
    width: 100%;
    grid-column: 1 / -1;
}

.rank-scan-notification p {
    margin: 0;
    color: #1d2327;
}

.rank-scan-notification a {
    color: #007cba;
    text-decoration: underline;
    font-weight: 500;
}

.rank-scan-notification a:hover {
    color: #00a0d2;
}