/**
 * Square Thumbnails Admin Styles
 * 
 * @since 1.0.0
 */

/* Admin Container */
.sqt-admin-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.sqt-admin-main {
    flex: 1;
    min-width: 0;
}

.sqt-admin-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Title Count */
.title-count {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 13px;
    font-weight: normal;
    margin-left: 10px;
}

/* Postbox Improvements */
.sqt-admin-container .postbox {
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    background: #fff;
    margin-bottom: 20px;
}

.sqt-admin-container .postbox .hndle {
    padding: 15px;
    border-bottom: 1px solid #ccd0d4;
    background: #f9f9f9;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.sqt-admin-container .postbox .inside {
    padding: 20px;
}

/* Form Table Improvements */
.sqt-admin-container .form-table {
    margin: 0;
}

.sqt-admin-container .form-table th {
    width: 200px;
    font-weight: 600;
    padding: 20px 10px 20px 0;
}

.sqt-admin-container .form-table td {
    padding: 20px 10px;
}

.sqt-admin-container .form-table tr {
    border-bottom: 1px solid #f0f0f1;
}

.sqt-admin-container .form-table tr:last-child {
    border-bottom: none;
}

/* Color Picker */
.sqt-color-picker {
    width: 150px;
}

.wp-picker-container {
    display: inline-block;
}

/* Spinner */
.spinner {
    margin-left: 10px;
}

.spinner.is-active {
    visibility: visible;
}

/* Auto-save indicator */
.sqt-auto-save-notice {
    display: inline-block;
    margin-left: 10px;
    color: #2271b1;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sqt-auto-save-notice.visible {
    opacity: 1;
}

/* Notice fade animations */
#sqt-settings-notice {
    transition: opacity 0.3s ease;
}

/* Description */
.description {
    margin-top: 5px;
    color: #646970;
    font-style: italic;
}

/* Sidebar Buttons */
.sqt-admin-sidebar .button {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

/* Success Notice */
#sqt-settings-notice {
    margin: 15px 0;
}

/* Submit Button Area */
.submit {
    margin-top: 20px;
    padding: 0;
}

/* Responsive */
@media screen and (max-width: 1200px) {
    .sqt-admin-container {
        flex-direction: column;
    }
    
    .sqt-admin-sidebar {
        width: 100%;
        order: -1;
    }
}

/* Features List */
.sqt-admin-container ul {
    list-style: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.sqt-admin-container ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Headings */
.sqt-admin-container h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.sqt-admin-container h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

/* Links */
.sqt-admin-container a {
    text-decoration: none;
}

.sqt-admin-container a:hover {
    text-decoration: underline;
}

/* Checkboxes */
.sqt-admin-container input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* Select Elements */
.sqt-admin-container select {
    min-width: 150px;
}

/* Format Badges */
.sqt-formats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.sqt-format-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
}

.sqt-format-badge:nth-child(4) {
    background: #00a32a; /* WebP - green */
}

.sqt-format-badge:nth-child(5) {
    background: #8b5cf6; /* AVIF - purple */
}

.sqt-format-badge:nth-child(6) {
    background: #f59e0b; /* BMP - amber */
}

/* Radio Buttons */
.sqt-admin-container fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.sqt-admin-container fieldset label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.sqt-admin-container fieldset input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* Conditional rows */
.sqt-bg-color-row,
.sqt-bg-transparent-row {
    transition: opacity 0.3s ease;
}

/* Number Input */
.sqt-admin-container input[type="number"] {
    vertical-align: middle;
}

/* Small Image Settings */
.sqt-admin-container input#sqt_min_size {
    margin-right: 5px;
}

/* Square Thumbnails Pro Banner Styles */
.sqt-pro-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none !important;
    color: rgb(0, 0, 0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.sqt-pro-banner .hndle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgb(0, 0, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.sqt-pro-badge {
    background: #ff6b6b;
    color: rgb(0, 0, 0);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.sqt-pro-content h3 {
    color: rgb(0, 0, 0);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

.sqt-pro-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.sqt-pro-features li {
    color: rgb(1, 1, 1);
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.sqt-pro-features li .dashicons {
    color: #4ade80;
    margin-right: 8px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.sqt-pro-cta {
    text-align: center;
    margin-top: 20px;
}

.sqt-pro-notify-btn, 
.sqt-pro-notify-btn-modal {
    background: #4ade80 !important;
    border-color: #4ade80 !important;
    color: rgb(10, 10, 10) !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

.sqt-pro-notify-btn:hover,
.sqt-pro-notify-btn-modal:hover {
    background: #22c55e !important;
    border-color: #22c55e !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

.sqt-pro-pricing {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    margin-bottom: 0;
}

.sqt-pro-pricing small {
    font-size: 11px;
}

/* Performance Banner */
.sqt-performance-banner {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: none !important;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3) !important;
}

.sqt-performance-banner .hndle {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b5a3c;
    border-bottom: 1px solid rgba(139, 90, 60, 0.2);
}

.sqt-performance-content h4 {
    color: #8b5a3c;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 15px;
}

.sqt-performance-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.sqt-performance-features li {
    color: #8b5a3c;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.sqt-performance-features strong {
    color: #7c2d12;
}

.sqt-performance-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.sqt-stat {
    text-align: center;
}

.sqt-stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #7c2d12;
    line-height: 1;
}

.sqt-stat-label {
    display: block;
    font-size: 11px;
    color: #8b5a3c;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sqt-admin-container {
        flex-direction: column;
    }
    
    .sqt-admin-sidebar {
        width: 100%;
        order: -1;
    }
    
    .sqt-performance-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Hover Effects */
.sqt-pro-banner:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.sqt-performance-banner:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Modal Dialog Styles */
.sqt-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.sqt-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 480px;
    max-width: 90%;
    position: relative;
    animation: sqtModalFadeIn 0.3s;
}

@keyframes sqtModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sqt-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.sqt-modal-close:hover {
    color: #333;
}

/* Admin Notice Styles */
.sqt-pro-admin-notice {
    position: relative;
    padding: 10px 12px;
    border-left-color: #667eea !important;
    animation: sqtNoticeFadeIn 0.5s;
}

.sqt-pro-notice-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sqt-see-more {
    margin-left: 10px;
    text-decoration: none;
    color: #0073aa;
    font-size: 13px;
    transition: color 0.2s;
}

.sqt-see-more:hover {
    color: #00a0d2;
    text-decoration: underline;
}

/* Floating Modal Styles */
.sqt-floating-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.sqt-floating-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 600px;
    max-width: 90%;
    position: relative;
    animation: sqtModalFadeIn 0.3s;
}

.sqt-floating-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.sqt-floating-modal-close:hover {
    color: #333;
}

.sqt-pro-banner-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    color: rgb(0, 0, 0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sqt-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #23282d;
    font-size: 18px;
}

.sqt-modal-form {
    margin-top: 20px;
}

.sqt-modal-form input[type="email"] {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sqt-privacy-note {
    color: #666;
    margin-bottom: 15px;
}

.sqt-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.sqt-modal-success {
    text-align: center;
    padding: 20px 0 10px;
}

.sqt-modal-success p {
    color: #46b450;
    font-size: 16px;
    margin-bottom: 20px;
}

.sqt-modal-close-btn {
    margin: 0 auto;
    display: block;
}

/* Admin Notice Styles */
.sqt-pro-admin-notice {
    padding: 12px 15px;
    border-left-color: #667eea !important;
    position: relative;
}

.sqt-pro-notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sqt-see-more {
    background: #667eea;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: auto;
}

.sqt-see-more:hover {
    background: #5a6edf;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Floating Modal Styles */
.sqt-floating-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.sqt-floating-modal-content {
    background-color: #fff;
    margin: 8% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 580px;
    max-width: 90%;
    position: relative;
    animation: sqtModalFadeIn 0.3s;
}

.sqt-floating-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.sqt-floating-modal-close:hover {
    color: #333;
}

.sqt-pro-banner-container {
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: rgb(0, 0, 0);
}

.sqt-pro-notify-btn-modal {
    background: #4ade80 !important;
    border-color: #4ade80 !important;
    color: rgb(10, 10, 10) !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

.sqt-pro-notify-btn-modal:hover {
    background: #22c55e !important;
    border-color: #22c55e !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

.sqt-performance-features {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
}

.sqt-performance-features h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: rgb(0, 0, 0);
    font-size: 15px;
}

.sqt-performance-features ul {
    list-style: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.sqt-performance-features li {
    color: rgb(10, 10, 10);
    margin-bottom: 8px;
    font-size: 13px;
}

.sqt-performance-features strong {
    color: rgb(5, 5, 5);
    font-weight: 600;
}

/* Modal Form Styles */
.sqt-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.sqt-modal-form input[type="email"] {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sqt-privacy-note {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.sqt-modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.sqt-modal-success {
    text-align: center;
    padding: 20px 0;
}

.sqt-modal-success p {
    font-size: 16px;
    color: #22c55e;
    margin-bottom: 20px;
}

/* Add small animation for the notice */
@keyframes sqtNoticeFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sqt-pro-admin-notice {
    animation: sqtNoticeFadeIn 0.5s;
}

.sqt-pro-banner-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    color: rgb(0, 0, 0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Form Styles */
.sqt-modal-form input[type="email"],
.sqt-modal-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.sqt-modal-form input[type="email"]:focus,
.sqt-modal-form input[type="text"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.sqt-form-field {
    margin-top: 10px;
}

/* Mailchimp Integration */
.sqt-mailchimp-lists {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.sqt-mailchimp-lists ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.sqt-mailchimp-lists li {
    margin-bottom: 8px;
}

.sqt-mailchimp-lists code {
    background: #e9e9e9;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}