/**
 * ShopGlut Gallery Shortcode Admin Styles
 *
 * @package Shopglut
 * @subpackage GalleryShortcode
 * @since 1.0.0
 */

/* Main Gallery Admin Styles */
.shopglut-gallery-admin {
    max-width: 1200px;
    margin: 0 auto;
}

/* Gallery Overview Stats */
.shopglut-gallery-overview {
    margin: 20px 0;
}

.shopglut-gallery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-left: 4px solid #0073aa;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #0073aa;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Gallery List Table */
.shopglut-gallery-list-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.shopglut-gallery-table {
    margin: 0;
}

.shopglut-gallery-table .check-column {
    width: 20px;
}

.shopglut-gallery-table td,
.shopglut-gallery-table th {
    padding: 12px 10px;
}

.shopglut-gallery-table code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.copy-shortcode {
    margin-left: 8px;
    font-size: 11px;
    line-height: 1.4;
}

.gallery-layout-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.gallery-layout-badge.layout-grid {
    background: #e6f3ff;
    color: #0073aa;
}

.gallery-layout-badge.layout-isotope {
    background: #f0f8ff;
    color: #005a87;
}

.gallery-layout-badge.layout-carousel {
    background: #fff3e0;
    color: #ff9800;
}

.gallery-layout-badge.layout-masonry {
    background: #f3e5f5;
    color: #9c27b0;
}

/* No Galleries Message */
.no-galleries {
    text-align: center;
    padding: 40px 20px;
}

.no-galleries p {
    margin-bottom: 20px;
    color: #666;
}

/* Gallery Form */
.shopglut-gallery-form {
    background: #fff;
    border-radius: 4px;
}

.gallery-form-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

.gallery-form-main {
    min-width: 0;
}

.gallery-form-sidebar {
    min-width: 0;
}

/* Form Tables */
.shopglut-gallery-form .form-table th {
    width: 200px;
    font-weight: 600;
    color: #23282d;
}

.shopglut-gallery-form .form-table td {
    padding: 15px 10px;
}

/* Column Controls */
.column-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.column-controls > div {
    display: flex;
    flex-direction: column;
}

.column-controls label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #666;
}

.column-controls select {
    width: 100%;
}

/* Category Selector */
.category-selector select {
    width: 100%;
    min-height: 100px;
}

/* Display Options */
.display-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.display-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Layout Settings */
.layout-settings > div {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.layout-settings > div:first-child {
    margin-top: 0;
}

.filter-position-container {
    margin-top: 10px;
}

/* Button Styles */
.shopglut-gallery-form .submitbox #delete-action {
    margin-bottom: 10px;
}

.shopglut-gallery-form .submitbox .deletion {
    color: #a00;
    text-decoration: none;
}

.shopglut-gallery-form .submitbox .deletion:hover {
    color: #dc3232;
}

/* Shortcode Info */
.shortcode-info {
    margin-bottom: 20px;
}

.shortcode-info code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Preview Section */
.gallery-preview {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.gallery-preview h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.preview-iframe {
    width: 100%;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Settings Page */
.shopglut-gallery-settings .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.shopglut-gallery-settings .info-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    border-radius: 4px;
}

.shopglut-gallery-settings .info-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #23282d;
}

.shopglut-gallery-settings .info-card code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.shopglut-gallery-settings .info-card ul {
    margin: 10px 0;
    padding-left: 20px;
}

.shopglut-gallery-settings .info-card ul li {
    margin-bottom: 5px;
}

/* Media Uploader */
.media-uploader-button,
.media-remove-button {
    margin-top: 8px;
    margin-right: 8px;
}

.media-preview {
    margin-top: 10px;
    max-width: 100px;
}

.media-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-form-wrapper {
        grid-template-columns: 1fr;
    }

    .gallery-form-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .column-controls {
        grid-template-columns: 1fr;
    }

    .shopglut-gallery-stats {
        grid-template-columns: 1fr;
    }

    .shopglut-gallery-form .form-table th {
        width: auto;
        display: block;
        padding-bottom: 5px;
    }

    .shopglut-gallery-form .form-table td {
        display: block;
        padding: 0 0 15px 0;
    }

    .stat-card h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .shopglut-gallery-table th,
    .shopglut-gallery-table td {
        padding: 8px 5px;
        font-size: 13px;
    }

    .copy-shortcode {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Compatibility with WordPress Admin */
.wp-admin .shopglut-gallery-admin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wp-admin .shopglut-gallery-admin h1,
.wp-admin .shopglut-gallery-admin h2,
.wp-admin .shopglut-gallery-admin h3 {
    font-weight: 600;
}

.wp-admin .shopglut-gallery-admin button {
    font-family: inherit;
}

.wp-admin .shopglut-gallery-admin input,
.wp-admin .shopglut-gallery-admin select,
.wp-admin .shopglut-gallery-admin textarea {
    font-family: inherit;
    font-size: 14px;
}

/* Color Picker Integration */
.wp-color-picker {
    width: 80px;
}

/* Tabs (if needed) */
.gallery-tabs {
    margin-bottom: 20px;
}

.gallery-tabs .nav-tab-wrapper {
    margin-bottom: 0;
}

.gallery-tabs .nav-tab {
    margin-bottom: 0;
}

/* Tooltips */
.gallery-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.gallery-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.gallery-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Progress Indicator */
.gallery-progress {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.gallery-progress-bar {
    height: 100%;
    background: #0073aa;
    width: 0;
    transition: width 0.3s ease;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.active {
    background: #00a32a;
}

.status-indicator.inactive {
    background: #d63638;
}

.status-indicator.pending {
    background: #dba617;
}