/* Canto ACF Integration Styles */

.canto-acf-wrapper {
    margin-top: 10px;
}

.canto-acf-select-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.canto-acf-select-button:hover {
    background: #005a87;
    color: white;
}

.canto-acf-select-button:focus {
    outline: 1px solid #5b9dd9;
    outline-offset: -1px;
}

/* Modal Styles */
.canto-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canto-modal-content {
    background: white;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.canto-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 4px 4px 0 0;
}

.canto-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.canto-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.canto-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.canto-modal-body {
    flex: 1;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.canto-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.canto-loading img {
    margin-bottom: 15px;
    width: 32px;
    height: 32px;
}

.canto-loading p {
    margin: 0;
    font-size: 14px;
}

#canto-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .canto-modal-content {
        width: 95%;
        height: 90%;
        margin: 20px;
    }
    
    .canto-modal-header {
        padding: 15px;
    }
    
    .canto-modal-header h2 {
        font-size: 16px;
    }
}

/* Integration with ACF styles */
.acf-field .canto-acf-wrapper {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e1e1;
}

.acf-field[data-type="image"] .canto-acf-wrapper,
.acf-field[data-type="file"] .canto-acf-wrapper,
.acf-field[data-type="gallery"] .canto-acf-wrapper {
    display: block;
}

/* Button icon */
.canto-acf-select-button .wp-media-buttons-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    background: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>') no-repeat center;
    background-size: contain;
}

/* Loading state improvements */
.canto-modal-body .canto-loading {
    background: #f9f9f9;
}

/* Error states */
.canto-error {
    color: #d63638;
    padding: 20px;
    text-align: center;
    background: #fff2f2;
    border: 1px solid #f0c2c2;
    margin: 20px;
    border-radius: 4px;
}

/* Success feedback */
.canto-success {
    color: #00a32a;
    padding: 10px;
    background: #f0f8f0;
    border: 1px solid #c8e6c9;
    border-radius: 3px;
    margin-top: 10px;
    font-size: 13px;
}

.canto-acf-button {
    background-image: url('../canto-icon.png') !important;
    background-repeat: no-repeat !important;
    background-position: 8px center !important;
    background-size: 16px 16px !important;
    padding-left: 30px !important;
} 