/*
 *   Copyright (c) 2025 BitsHost
 *   All rights reserved.

 *   Permission is hereby granted, free of charge, to any person obtaining a copy
 *   of this software and associated documentation files (the "Software"), to deal
 *   in the Software without restriction, including without limitation the rights
 *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *   copies of the Software, and to permit persons to whom the Software is
 *   furnished to do so, subject to the following conditions:

 *   The above copyright notice and this permission notice shall be included in all
 *   copies or substantial portions of the Software.

 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *   SOFTWARE.
 */


/**
 * CM Auto Alt Text - Admin Styles
 * 
 * @package CM_Auto_Alt_Text
 * @version 1.4.0
 */

.cm-auto-alt-text-admin {
    max-width: 1200px;
    margin: 20px 0;
}

/* Loading state */
.cm-alt-text-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 18px;
    color: #666;
}

/* Tab headers */
.components-tab-panel__tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.components-button.components-tab-panel__tabs-item {
    padding: 12px 20px;
    border: none;
    background: none;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.components-button.components-tab-panel__tabs-item:hover {
    color: #0073aa;
    background-color: #f7f7f7;
}

.components-button.components-tab-panel__tabs-item[aria-selected="true"] {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background-color: #f7f7f7;
}

/* Tab content */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tab-header h2 {
    margin: 0;
    color: #1d2327;
}

/* Providers Grid */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.provider-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.provider-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.provider-card .components-card__header {
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
    padding: 15px 20px;
}

.provider-card .components-card__header h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.provider-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.provider-card .components-card__body {
    padding: 20px;
}

.provider-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.provider-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.provider-info h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.provider-info ul {
    margin: 0;
    padding-left: 20px;
}

.provider-info li {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

/* Settings Tab */
.settings-tab {
    max-width: 800px;
}

.settings-tab .components-card {
    margin-bottom: 20px;
}

.settings-tab .components-card__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.settings-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Stats Tab */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    border: 1px solid #ddd;
    border-radius: 8px;
}

.stat-card .components-card__header {
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.stat-card .components-card__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: #1d2327;
}

/* Bulk Tab */
.bulk-tab {
    max-width: 600px;
}

.bulk-tab .components-card {
    margin-bottom: 20px;
}

.bulk-tab .description {
    color: #666;
    font-style: italic;
    margin: 10px 0;
}

/* Form Controls */
.components-base-control {
    margin-bottom: 15px;
}

.components-base-control__label {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 5px;
}

.components-text-control__input,
.components-select-control__input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.components-text-control__input:focus,
.components-select-control__input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.components-toggle-control {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.components-toggle-control__label {
    margin-left: 10px;
    font-weight: 600;
    color: #1d2327;
}

/* Buttons */
.components-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.components-button.is-primary {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.components-button.is-primary:hover:not(:disabled) {
    background-color: #005a87;
    border-color: #005a87;
}

.components-button.is-secondary {
    background-color: white;
    color: #0073aa;
    border-color: #0073aa;
}

.components-button.is-secondary:hover:not(:disabled) {
    background-color: #f7f7f7;
}

.components-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Notices */
.components-notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    border-left: 4px solid;
}

.components-notice.is-success {
    background-color: #f0f9ff;
    border-left-color: #00a32a;
    color: #135e96;
}

.components-notice.is-error {
    background-color: #fcf0f1;
    border-left-color: #d63638;
    color: #b32d2e;
}

.components-notice.is-warning {
    background-color: #fcf9e8;
    border-left-color: #dba617;
    color: #996c00;
}

.components-notice.is-info {
    background-color: #f0f6fc;
    border-left-color: #72aee6;
    color: #135e96;
}

/* Cards */
.components-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.components-card__header {
    padding: 15px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.components-card__body {
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .providers-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .provider-actions {
        flex-direction: column;
    }
    
    .components-tab-panel__tabs {
        flex-wrap: wrap;
    }
    
    .cm-auto-alt-text-admin {
        margin: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .provider-card,
    .components-card {
        background-color: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .provider-card .components-card__header,
    .components-card__header {
        background-color: #2a2a2a;
        border-color: #444;
    }
    
    .components-text-control__input,
    .components-select-control__input {
        background-color: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .stat-item {
        border-color: #444;
    }
}

/* Loading spinner */
.components-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-left-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}