/**
 * CSS para Modais de Busca e Compartilhamento
 * Estilos modernos e responsivos
 */

/* ===============================================
   MODAL BASE STYLES
   =============================================== */

.search-modal,
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-modal.active,
.share-modal.active {
    display: flex;
    opacity: 1;
}

.search-modal-content,
.share-modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content,
.share-modal.active .share-modal-content {
    transform: scale(1);
}

/* ===============================================
   MODAL HEADER
   =============================================== */

.search-modal-header,
.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.search-modal-header h3,
.share-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.search-close,
.share-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
    color: #666;
}

.search-close:hover,
.share-close:hover {
    background: #e9ecef;
    color: #333;
}

.search-close .dashicons,
.share-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ===============================================
   MODAL BODY
   =============================================== */

.search-modal-body,
.share-modal-body {
    padding: 24px;
}

/* ===============================================
   SEARCH MODAL ESPECÍFICO
   =============================================== */

.search-form-modal {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-field-modal {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    outline: none;
}

.search-field-modal:focus {
    border-color: var(--accent-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.search-submit-modal {
    background: var(--accent-color, #007cba);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.search-submit-modal:hover {
    background: #005a8b;
}

.search-submit-modal .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Sugestões de busca */
.search-suggestions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.search-suggestions h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.search-recent-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-recent-results li {
    margin-bottom: 8px;
}

.search-recent-results li a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.search-recent-results li a:hover {
    background: #f8f9fa;
    color: var(--accent-color, #007cba);
}

/* ===============================================
   SHARE MODAL ESPECÍFICO
   =============================================== */

.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    text-align: center;
    gap: 8px;
}

.share-option:hover {
    border-color: var(--accent-color, #007cba);
    background: rgba(0, 124, 186, 0.05);
    color: var(--accent-color, #007cba);
    text-decoration: none;
}

.share-option .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.share-option span:not(.dashicons) {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Container da URL */
.share-url-container {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-url-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.share-url-wrapper {
    display: flex;
    gap: 8px;
}

.share-url-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
    color: #666;
    outline: none;
}

.copy-url-button {
    background: var(--accent-color, #007cba);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-url-button:hover {
    background: #005a8b;
}

.copy-url-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===============================================
   FEEDBACK VISUAL
   =============================================== */

.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.copy-success.show {
    transform: translateX(0);
}

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 768px) {
    .search-modal-content,
    .share-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .search-modal-header,
    .share-modal-header {
        padding: 16px 20px;
    }
    
    .search-modal-body,
    .share-modal-body {
        padding: 20px;
    }
    
    .search-form-modal {
        flex-direction: column;
    }
    
    .search-submit-modal {
        justify-content: center;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-url-wrapper {
        flex-direction: column;
    }
    
    .copy-success {
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }
    
    .copy-success.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .share-options {
        grid-template-columns: 1fr;
    }
    
    .search-modal-header h3,
    .share-modal-header h3 {
        font-size: 1.1rem;
    }
}