/**
 * SearchFIT Admin Styles
 *
 * @package SearchFIT
 * @since   1.0.0
 */

/* ==========================================================================
   Admin Page Layout
   ========================================================================== */

.searchfit-welcome-page {
    margin: 0;
    padding: 0;
    margin-right: 40px;
}

.searchfit-welcome-page .searchfit-page-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 24px 0;
    padding: 20px 20px 0;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 12px;
}

.searchfit-title-logo {
    width: 32px;
    height: 32px;
    display: block;
}

/* ==========================================================================
   Cards Grid
   ========================================================================== */

.searchfit-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid #dcdcde;
    border-radius: 24px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .searchfit-cards-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Card Items
   ========================================================================== */

.searchfit-card-item {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px;
    border-bottom: 1px solid #dcdcde;
}

.searchfit-cards-grid > .searchfit-card-item:last-child {
    border-bottom: none;
}

@media (min-width: 768px) {
    .searchfit-card-item {
        padding: 40px;
        border-bottom: none;
        border-right: 1px solid #dcdcde;
    }

    .searchfit-cards-grid-2 > .searchfit-card-item:nth-child(2n) {
        border-right: none;
    }
}

.searchfit-card-shrink {
    flex-shrink: 0;
}

.searchfit-card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.searchfit-card-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.searchfit-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.searchfit-card-description {
    font-size: 14px;
    color: #646970;
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Icon Wrappers
   ========================================================================== */

.searchfit-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.searchfit-icon-emerald {
    background: #d1fae5;
    color: #047857;
}

.searchfit-icon-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.searchfit-icon {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   Credential Fields
   ========================================================================== */

.searchfit-credential-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.searchfit-credential-label {
    font-size: 11px;
    font-weight: 500;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.searchfit-credential-input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    overflow: hidden;
    background: #f6f7f7;
}

.searchfit-credential-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #1d2327;
    min-width: 0;
}

.searchfit-credential-input:focus {
    outline: none;
}

.searchfit-credential-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    border: none;
    background: transparent;
    color: #646970;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
    border-left: 1px solid #dcdcde;
}

.searchfit-credential-copy:hover {
    color: #1d2327;
    background: #f0f0f1;
}

.searchfit-copy-feedback {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    margin-bottom: 4px;
}

.searchfit-credential-copy.copied .searchfit-copy-feedback {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.searchfit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
}

.searchfit-btn-primary {
    background: #2271b1;
    color: #fff;
}

.searchfit-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.searchfit-btn-text-danger {
    background: transparent;
    color: #d63638;
    padding: 8px 0;
    justify-content: flex-start;
}

.searchfit-btn-text-danger:hover {
    color: #a00;
}

/* ==========================================================================
   Steps List
   ========================================================================== */

.searchfit-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.searchfit-steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.searchfit-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.searchfit-step-text {
    font-size: 14px;
    color: #50575e;
    line-height: 1.5;
    padding-top: 2px;
}

/* Card Footer */
.searchfit-card-footer {
    margin-top: auto;
    padding-top: 8px;
}

.searchfit-card-footer .searchfit-btn {
    width: 100%;
}

/* ==========================================================================
   Sheet / Slideout Panel
   ========================================================================== */

.searchfit-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.searchfit-sheet.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.searchfit-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.searchfit-sheet-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.searchfit-sheet.open .searchfit-sheet-panel {
    transform: translateX(0);
}

.searchfit-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #dcdcde;
    flex-shrink: 0;
}

.searchfit-sheet-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.searchfit-sheet-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.searchfit-sheet-subtitle {
    font-size: 14px;
    color: #646970;
    margin: 0;
}

.searchfit-sheet-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #646970;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.searchfit-sheet-close:hover {
    background: #f0f0f1;
    color: #1d2327;
}

.searchfit-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ==========================================================================
   API Documentation Styles
   ========================================================================== */

.searchfit-api-docs {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.searchfit-api-doc-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 12px 0;
}

.searchfit-api-doc-section h3 svg {
    color: #646970;
}

.searchfit-doc-intro {
    font-size: 14px;
    color: #646970;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Code Blocks */
.searchfit-code-block {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
}

.searchfit-code-block pre {
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.searchfit-code-block-dark {
    background: #1d2327;
    border-color: #1d2327;
}

.searchfit-code-block-dark pre {
    color: #f0f0f1;
}

/* Endpoint Cards */
.searchfit-endpoint-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.searchfit-endpoint-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
}

.searchfit-endpoint-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.searchfit-endpoint-method.post {
    background: #d1fae5;
    color: #047857;
}

.searchfit-endpoint-method.get {
    background: #dbeafe;
    color: #1d4ed8;
}

.searchfit-endpoint-method.put {
    background: #fef3c7;
    color: #92400e;
}

.searchfit-endpoint-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.searchfit-endpoint-path {
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #1d2327;
    background: transparent;
    padding: 0;
}

.searchfit-endpoint-desc {
    font-size: 12px;
    color: #646970;
}

/* Documentation Note */
.searchfit-doc-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #646970;
    margin: 12px 0 0 0;
    padding: 12px;
    background: #f0f6fc;
    border-radius: 6px;
}

.searchfit-doc-note svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #2271b1;
}

.searchfit-doc-note code {
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 12px;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Parameters List */
.searchfit-params-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.searchfit-param-item {
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
}

.searchfit-param-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.searchfit-param-name {
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    background: transparent;
    padding: 0;
}

.searchfit-param-type {
    font-size: 11px;
    color: #646970;
    padding: 2px 6px;
    background: #e7e8ea;
    border-radius: 3px;
}

.searchfit-param-required {
    font-size: 11px;
    font-weight: 500;
    color: #d63638;
    padding: 2px 6px;
    background: #fcf0f1;
    border-radius: 3px;
}

.searchfit-param-optional {
    font-size: 11px;
    font-weight: 500;
    color: #646970;
    padding: 2px 6px;
    background: #e7e8ea;
    border-radius: 3px;
}

.searchfit-param-desc {
    font-size: 13px;
    color: #646970;
    margin: 0;
    line-height: 1.5;
}

.searchfit-param-default {
    font-family: 'SF Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: #646970;
    background: #e7e8ea;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Response Badge */
.searchfit-response-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.searchfit-response-badge.success {
    background: #d1fae5;
    color: #047857;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 782px) {
    .searchfit-welcome-page {
        margin-right: 0;
    }

    .searchfit-welcome-page .searchfit-page-title {
        font-size: 24px;
        padding: 16px 16px 0;
    }

    .searchfit-cards-grid {
        border-radius: 16px;
        margin: 0 16px 24px;
    }

    .searchfit-card-item {
        padding: 20px;
    }

    .searchfit-sheet-panel {
        max-width: 100%;
    }
}

/* ==========================================================================
   Toggle Switch (Radio Buttons)
   ========================================================================== */

.searchfit-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.searchfit-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.searchfit-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dcdcde;
    transition: all 0.2s ease;
    border-radius: 24px;
}

.searchfit-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.searchfit-toggle-switch input:checked + .searchfit-toggle-slider {
    background-color: #2271b1;
}

.searchfit-toggle-switch input:checked + .searchfit-toggle-slider:before {
    transform: translateX(20px);
}

.searchfit-toggle-switch input:focus + .searchfit-toggle-slider {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

/* Hover effect for better UX */
.searchfit-toggle-switch:hover input:not(:checked) + .searchfit-toggle-slider {
    background-color: #c3c4c7;
}

.searchfit-toggle-switch:hover input:checked + .searchfit-toggle-slider {
    background-color: #135e96;
}

