/**
 * Frontend Styles
 * My WordPress Plugin
 */

/* ==========================================================================
   ITNINJA Add Images - Frontend Interface
   ========================================================================== */

.itninja-add-images-wrapper {
    position: relative;
    margin: 20px 0;
}

.itninja-add-images-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.itninja-add-images-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.itninja-add-images-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.itninja-add-images-btn .itninja-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

.itninja-form-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.itninja-form-container .itninja-form-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.itninja-form-container h3 {
    margin: 0;
    font-size: 18px;
}

.itninja-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itninja-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.itninja-form-body {
    background: white;
    padding: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
    direction: rtl;
}

.itninja-current-images h4,
.itninja-add-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.itninja-current-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.itninja-image-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.itninja-image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.itninja-image-item .image-type {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.itninja-image-item.main-image {
    border-color: #e74c3c;
}

.itninja-image-item .remove-image {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itninja-url-inputs {
    margin-bottom: 20px;
}

.url-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.image-url-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    direction: ltr;
    text-align: left;
}

.image-url-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.preview-btn, .remove-input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.preview-btn {
    background: #f39c12;
    color: white;
}

.preview-btn:hover {
    background: #e67e22;
}

.remove-input {
    background: #e74c3c;
    color: white;
    width: 30px;
}

.remove-input:hover {
    background: #c0392b;
}

/* ==========================================================================
   BULK INPUT INTERFACE
   ========================================================================== */

.itninja-bulk-input {
    margin-bottom: 20px;
}

.instruction-text {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.bulk-urls-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    direction: ltr;
    text-align: left;
    resize: vertical;
    transition: all 0.3s ease;
}

.bulk-urls-textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.bulk-urls-textarea::placeholder {
    color: #999;
    font-style: italic;
}

.bulk-input-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.urls-count {
    font-weight: bold;
    color: #3498db;
}

.separator {
    color: #ccc;
}

.urls-status {
    color: #27ae60;
}

.main-image-selection {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.main-image-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.main-image-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.itninja-form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.itninja-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.itninja-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.itninja-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.itninja-btn.secondary {
    background: #95a5a6;
    color: white;
}

.itninja-btn.secondary:hover {
    background: #7f8c8d;
}

.itninja-preview-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border: 2px solid #27ae60;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.preview-item .preview-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.preview-item button {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    color: white;
}

.set-main {
    background: #e74c3c;
}

.add-gallery {
    background: #27ae60;
}

.remove-preview {
    background: #95a5a6;
}

.itninja-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.itninja-error {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
}

.itninja-success {
    background: #27ae60;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
}

.itninja-warning {
    background: #f39c12;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
    white-space: pre-line;
}

/* Responsive Design */
@media (max-width: 768px) {
    .itninja-form-container {
        padding: 10px;
    }
    
    .itninja-form-body {
        max-height: 90vh;
        padding: 15px;
    }
    
    .itninja-current-grid,
    .itninja-preview-area {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .url-input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .preview-btn, .remove-input {
        width: 100%;
    }
}

.mwp-hello {
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    font-size: 16px;
    text-align: center;
}

.mwp-button {
    display: inline-block;
    padding: 12px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.mwp-button:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mwp-button-primary {
    background-color: #0073aa;
    color: #ffffff;
}

.mwp-button-primary:hover {
    background-color: #005a87;
    color: #ffffff;
}

.mwp-button-secondary {
    background-color: #666666;
    color: #ffffff;
}

.mwp-button-secondary:hover {
    background-color: #444444;
    color: #ffffff;
}

.mwp-button-success {
    background-color: #46b450;
    color: #ffffff;
}

.mwp-button-success:hover {
    background-color: #368f3c;
    color: #ffffff;
}

.mwp-button-warning {
    background-color: #ffb900;
    color: #ffffff;
}

.mwp-button-warning:hover {
    background-color: #e6a500;
    color: #ffffff;
}

.mwp-button-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.mwp-button-danger:hover {
    background-color: #c82333;
    color: #ffffff;
}

/* Responsive design */
@media (max-width: 768px) {
    .mwp-button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .mwp-hello {
        padding: 10px;
        font-size: 14px;
    }
}

/* Inline image search results - square cards */
.wapi-image-result {
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 12px;
    margin: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    min-height: 180px;
    transition: box-shadow 0.2s;
}
.wapi-image-result img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f8f8;
    border: 1px solid #eee;
    margin-bottom: 10px;
}
.wapi-image-title {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    margin-bottom: 4px;
    text-align: center;
}
.wapi-image-source {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    text-align: center;
}
.wapi-trust-score {
    font-size: 11px;
    color: #46b450;
    margin-bottom: 6px;
    text-align: center;
}
.wapi-image-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}
.wapi-inline-results-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
        gap: 0;
        justify-items: stretch;
        align-items: start;
        direction: ltr;
        margin: 0;
}